Package | org.flixel |
Class | public class FlxState |
Inheritance | FlxState ![]() ![]() ![]() |
Method | Defined By | ||
---|---|---|---|
![]() |
Adds a new FlxBasic subclass (FlxBasic, FlxSprite, MyEnemy, etc) to the group. | FlxGroup | |
![]() | clear():void
Remove all instances of FlxBasic subclass (FlxSprite, FlxBlock, etc) from the list. | FlxGroup | |
collide(ObjectOrGroup1:FlxBasic = null, ObjectOrGroup2:FlxBasic = null, NotifyCallback:Function = null):Boolean
Call this function to see if one FlxObject collides with another. | FlxState | ||
![]() | countDead():int
Call this function to find out how many members of the group are dead. | FlxGroup | |
![]() | countLiving():int
Call this function to find out how many members of the group are not dead. | FlxGroup | |
create():void
This function is called after the game engine successfully switches states. | FlxState | ||
![]() | destroy():void [override]
Override this function to handle any deleting or "shutdown" type operations you might need,
such as removing traditional Flash children like Sprite objects. | FlxGroup | |
![]() | draw():void [override]
Automatically goes through and calls render on everything you added,
override this loop to control render order manually. | FlxGroup | |
![]() |
Call this function to retrieve the first object with dead == false in the group. | FlxGroup | |
![]() | getFirstAvail(ObjectClass:Class = null):FlxBasic
Call this function to retrieve the first object with exists == false in the group. | FlxGroup | |
![]() |
Call this function to retrieve the first object with dead == true in the group. | FlxGroup | |
![]() |
Call this function to retrieve the first object with exists == true in the group. | FlxGroup | |
![]() | getFirstNull():int
Call this function to retrieve the first index set to 'null'. | FlxGroup | |
![]() |
Returns a member at random from the group. | FlxGroup | |
![]() | kill():void [override]
Calls kill on the group and all its members. | FlxGroup | |
![]() | FlxBasic | ||
overlap(ObjectOrGroup1:FlxBasic = null, ObjectOrGroup2:FlxBasic = null, NotifyCallback:Function = null, ProcessCallback:Function = null):Boolean
Call this function to see if one FlxObject overlaps another. | FlxState | ||
![]() | postUpdate():void | FlxBasic | |
![]() | preUpdate():void [override] | FlxGroup | |
![]() |
Recycling is designed to help you reuse game objects without always re-allocating or "newing" them. | FlxGroup | |
![]() |
Removes an object from the group. | FlxGroup | |
![]() |
Replaces an existing FlxBasic with a new one. | FlxGroup | |
![]() | revive():void | FlxBasic | |
![]() | setAll(VariableName:String, Value:Object, Recurse:Boolean = true):void | FlxGroup | |
![]() | sort(Index:String = y, Order:int):void
Call this function to sort the group according to a particular value and order. | FlxGroup | |
![]() | toString():String
Convert object to readable string name. | FlxBasic | |
![]() | update():void [override]
Automatically goes through and calls update on everything you added,
override this function to handle custom input and perform collisions. | FlxGroup |
collide | () | method |
public function collide(ObjectOrGroup1:FlxBasic = null, ObjectOrGroup2:FlxBasic = null, NotifyCallback:Function = null):Boolean
Call this function to see if one FlxObject
collides with another.
Can be called with one object and one group, or two groups, or two objects,
whatever floats your boat! It will put everything into a quad tree and then
check for collisions. For maximum performance try bundling a lot of objects
together using a FlxGroup
(even bundling groups together!)
NOTE: does NOT take objects' scrollfactor into account.
Parameters
ObjectOrGroup1:FlxBasic (default = null ) — The first object or group you want to check.
| |
ObjectOrGroup2:FlxBasic (default = null ) — The second object or group you want to check. If it is the same as the first, flixel knows to just do a comparison within that group.
| |
NotifyCallback:Function (default = null ) — A function with two FlxObject parameters - e.g. myOverlapFunction(Object1:FlxObject,Object2:FlxObject) - that is called if those two objects overlap.
|
Boolean |
create | () | method |
public function create():void
This function is called after the game engine successfully switches states. Override this function to initialize or set up your game state. Do NOT override the constructor, unless you want some crazy unpredictable things to happen!
overlap | () | method |
public function overlap(ObjectOrGroup1:FlxBasic = null, ObjectOrGroup2:FlxBasic = null, NotifyCallback:Function = null, ProcessCallback:Function = null):Boolean
Call this function to see if one FlxObject
overlaps another.
Can be called with one object and one group, or two groups, or two objects,
whatever floats your boat! It will put everything into a quad tree and then
check for overlaps. For maximum performance try bundling a lot of objects
together using a FlxGroup
(even bundling groups together!)
NOTE: does NOT take objects' scrollfactor into account.
Parameters
ObjectOrGroup1:FlxBasic (default = null ) — The first object or group you want to check.
| |
ObjectOrGroup2:FlxBasic (default = null ) — The second object or group you want to check. If it is the same as the first, flixel knows to just do a comparison within that group.
| |
NotifyCallback:Function (default = null ) — A function with two FlxObject parameters - e.g. myOverlapFunction(Object1:FlxObject,Object2:FlxObject) - that is called if those two objects overlap.
| |
ProcessCallback:Function (default = null ) — A function with two FlxObject parameters - e.g. myOverlapFunction(Object1:FlxObject,Object2:FlxObject) - that is called if those two objects overlap. If a ProcessCallback is provided, then NotifyCallback will only be called if ProcessCallback returns true for those objects!
|
Boolean |