1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
Strict Import mojo Import diddy Global titleScreen:TitleScreen Function Main:Int() game = New MyGame() Return 0 End Class MyGame Extends DiddyApp Method OnCreate:Int() Super.OnCreate() titleScreen = New TitleScreen titleScreen.PreStart() Return 0 End End Class TitleScreen Extends Screen Method New() name = "Title" End Method Start:Void() game.screenFade.Start(50, false) End Method Render:Void() Cls DrawText "TITLE SCREEN!", SCREEN_WIDTH2, SCREEN_HEIGHT2, 0.5, 0.5 DrawText "Click to Play!", SCREEN_WIDTH2, SCREEN_HEIGHT2 + 20, 0.5, 0.5 DrawText "Escape to Quit!", SCREEN_WIDTH2, SCREEN_HEIGHT2 + 40, 0.5, 0.5 End Method Update:Void() If KeyHit(KEY_ESCAPE) game.screenFade.Start(50, true) game.nextScreen = game.exitScreen End End End |