class flixel.FlxBasic implements IFlxDestroyable

Available on all platforms

This is a useful "generic" Flixel object. Both FlxObject and * FlxGroup extend this class. Has no size, position or graphical data.

Class Fields

static var _ACTIVECOUNT:Int

Static counters for performance tracking.

static var _VISIBLECOUNT:Int

Instance Fields

var ID:Int

IDs seem like they could be pretty useful, huh? * They're not actually used for anything yet though.

var active:Bool

Controls whether update() is automatically called by FlxState/FlxGroup.

var alive:Bool

Useful state for many game objects - "dead" (!alive) vs alive. kill() and * revive() both flip this switch (along with exists, but you can override that).

var collisionType:FlxCollisionType

Enum that informs the collision system which type of object this is (to avoid expensive type casting).

var exists:Bool

This flag indicates whether this objects has been destroyed or not. * Cannot be set, use destroy() and revive().

var visible:Bool

Controls whether draw() is automatically called by FlxState/FlxGroup.

function new():Void

function destroy():Void

WARNING: This will remove this object entirely. Use kill() if you want to disable it temporarily only and revive() it later. * Override this function to null out variables manually or call destroy() on class members if necessary. Don't forget to call super.destroy()!

function draw():Void

Override this function to control how the object is drawn. * Overriding draw() is rarely necessary, but can be very useful.

function kill():Void

Handy function for "killing" game objects. Use reset() to revive them. Default behavior is to flag them as nonexistent AND dead. However, if you want the * "corpse" to remain in the game, like to animate an effect or whatever, you should override this, setting only alive to false, and leaving exists true.

function revive():Void

Handy function for bringing game objects "back to life". Just sets alive and exists back to true. * In practice, this function is most often called by FlxObject.reset().

function toString():String

function update():Void

Override this function to update your class's position and appearance. * This is where most of your game rules and behavioral code will go.