This is the last part of airplane shooting game. In the previous posts, I have explained the core sprites. In this post, I will introduce two auxilliary spirtes which are supposed to enhance the visual effects of the game.
Powerups Sprite
This sprite has two functions – as a health booster or a protective shield. The code segment of “when I receive Game” calls Spawn block with a random interval of 10 – 20 seconds.

The block “Spawn” definds the behaviour of the Powerups sprite. It chooses its constume randomly from two choices: Health or shield. When costume is Health, it moves left and if it touches Player sprite, disappear and boost Player Health to 100 percent. When the costume is shield, it also moves left and if it touches Player, move together with the Player and cover Player sprite with a shield. Meanwhile, set Invisible variable to True.
When Invisible variable is True, Enemies sprite clone will get destroyed when touching the shield, and Enemies bullet clone will get boucing back and disappear. All of those behaviours have been defined in Enemies sprite, which I have analyzed in the first post.

No matter the costume is Health or shield, when Powerups sprite touches Player sprite, the code will call “Particles” block. This block will fill Particle list with three items, x and y position of Powerups sprite and a random value representing the total clones of Particles sprite. At the end of the block definition, it will broadcast “Particles” message, which will be received by Particles sprite.

The following short segments define the behavior of Powerups sprite when Green Flag is clicked or when the game is a success or game over. Generally, Powerups sprite will hide itself or delete all of its clones under those conditions. I will not further explain them here.


Particles Sprite
Particles sprite display when the Powerups sprite touches Player sprite. It begins operation when it receives message of “Particles” from Prawn block of Powerups sprite. Particles list contains three items. The first and second items indicate the x and y position of Powerups sprite, which is also the initial position of Particles clones. The 3rd item of Particles list specifies the number of Particle clones. With this information, “when I receive Particles” code segment creates several clones of Particles.

In “when I start as a clone” code segment, Particles clone is set to a random size, changes x and y position by a random value. It scatters around like beads until it touches edge or becomes totally transparent. Generally, this sprite exists for decoration and visual effects. It is not regarded as a kind of weapons to attack Enemies sprite or Hosny sprite.

That is all for the analysis of the airplane shooting game. Can’t wait to design your own shooting game? Practice is the best teacher, and don’t forget to enjoy the coding and have fun!
Note: All the analysis articles are copyright products of http://www.thecodingfun.com. Anyone re-posting them should credit author and original source. Anyone using them for commercial purposes or translating them into other languages should notify TheCodingFun and get confirmation first. All Rights Reserved.