Game Development Reference
In-Depth Information
The gameplay mechanic
As mentioned in the previous game, which explains the mechanism of the gameplay loop,
it will be better for you to work from scratch to understand the logic you got with the topic.
With that said, let's break down the gameplay logic:
1. Once the game starts, the fruitsGame blueprint will reset the score to zero and up-
date its UI text. It will then start picking a random value for the fruits and the posi-
tions to be instantiated. It will then start shooting the fruits/bombs to the player.
2. The fruitsGame blueprint sets the rendering camera to the one we want.
3. The process of shooting fruits was set to shoot 70 fruits in all per level. You can
change this, of course, but it is better to keep it in such a rage to kill the boredom
of the long levels and gameplay sessions.
4. The shooting process contains a custom for loop, which you will learn to create.
For this loop, you have to wait 0.7 seconds each time a loop is completed. After
that, a random fruit blueprint is picked and a random point to shoot the next fruit/
bomb is selected.
5. Each fruit will be moved by the physics component, and whenever the player
touches it, it will add two sprites (chopped pieces) and destroy the full fruit sprite.
It will then spawn the particles in the fruit's current position, and finally, search for
fruitsGame and call its AddScore function to add the new score to the UI.
However, if the player hits a bomb blueprint, it will call the OpenLevel function
and open the lose level.
6. During Event Tick of fruitsGame , it will be looking forward to see if the player
hit 50 in the playerScore variable; if yes, the game will show the win level.
Search WWH ::




Custom Search