O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — creating some game info text objects

  1. Add a new method in the game class called CreateInfoText.
    Method CreateInfoText:Int ()
    
  2. Create the text objects txtScore. It is reset to the layer layerUI.
    txtScore = eng.CreateText(font1,"Score: "+score,0,0)
    txtScore.SetLayer(layerUI)
    
  3. Now, create the text objects txtScore, txtComets, and txtLifes. Again, they are set to the layer called layerUI.
    txtLevel = eng.CreateText(font1,"Level: "+levelNumber,eng.canvasWidth-5,0,2) txtLevel.SetLayer(layerUI) txtComets = eng.CreateText(font1,"Comets: "+cometCount,0,eng.canvasHeight-font1.lineHeight) txtComets.SetLayer(layerUI) txtLifes = eng.CreateText(font1,"Lifes: "+lifes,eng.canvasWidth-5,eng.canvasHeight-font1.lineHeight,2) txtLifes.SetLayer(layerUI) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required