8- 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:
All above sprites and the backdrop are in prg8.zip.
You adjust the difficulty of the game by changing the time inteval in the “glide” block,
… 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.