Variables are very important in coding. A variable is something that will vary in your program. Examples of common variables in games would be, Score & Lives.
- In your program create a Score Variable and place it on the screen.
- When the game starts set the Variable to zero.
- Add a reward Sprite onto your play area.
- Code the new Sprite so when it touches your knight, you get 10 points added to your score and it disappears.
- Clone your Reward Sprites.