Finally, we need to add the new HUD to the game. We're also going to use a
FlxGroup object to prevent our enemies appearing over the game's UI. Open up
PlayState.hx to get started.
As usual, we have a few imports to add:
import ui.GameHUD; import flixel.group.FlxGroup;
We need to add a couple of new variables:
private var gameHud:GameHUD; private var enemyLayer:FlxGroup;
gameHud variable will store our
GameHUD class, and
enemyLayer will store the group that will be used to layer enemies under the HUD.
Like when we made updates to the
LevelEndScreen class, we need to change a few things before we start adding new content. To start, go into the
variables section and delete these two ...