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; import flixel.tweens.FlxEase; import flixel.util.FlxSpriteUtil;
The FlxColor
class will give us shortcuts for tinting text and screen effects. The FlxFlicker
class provides a quick blinking effect we can use in...