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 title screen

Our title screen will be composed of a nice single-colored background, the text Balls Out!, and two text buttons to Play and Exit the game:

  1. Create the CreateTitleScreen method inside the game class.
    Method CreateTitleScreen:Int ()
    
  2. Create a new box object, assign it to the title layer, and set the color to a nice blue.
    Local box:ftObject = eng.CreateBox(cw-20,ch-20,cw/2,ch/2)
    box.SetLayer(layerTitle)
    box.SetColor(0,0,255)
    
  3. Now, create a text object that is also assigned to the title layer. Scale it to the factor 3.
    Local tx1:ftObject = eng.CreateText(font1,"Balls Out!",cw/2,ch/5,1)
    tx1.SetLayer(layerTitle)
    tx1.SetScale(3.0)
    
  4. To start and exit the game, we need two text buttons, both scaled to factor 1.5 and ...

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