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 book. 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 update its UI text. It will then start picking a random value for the fruits and the positions 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.

The game levels

With the same method you already know, you will be creating 3 levels in this chapter. So, via the File menu and the New Level option, you will add three new levels. The first one for the gameplay itself, which I named base in my case, and the other two levels which will hold the game end screens. One of them I named lose and the other one, win. These two will be displayed based on the player's progression. Keep all of them empty at the moment until you figure out the blueprints you are going to use.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.71.21