Scratch Games about Three Kingdoms: 8- Borrow Arrows from Cao Cao

8- Borrow Arrows from Cao Cao

Scratch Game Borrow Arrows from Cao Cao

Zhou Yu wanted to test Zhuge Liang’s wisdom. He required Zhuge to build 100,000 arrows for him in three days, as a precondition of forming an alliance with Liu Bei. Zhuge Liang thought of a clever plan. He and Lu Su led a “straw boat” fleet to Cao Cao’s fort by the other side of the Yangtze river on a foggy morning, luring Cao’s army to shoot arrows onto those straw boats. 

In this episode, the “grass boat” will move up and down following the player’s keyboard inputs. Please receive as many arrows as possible. Let’s see if we can “borrow” 100 K arrows.

Total coding blocks: 27

Sprites and the backdrop:

Scratch Game Borrow Arrows from Cao Cao, backdrop

All above sprites and the backdrop are in prg8.zip.

Variable: count

Code:

(1) grassboat:

Scratch Game Borrow Arrows from Cao Cao, code #1

(2) cao2:

Scratch Game Borrow Arrows from Cao Cao, code #2

You adjust the difficulty of the game by changing the time inteval in the “glide” block, 

(3) arrow:

Scratch Game Borrow Arrows from Cao Cao, code #3

… or by changing the incresement of x for each iteration.

Here we use some new blocks. “make a clone of (…)” is to generate a copy of the sprite. And by using “when I start as a clone”, we can let these copies process some additional tasks synchronously.