Adding everything to PlayState
We're finally going to put everything together in
PlayState and have the new functionalities we created work in unison. To do this, we're going to add our
Player object, create a pool of the
ExplosionEffect objects, and handle collisions between projectiles and enemies, and between the player and enemies.
In addition, we'll make the background scroll and use the timer to increase variability in the game's score, as mentioned in the previous chapter.
It's a lot to do, so let's get started!
To start, let's add the imports we'll need:
import flixel.group.FlxTypedGroup; import flixel.addons.display.FlxBackdrop; import flixel.util.FlxColor;
The new class of note is the
FlxBackdrop class. This class is used to ...