The following modifications have to be made to the game
class:
1. Insert the
eng
field, which will store the instance of theengine
class.Field eng:engine
2. Now, add a general object called
obj
. We will use this field during game setup.Field obj:ftObject
3. To display some text in the game, we need one object for the game score and one to display the FPS value we have talked about previously.
Field txtScore:ftObject Field txtFPS:ftObject
4. We will use a bitmap font in the game and store this font inside the
font1
object.Field font1:ftFont
5. Next, add the three layers for the background, the game itself, and the title screen.
Field layerBackGround:ftLayer Field layerGame:ftLayer Field layerTitle:ftLayer
6. For the only sound effect in the game , we need a sound object called
sndBing
.Field sndBing:ftSound
7. Now, add the
atlas
field to store the sprite sheet for the atom elements.Field atlas:Image
8. Usually a game has a score and so does Chain...