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 the score screen

To display the values of the highest scores, we will utilize the CreateHighScoreList method from Chapter 4, Game #3, CometCrusher, and make a few changes to it.

  1. For this, add a method called CreateScoreScreen to the game class.
    Method CreateScoreScreen:Int()
    
  2. Set the score layer as the default layer.
    eng.SetDefaultLayer(layerScore)
    
  3. Create a local text object to display the headline.
    Local txtTitleHightScore:ftObject = eng.CreateText(font1,"H I G H S C O R E S",cw/2,70.0,1)
    
  4. Start a FOR loop ranging from 1 to 10. This will be the factor that controls vertical placement of the list entries.
    For Local y:Int = 1 To 10
    
  5. Next, create a local text object that will display the entry number.
    Local txtScoreNum:ftObject ...

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