Managing current score and high score

When playing games with a specific goal, such as saving the princess or escaping from the castle, players know exactly why they are playing: they must save the princess or escape from the castle.

In games like Astro-PANIC!, where there's no goal and you just have to survive as long as possible, the only way to have players come back to our game and play it again is giving the possibility to save their best score.

People will play again and again to achieve a better score.

At this time, we need two more class level variables: one to save the current score, which we call score, and another variable called hiscore, which will save our best score ever.

Add these two new variables:

private const BULLET_SPEED:uint=5; ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.