A very basic rendering component which uses drawTriangles(). You have access to vertices, indices and uvtData vectors which are used as data storages for rendering. The whole FlxGraphic object is used as a texture for this sprite. Use these links for more info about drawTriangles():

See:

http://www.flashandmath.com/advanced/p10triangles/index.html WARNING: This class is EXTREMELY slow on Flash!

Constructor

new(?X:Float, ?Y:Float, ?SimpleGraphic:FlxGraphicAsset)

Variables

colors:DrawData<Int> = new DrawData<Int>()

indices:DrawData<Int> = new DrawData<Int>()

A Vector of integers or indexes, where every three indexes define a triangle.

repeat:Bool = false

uvtData:DrawData<Float> = new DrawData<Float>()

A Vector of normalized coordinates used to apply texture mapping.

vertices:DrawData<Float> = new DrawData<Float>()

A Vector of floats where each pair of numbers is treated as a coordinate location (an x, y pair).

Methods

Inherited Variables

Defined by FlxSprite

alpha:Float = 1.0

Set alpha to a number between 0 and 1 to change the opacity of the sprite.

animation:FlxAnimationController

Class that handles adding and playing animations on this sprite.

antialiasing:Bool = false

Controls whether the object is smoothed when rotated, affects performance.

read onlybakedRotationAngle:Float = 0

The minimum angle (out of 360°) for which a new baked rotation exists. Example: 90 means there are 4 baked rotations in the spritesheet. 0 if this sprite does not have any baked rotations.

blend:BlendMode

Blending modes, just like Photoshop or whatever, e.g. "multiply", "screen", etc.

clipRect:FlxRect

Clipping rectangle for this sprite. Changing the rect's properties directly doesn't have any effect, reassign the property to update it (sprite.clipRect = sprite.clipRect;). Set to null to discard graphic frame clipping.

color:FlxColor = 0xffffff

Tints the whole sprite to a color (0xRRGGBB format) - similar to OpenGL vertex colors. You can use 0xAARRGGBB colors, but the alpha value will simply be ignored. To change the opacity use alpha.

dirty:Bool = true

Set this flag to true to force the sprite to update during the draw() call. NOTE: Rarely if ever necessary, most sprite operations will flip this flag automatically.

facing:Int = FlxObject.RIGHT

Can be set to FlxObject.LEFT, RIGHT, UP, and DOWN to take advantage of flipped sprites and/or just track player orientation more easily.

flipX:Bool = false

Whether this sprite is flipped on the X axis.

flipY:Bool = false

Whether this sprite is flipped on the Y axis.

frame:FlxFrame

Link to current FlxFrame from loaded atlas

read onlyframeHeight:Int = 0

The height of the actual graphic or image being displayed (not necessarily the game object/bounding box).

framePixels:BitmapData

The current display state of the sprite including current animation frame, tint, flip etc... may be null unless useFramePixels is true.

read onlyframeWidth:Int = 0

The width of the actual graphic or image being displayed (not necessarily the game object/bounding box).

frames:FlxFramesCollection

Rendering variables.

read onlynumFrames:Int = 0

The total number of frames in this image. WARNING: assumes each row in the sprite sheet is full!

read onlyoffset:FlxPoint

Controls the position of the sprite's hitbox. Likely needs to be adjusted after changing a sprite's width, height or scale.

read onlyorigin:FlxPoint

WARNING: The origin of the sprite will default to its center. If you change this, the visuals and the collisions will likely be pretty out-of-sync if you do any rotation.

pixels:BitmapData

This sprite's graphic / BitmapData object. Automatically adjusts graphic size and render helpers if changed.

read onlyscale:FlxPoint

Change the size of your sprite's graphic. NOTE: The hitbox is not automatically adjusted, use updateHitbox() for that (or setGraphicSize()). WARNING: With FlxG.renderBlit, scaling sprites decreases rendering performance by a factor of about x10!

shader:FlxShader

GLSL shader for this sprite. Only works with OpenFL Next or WebGL. Avoid changing it frequently as this is a costly operation.

Available since

4.1.0

.

read onlyuseColorTransform:Bool = false

Whether or not to use a ColorTransform set via setColorTransform().

useFramePixels:Bool = true

Always true on FlxG.renderBlit. On FlxG.renderTile it determines whether framePixels is used and defaults to false for performance reasons.

Defined by FlxObject

read onlyacceleration:FlxPoint

How fast the speed of this object is changing (in pixels per second). Useful for smooth movement and gravity.

allowCollisions:Int = ANY

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating collision directions. Use bitwise operators to check the values stored here. Useful for things like one-way platforms (e.g. allowCollisions = UP;). The accessor "solid" just flips this variable between NONE and ANY.

angle:Float = 0

Set the angle (in degrees) of a sprite to rotate it. WARNING: rotating sprites decreases their rendering performance by a factor of ~10x when using blitting!

angularAcceleration:Float = 0

How fast the spin speed should change (in degrees per second).

angularDrag:Float = 0

Like drag but for spinning.

angularVelocity:Float = 0

This is how fast you want this sprite to spin (in degrees per second).

collisonXDrag:Bool = true

Whether this sprite is dragged along with the horizontal movement of objects it collides with (makes sense for horizontally-moving platforms in platformers for example).

debugBoundingBoxColor:Null<FlxColor> = null

Overriding this will force a specific color to be used for debug rect (ignoring any of the other debug bounding box colors specified).

debugBoundingBoxColorNotSolid:FlxColor = FlxColor.BLUE

Color used for the debug rect if allowCollisions == FlxObject.NONE.

Available since

4.2.0

.

debugBoundingBoxColorPartial:FlxColor = FlxColor.GREEN

Color used for the debug rect if this object collides partially (immovable in the case of FlxObject, or allowCollisions not equal to FlxObject.ANY or FlxObject.NONE in the case of tiles in FlxTilemap).

Available since

4.2.0

.

debugBoundingBoxColorSolid:FlxColor = FlxColor.RED

Color used for the debug rect if allowCollisions == FlxObject.ANY.

Available since

4.2.0

.

read onlydrag:FlxPoint

This isn't drag exactly, more like deceleration that is only applied when acceleration is not affecting the sprite.

elasticity:Float = 0

The bounciness of this object. Only affects collisions. Default value is 0, or "not bouncy at all."

health:Float = 1

Handy for storing health percentage or armor points or whatever.

height:Float

The height of this object's hitbox. For sprites, use offset to control the hitbox position.

ignoreDrawDebug:Bool = false

Setting this to true will prevent the object from appearing when FlxG.debugger.drawDebug is true.

immovable:Bool = false

Whether an object will move/alter position after a collision.

read onlylast:FlxPoint

Important variable for collision processing. By default this value is set automatically during at the start of update().

mass:Float = 1

The virtual mass of the object. Default value is 1. Currently only used with elasticity during collision resolution. Change at your own risk; effects seem crazy unpredictable so far!

maxAngular:Float = 10000

Use in conjunction with angularAcceleration for fluid spin speed control.

read onlymaxVelocity:FlxPoint

If you are using acceleration, you can use maxVelocity with it to cap the speed automatically (very useful!).

moves:Bool = true

Set this to false if you want to skip the automatic motion/movement stuff (see updateMotion()). FlxObject and FlxSprite default to true. FlxText, FlxTileblock and FlxTilemap default to false.

path:FlxPath = null

The path this object follows. Not initialized by default. Assign a new FlxPath() object and start() it if you want to this object to follow a path. Set path to null again to stop following the path. See flixel.util.FlxPath for more info and usage examples.

pixelPerfectPosition:Bool = true

Whether or not the position of this object should be rounded before any draw() or collision checking.

pixelPerfectRender:Null<Bool>

Whether or not the coordinates should be rounded during rendering. Does not affect copyPixels(), which can only render on whole pixels. Defaults to the camera's global pixelPerfectRender value, but overrides that value if not equal to null.

read onlyscrollFactor:FlxPoint

Controls how much this object is affected by camera scrolling. 0 = no movement (e.g. a background layer), 1 = same movement speed as the foreground. Default value is (1,1), except for UI elements like FlxButton where it's (0,0).

solid:Bool

Whether the object collides or not. For more control over what directions the object will collide from, use collision constants (like LEFT, FLOOR, etc) to set the value of allowCollisions directly.

touching:Int = NONE

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts. Use bitwise operators to check the values stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy!

read onlyvelocity:FlxPoint

The basic speed of this object (in pixels per second).

wasTouching:Int = NONE

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts from the previous game loop step. Use bitwise operators to check the values stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy!

width:Float

The width of this object's hitbox. For sprites, use offset to control the hitbox position.

x:Float = 0

X position of the upper left corner of this object in world space.

y:Float = 0

Y position of the upper left corner of this object in world space.

Defined by FlxBasic

ID:Int = -1

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

active:Bool = true

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

alive:Bool = true

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

camera:FlxCamera

Gets ot sets the first camera of this object.

cameras:Array<FlxCamera>

This determines on which FlxCameras this object will be drawn. If it is null / has not been set, it uses FlxCamera.defaultCameras, which is a reference to FlxG.cameras.list (all cameras) by default.

exists:Bool = true

Controls whether update() and draw() are automatically called by FlxState/FlxGroup.

visible:Bool = true

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

Inherited Methods

Defined by FlxSprite

centerOffsets(AdjustPosition:Bool = false):Void

Helper function that adjusts the offset automatically to center the bounding box within the graphic.

Parameters:

AdjustPosition

Adjusts the actual X and Y position just once to match the offset change.

inlinecenterOrigin():Void

Sets the sprite's origin to its center - useful after adjusting scale to make sure rotations work as expected.

drawFrame(Force:Bool = false):Void

Request (or force) that the sprite update the frame before rendering. Useful if you are doing procedural generation or other weirdness!

Parameters:

Force

Force the frame to redraw, even if its not flagged as necessary.

getGraphicMidpoint(?point:FlxPoint):FlxPoint

Retrieve the midpoint of this sprite's graphic in world coordinates.

Parameters:

point

Allows you to pass in an existing FlxPoint if you're so inclined. Otherwise a new one is created.

Returns:

A FlxPoint containing the midpoint of this sprite's graphic in world coordinates.

graphicLoaded():Void

Called whenever a new graphic is loaded for this sprite (after loadGraphic(), makeGraphic() etc).

isOnScreen(?Camera:FlxCamera):Bool

Check and see if this object is currently on screen. Differs from FlxObject's implementation in that it takes the actual graphic into account, not just the hitbox or bounding box or whatever.

Parameters:

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

Whether the object is on screen or not.

isSimpleRender(?camera:FlxCamera):Bool

Returns the result of isSimpleRenderBlit() if FlxG.renderBlit is true, or false if FlxG.renderTile is true.

isSimpleRenderBlit(?camera:FlxCamera):Bool

Determines the function used for rendering in blitting: copyPixels() for simple sprites, draw() for complex ones. Sprites are considered simple when they have an angle of 0, a scale of 1, don't use blend and pixelPerfectRender is true.

Parameters:

camera

If a camera is passed its pixelPerfectRender flag is taken into account

loadGraphic(Graphic:FlxGraphicAsset, Animated:Bool = false, Width:Int = 0, Height:Int = 0, Unique:Bool = false, ?Key:String):FlxSprite

Load an image from an embedded graphic file.

HaxeFlixel's graphic caching system keeps track of loaded image data. When you load an identical copy of a previously used image, by default HaxeFlixel copies the previous reference onto the pixels field instead of creating another copy of the image data, to save memory.

Parameters:

Graphic

The image you want to use.

Animated

Whether the Graphic parameter is a single sprite or a row / grid of sprites.

Width

Specify the width of your sprite (helps figure out what to do with non-square sprites or sprite sheets).

Height

Specify the height of your sprite (helps figure out what to do with non-square sprites or sprite sheets).

Unique

Whether the graphic should be a unique instance in the graphics cache. Set this to true if you want to modify the pixels field without changing the pixels of other sprites with the same BitmapData.

Key

Set this parameter if you're loading BitmapData.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

loadGraphicFromSprite(Sprite:FlxSprite):FlxSprite

Load graphic from another FlxSprite and copy its tile sheet data. This method can useful for non-flash targets.

Parameters:

Sprite

The FlxSprite from which you want to load graphic data.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

loadRotatedFrame(Frame:FlxFrame, Rotations:Int = 16, AntiAliasing:Bool = false, AutoBuffer:Bool = false):FlxSprite

Helper method which allows using FlxFrame as graphic source for sprite's loadRotatedGraphic() method.

Parameters:

frame

Frame to load into this sprite.

rotations

The number of rotation frames the final sprite should have. For small sprites this can be quite a large number (360 even) without any problems.

antiAliasing

Whether to use high quality rotations when creating the graphic. Default is false.

autoBuffer

Whether to automatically increase the image size to accommodate rotated corners. Will create frames that are 150% larger on each axis than the original frame or graphic.

Returns:

this FlxSprite with loaded rotated graphic in it.

loadRotatedGraphic(Graphic:FlxGraphicAsset, Rotations:Int = 16, Frame:Int = -1, AntiAliasing:Bool = false, AutoBuffer:Bool = false, ?Key:String):FlxSprite

Create a pre-rotated sprite sheet from a simple sprite. This can make a huge difference in graphical performance!

Parameters:

Graphic

The image you want to rotate and stamp.

Rotations

The number of rotation frames the final sprite should have. For small sprites this can be quite a large number (360 even) without any problems.

Frame

If the Graphic has a single row of square animation frames on it, you can specify which of the frames you want to use here. Default is -1, or "use whole graphic."

AntiAliasing

Whether to use high quality rotations when creating the graphic. Default is false.

AutoBuffer

Whether to automatically increase the image size to accommodate rotated corners. Will create frames that are 150% larger on each axis than the original frame or graphic.

Key

Optional, set this parameter if you're loading BitmapData.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

makeGraphic(Width:Int, Height:Int, Color:FlxColor = FlxColor.WHITE, Unique:Bool = false, ?Key:String):FlxSprite

This function creates a flat colored rectangular image dynamically.

HaxeFlixel's graphic caching system keeps track of loaded image data. When you make an identical copy of a previously used image, by default HaxeFlixel copies the previous reference onto the pixels field instead of creating another copy of the image data, to save memory.

Parameters:

Width

The width of the sprite you want to generate.

Height

The height of the sprite you want to generate.

Color

Specifies the color of the generated block (ARGB format).

Unique

Whether the graphic should be a unique instance in the graphics cache. Default is false. Set this to true if you want to modify the pixels field without changing the pixels of other sprites with the same BitmapData.

Key

An optional String key to identify this graphic in the cache. If null, the key is determined by Width, Height and Color. If Unique is true and a graphic with this Key already exists, it is used as a prefix to find a new unique name like "Key3".

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

pixelsOverlapPoint(point:FlxPoint, Mask:Int = 0xFF, ?Camera:FlxCamera):Bool

Checks to see if a point in 2D world space overlaps this FlxSprite object's current displayed pixels. This check is ALWAYS made in screen space, and always takes scrollFactor into account.

Parameters:

Point

The point in world space you want to check.

Mask

Used in the pixel hit test to determine what counts as solid.

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

Whether or not the point overlaps this object.

replaceColor(Color:FlxColor, NewColor:FlxColor, FetchPositions:Bool = false):Array<FlxPoint>

Replaces all pixels with specified Color with NewColor pixels. WARNING: very expensive (especially on big graphics) as it iterates over every single pixel.

Parameters:

Color

Color to replace

NewColor

New color

FetchPositions

Whether we need to store positions of pixels which colors were replaced.

Returns:

Array with replaced pixels positions

inlineresetFrame():Void

Helper method just for convenience, so you don't need to type sprite.frame = sprite.frame; You may need this method in tile render mode, when you want sprite to use its original graphic, not the graphic generated from its framePixels.

inlineresetFrameSize():Void

Resets frame size to frame dimensions.

inlineresetSize():Void

Resets some internal variables used for frame BitmapData calculation.

inlineresetSizeFromFrame():Void

Resets sprite's size back to frame size.

setColorTransform(redMultiplier:Float = 1.0, greenMultiplier:Float = 1.0, blueMultiplier:Float = 1.0, alphaMultiplier:Float = 1.0, redOffset:Int = 0, greenOffset:Int = 0, blueOffset:Int = 0, alphaOffset:Int = 0):Void

Sets the sprite's color transformation with control over color offsets. With FlxG.renderTile, offsets are only supported on OpenFL Next version 3.6.0 or higher.

Parameters:

redMultiplier

The value for the red multiplier, in the range from 0 to 1.

greenMultiplier

The value for the green multiplier, in the range from 0 to 1.

blueMultiplier

The value for the blue multiplier, in the range from 0 to 1.

alphaMultiplier

The value for the alpha transparency multiplier, in the range from 0 to 1.

redOffset

The offset value for the red color channel, in the range from -255 to 255.

greenOffset

The offset value for the green color channel, in the range from -255 to 255.

blueOffset

The offset for the blue color channel value, in the range from -255 to 255.

alphaOffset

The offset for alpha transparency channel value, in the range from -255 to 255.

inlinesetFacingFlip(Direction:Int, FlipX:Bool, FlipY:Bool):Void

Set how a sprite flips when facing in a particular direction.

Parameters:

Direction

Use constants from FlxObject: LEFT, RIGHT, UP, and DOWN. These may be combined with the bitwise OR operator. E.g. To make a sprite flip horizontally when it is facing both UP and LEFT, use setFacingFlip(FlxObject.LEFT | FlxObject.UP, true, false);

FlipX

Whether to flip the sprite on the X axis.

FlipY

Whether to flip the sprite on the Y axis.

setFrames(Frames:FlxFramesCollection, saveAnimations:Bool = true):FlxSprite

Sets frames and allows you to save animations in sprite's animation controller

Parameters:

Frames

Frames collection to set for this sprite.

saveAnimations

Whether to save animations in animation controller or not.

Returns:

This sprite with loaded frames

setGraphicSize(Width:Int = 0, Height:Int = 0):Void

Helper function to set the graphic's dimensions by using scale, allowing you to keep the current aspect ratio should one of the Integers be <= 0. It might make sense to call updateHitbox() afterwards!

Parameters:

Width

How wide the graphic should be. If <= 0, and Height is set, the aspect ratio will be kept.

Height

How high the graphic should be. If <= 0, and Width is set, the aspect ratio will be kept.

stamp(Brush:FlxSprite, X:Int = 0, Y:Int = 0):Void

Stamps / draws another FlxSprite onto this FlxSprite. This function is NOT intended to replace draw()!

Parameters:

Brush

The sprite you want to use as a brush or stamp or pen or whatever.

X

The X coordinate of the brush's top left corner on this sprite.

Y

They Y coordinate of the brush's top left corner on this sprite.

updateFramePixels():BitmapData

Retrieves the BitmapData of the current FlxFrame. Updates framePixels.

updateHitbox():Void

Updates the sprite's hitbox (width, height, offset) according to the current scale. Also calls centerOrigin().

Defined by FlxObject

drawDebugOnCamera(camera:FlxCamera):Void

Override this function to draw custom "debug mode" graphics to the specified camera while the debugger's drawDebug mode is toggled on.

Parameters:

Camera

Which camera to draw the debug visuals to.

getMidpoint(?point:FlxPoint):FlxPoint

Retrieve the midpoint of this object in world coordinates.

Parameters:

point

Allows you to pass in an existing FlxPoint object if you're so inclined. Otherwise a new one is created.

Returns:

A FlxPoint object containing the midpoint of this object in world coordinates.

getScreenPosition(?point:FlxPoint, ?Camera:FlxCamera):FlxPoint

Call this function to figure out the on-screen position of the object.

Parameters:

Point

Takes a FlxPoint object and assigns the post-scrolled X and Y values of this object to it.

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

The Point you passed in, or a new Point if you didn't pass one, containing the screen X and Y position of this object.

hurt(Damage:Float):Void

Reduces the health variable of this object by the amount specified in Damage. Calls kill() if health drops to or below zero.

Parameters:

Damage

How much health to take away (use a negative number to give a health bonus).

inlineinWorldBounds():Bool

Check and see if this object is currently within the world bounds - useful for killing objects that get too far away.

Returns:

Whether the object is within the world bounds or not.

isPixelPerfectRender(?Camera:FlxCamera):Bool

Check if object is rendered pixel perfect on a specific camera.

inlineisTouching(Direction:Int):Bool

Handy function for checking if this object is touching a particular surface. Be sure to check it before calling super.update(), as that will reset the flags.

Parameters:

Direction

Any of the collision flags (e.g. LEFT, FLOOR, etc).

Returns:

Whether the object is touching an object in (any of) the specified direction(s) this frame.

inlinejustTouched(Direction:Int):Bool

Handy function for checking if this object is just landed on a particular surface. Be sure to check it before calling super.update(), as that will reset the flags.

Parameters:

Direction

Any of the collision flags (e.g. LEFT, FLOOR, etc).

Returns:

Whether the object just landed on (any of) the specified surface(s) this frame.

overlaps(ObjectOrGroup:FlxBasic, InScreenSpace:Bool = false, ?Camera:FlxCamera):Bool

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.overlap(). WARNING: Currently tilemaps do NOT support screen space overlap checks!

Parameters:

ObjectOrGroup

The object or group being tested.

InScreenSpace

Whether to take scroll factors into account when checking for overlap. Default is false, or "only compare in world space."

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

Whether or not the two objects overlap.

overlapsAt(X:Float, Y:Float, ObjectOrGroup:FlxBasic, InScreenSpace:Bool = false, ?Camera:FlxCamera):Bool

Checks to see if this FlxObject were located at the given position, would it overlap the FlxObject or FlxGroup? This is distinct from overlapsPoint(), which just checks that point, rather than taking the object's size into account. WARNING: Currently tilemaps do NOT support screen space overlap checks!

Parameters:

X

The X position you want to check. Pretends this object (the caller, not the parameter) is located here.

Y

The Y position you want to check. Pretends this object (the caller, not the parameter) is located here.

ObjectOrGroup

The object or group being tested.

InScreenSpace

Whether to take scroll factors into account when checking for overlap. Default is false, or "only compare in world space."

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

Whether or not the two objects overlap.

overlapsPoint(point:FlxPoint, InScreenSpace:Bool = false, ?Camera:FlxCamera):Bool

Checks to see if a point in 2D world space overlaps this FlxObject.

Parameters:

Point

The point in world space you want to check.

InScreenSpace

Whether to take scroll factors into account when checking for overlap.

Camera

Specify which game camera you want. If null, it will just grab the first global camera.

Returns:

Whether or not the point overlaps this object.

reset(X:Float, Y:Float):Void

Handy function for reviving game objects. Resets their existence flags and position.

Parameters:

X

The new X position of this object.

Y

The new Y position of this object.

screenCenter(?axes:FlxAxes):FlxObject

Centers this FlxObject on the screen, either by the x axis, y axis, or both.

Parameters:

axes

On what axes to center the object - default is FlxAxes.XY / both.

Returns:

This FlxObject for chaining

setPosition(X:Float = 0, Y:Float = 0):Void

Helper function to set the coordinates of this object. Handy since it only requires one line of code.

Parameters:

X

The new x position

Y

The new y position

setSize(Width:Float, Height:Float):Void

Shortcut for setting both width and Height.

Parameters:

Width

The new hitbox width.

Height

The new hitbox height.

toString():String

Convert object to readable string name. Useful for debugging, save games, etc.

Defined by FlxBasic

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.

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