Game Development Reference
In-Depth Information
2.
Click on the checkboxes in front of the new variables to make them visible on
the stage. This way we can keep track of our scores.
3.
At the start of the game, we set the values of these variables to 0 as shown in
the following screenshot. The best place to do this is inside the stage object.
4.
Next, we will add a point to the correct variable when an enemy is defeated.
We already built a script to check when an enemy is touched by a spear sprite.
5.
Just before we delete this clone, we only need to change the correct variable by 1
point in the change <scoreRed> by () block as shown in the following screenshot:
It should be obvious that the scoreRed variable is meant for a red starfish. For the other
two colors, we would use scoreBlue and scoreYellow variables respecively.
 
Search WWH ::




Custom Search