This screen will show some graphics of our planes, the game title, and two instructional messages on how to start the game or exit it.
1. To create the title screen, add a method called
CreateTitleScreen
to thegame
class.Method CreateTitleScreen:Int ()
2. Set the default layer to
layerTitle
.eng.SetDefaultLayer(layerTitle)
3. Next, create a box object covering the whole canvas. We want it to be white and that is its default color.
Local box:ftObject = eng.CreateBox(cw,ch,cw/2,ch/2)
4. Now, create a local text object for the game title. Place it in the center of the canvas and at one-fourth of the canvas height.
Local tx1:ftObject = eng.CreateText(font1,"Air Dogs 1942",cw/2,ch/4,1)
5. Scale the text object up by a factor of
2.0
.tx1.SetScale(2.0)
6. To inform the player about how to start the game, add a text object at the middle of the canvas.
Local tx2:ftObject = eng.CreateText(font1,"Press 'P' to play",cw/2,ch/2+20, 1)
7. To exit the game, we need...