Let's start modifying the game class.
1. Add a field to our
engine
class, the instance of the fantomEngine'sftEngine
class.Field eng:engine
2. Next, we have fields to store different
ftObject
instances, which need to be accessible at any time.Field obj:ftObject 'A general object Field player:ftObject 'Holds the player ship object Field shield:ftObject 'the Shield of the player
3. To store different text information, we will need some objects for these as well.
Field txtScore:ftObject 'Stores the game store info text Field txtLifes:ftObject 'The text info about the lifes left Field txtLevel:ftObject 'Shows which level we are in Field txtComets:ftObject 'Info about how many comets are left Field txtHighScore:ftObject[10] 'Score list(array) with 10 entries
4. Add a field that will hold the instance for our bitmap font.
Field font1:ftFont
5. Now, we need several
ftLayer
class instances.Field layerBackGround:ftLayer 'Groups all background stars...