Game Development Reference
In-Depth Information
Figure 9-8. SoundOn is equal to 0 rule
Position the Speaker actor on the scene at the bottom left corner.
You can now test your work in the Preview window of GameSalad.
Adding Score Keeping
Later in the chapter I will cover Game Center. But first you need to have a
scoring system. You will make it very simple. Every time a blue brick is
destroyed, one point will be added to the score. And every time a red brick is
destroyed, you will add two points to the score. To follow the project from this
point, open the file named BreakaWall-partII-step2.gameproj .
A game attribute of type Integer will be used to keep up with the score. You will
ensure a manual reset every time you start the game. And you will increment the
score every time a brick is hit. Last but not least, you will display the score on
the top right zone of the screen, so the player can keep up with his/her
progress.
First, let's create the score attribute. Create a new game attribute of type Integer
and name it ''Score.'' Keep the default value to zero.
 
Search WWH ::




Custom Search