O'Reilly logo

Haxe Game Development Essentials by Jeremy McCurdy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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!

Adding imports

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required