Professional Documents
Culture Documents
The concept of the game is very simple, you have to catch as many
apples as possible in the container to proceed to next level.
Next thing we have to change the score, as the game starts, we will
set the score to zero, and whenever the apple is catched the score
increases by 1.
We can see this in the above figure how score changes whenever an
apple is catched.
Now we have to write the code for the bombs which will reduce the
score by -5. The code is almost similar for bombs as for the apples.
At the starting the bombs will be set to any random x position then
they will fall vertically all with different speeds and if the container
touches the bombs then the score will be reduced by -5.
If the score reaches over 20, we will proceed to next level in the
next level we will introduce balloon which will be hidden until level 2
is reached, once level 2 is reached the balloon will show up and rest
of the code remains same as that of the apples.
Figure shows the coding for the balloon.
If we keep hitting the bombs and the score is reduced to less than
20 then game ends and everything stops and a spirit pops which says
game over.