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!
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 definition with its needed imports:
package source.ui; import flixel.FlxSprite; import flixel.util.FlxColor; import flixel.FlxG; import flixel.FlxState; import flixel.text.FlxText; class LevelEndScreen extends FlxState { public function new(score...