Project overview

The app we will build in this chapter is the second (and last) game of this book, after the Pong game we built in Chapter 4, Pong Game - 2D Animations and Gestures. This time, we'll deal with dice, and create a revisited version of the Knockout dice game.

The app will contain two screens: the first one will only contain a single dice that the user will be able to roll. This will show the animation that you'll create with Flare.

The screen will look similar to the following screenshot:

The second screen will contain the Knockout game. The rules are very simple:

  • The player plays against the device (which we will call AI in the app).
  • The player clicks the Play button. This will animate two dice (with six faces, from 1 to 6), and, after a few seconds, a random result will be generated.
  • The sum of the two dice will be added to the player's score unless the sum of the dice is 7 (knockout number).
  • If the sum of the two dice is 7, nothing will be added to the score.
  • The same rules apply to the AI, but the animation will be performed only for the human player. For the AI, only the score will change.
  • The game stops when the player or the AI reaches at least 50 points. When that happens, the player wins if their score is higher than the AI's score, and loses if the opposite is true. In the case of a draw, nobody wins.
  • At any time, the game can be reset by clicking the Restart button.

You can see an example of the layout of the Knockout Game screen in the following screenshot:

Completing this project should require about 3 hours, including the creation of the Flare animation.

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

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