I was following along the haxe flixel guide for the hud creation on the tutorial game. I am currently using this piece of code for a hud
package;
import flixel.FlxBasic;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.group.FlxGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
using flixel.util.FlxSpriteUtil;
class HUD extends FlxTypedGroup<FlxSprite>
{
public var viewerText:FlxText;
public function new(viewers)
{
super();
viewerText = viewers;
}
}
When I test the program however I run into class not found: FlxTypedGroup. I can't seem to tell what is wrong with this code.
This is where I am creating my class.
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.util.FlxMath;
import flixel.util.FlxColor;
/**
* A FlxState which can be used for the actual gameplay.
*/
class PlayState extends FlxState
{
private var viewers:Int = 0;
/**
* Function that is called up when to state is created to set it up.
*/
override public function create():Void
{
viewers = 10;
var hudtoadd = new HUD(new FlxText(10,10,500, viewers));
//add(hudtoadd);
//add(hudtoadd.viewerText);
super.create();
}
/**
* Function that is called when this state is destroyed - you might want to
* consider setting all objects this state uses to null to help garbage collection.
*/
override public function destroy():Void
{
super.destroy();
}
/**
* Function that is called once every frame.
*/
override public function update():Void
{
super.update();
}
}