To store the data, we will enhance the game
class with some fields and constants, as follows:
1. First, add two text objects that will display the scores of the player and the computer.
Class game Extends App Field eng:engine Field isSuspended:Bool = False Field txtScore:ftObject Field txtScoreC:ftObject
2. Next, add two text objects that will display if the player wins or loses.
Field txtYouWin:ftObject Field txtYouLoose:ftObject
3. The player plane and the enemy plane will be stored in separate objects.
Field player:ftObject Field enemy:ftObject
4. The game font also has to be stored.
Field font1:ftFont
5. Now, add five layers for the background, the game and clouds, and also the information and the title screen.
Field layerBackground:ftLayer Field layerGame:ftLayer Field layerClouds:ftLayer Field layerInfo:ftLayer Field layerTitle:ftLayer
6. To hold all the sound effects, we need a sound object for each sound.
Field sndHit:ftSound Field sndExplo...