O'Reilly logo

Haxe Game Development Essentials by Jeremy McCurdy

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

Creating the end screen

Now, let's make the screen that will appear when the game timer runs out. Once we have this made, we'll just need to set up the game timer, and we'll be done!

Creating the end screen class

First, let's make a folder under the source folder named ui. Since we'll eventually have a few user interface classes, we should organize them under a separate folder. This will put them in a different package, and these classes will need to be imported when used.

In the ui folder, create a class named LevelEndScreen. Previously, we made a class that extended FlxSprite and this time, we'll extend FlxState. This will allow us to create an object that can contain multiple visual elements instead of a single sprite.

Here's the initial class ...

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