Tracking the score
Let's set things up so that we can track a score for destroying the goalBall
sprites. Add another global variable and name it Score
, as shown in the following screenshot:
Then, add another goalBall
action. This time, make it an Add to action that adds to the value of Score. Let's insert 100
in the Value field, as shown in the following screenshot:
Then, just copy-and-paste this action to all the other goalBall
collision events. Now, every time a goalBall
sprite is destroyed, your player's score will increase by 100!