Building the splash screen

Let's make the first screen that players will see when the game starts. Since it is the first thing they see, we'll add some small touches that will help get players excited about playing the game. We'll add the background image with our main character, pogo, and the star graphic that will go behind it, and some text instructions to prompt players to continue the game.

We'll animate these things on screen in a very simple sequence using some tools that HaxeFlixel provides to improve the feel of games. We'll also add an old-school blinking effect to our input prompt.

Adding imports

To start, open MenuState.hx and add these import statements:

import flixel.util.FlxColor; import flixel.effects.FlxFlicker; import flixel.tweens.FlxTween; ...

Get Haxe Game Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.