Packagestencyl.api.engine
Classpublic class GameState
InheritanceGameState Inheritance FlxState Inheritance flash.display.Sprite



Public Properties
 PropertyDefined By
  actors : Array
GameState
  actorsOfType : Array
GameState
  actorsOnScreen : Array
GameState
  actorsToCreateInNextScene : Array
GameState
  actorsToRender : Array
GameState
  allActors : Array
GameState
  behaviors : BehaviorManager
GameState
 InheritedbgColor : uint
[static] This static variable indicates the "clear color" or default background color of the game.
FlxState
  bottom : int
GameState
  bottomLayer : int
GameState
  camera : Actor
GameState
  debug : Boolean = false
[static]
GameState
  debugDraw : Boolean = false
[static]
GameState
  debugDrawer : b2DebugDraw
[static]
GameState
 InheriteddefaultGroup : FlxGroup
Internal group used to organize and display objects you add to this state.
FlxState
  dynamicTiles : Dictionary
GameState
  enterTimer : Number = 0
GameState
  g : Graphics
GameState
  gameAttributes : Array
GameState
  gameID : int
[static]
GameState
  gameName : String
[static]
GameState
  groups : Array
GameState
  hudActors : HashSet
GameState
  initSceneID : int = -1
[static]
GameState
  isLocalGame : Boolean
GameState
  ITERATIONS : int = 3
[static]
GameState
  joints : Array
GameState
  layerOrders : Array
GameState
  layers : Array
GameState
  layersToDraw : Array
GameState
  leaveTimer : Number = 0
GameState
  left : int
GameState
  middleLayer : int
GameState
  nextID : uint
GameState
  numLeft : int = 0
[static]
GameState
  parallax : ParallaxArea
GameState
  password : String = Offline
[static]
GameState
  physicsScale : Number = 10.0
[static]
GameState
  playfield : Area
GameState
  PSCALE : Number = 1.0
[static]
GameState
  recycledActorsOfType : Array
GameState
  regions : Array
GameState
  right : int
GameState
  rootPanel : Panel
GameState
  rootPanelLayer : int = -1
GameState
  scene : Scene
GameState
 Inheritedscreen : FlxSprite
[static] This static variable holds the screen buffer, so you can draw to it directly if you want.
FlxState
  startCounter : int = 3000
GameState
  started : Boolean = false
GameState
  STEP_SIZE : Number
[static]
GameState
  STEP_SIZE_MS : Number
[static]
GameState
  terrainRegions : Array
GameState
  tileLayers : Array
GameState
  top : int
GameState
  topLayer : int
GameState
  username : String = Offline
[static]
GameState
  world : b2World
GameState
Public Methods
 MethodDefined By
 Inherited
Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop.
FlxState
  
GameState
  
GameState
  
GameState
  
GameState
  
addTask(task:TimedTask):void
GameState
  
GameState
  
begin():void
GameState
  
GameState
  
GameState
  
GameState
  
GameState
  
cacheActors():Array
GameState
  
cameraFollow(actor:Actor, lockX:Boolean = true, lockY:Boolean = true):void
GameState
  
cleanup():void
GameState
 Inherited
collide():void
This function collides defaultGroup against defaultGroup (basically everything you added to this state).
FlxState
  
create():void
[override]
GameState
  
createActor(ai:ActorInstance, offset:Boolean = false):Actor
GameState
  
createActorInNextScene(type:ActorType, x:int, y:int, layer:int):void
GameState
  
createActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor
GameState
  
createBoxRegion(x:Number, y:Number, w:Number, h:Number):Region
GameState
  
createBoxTerrainRegion(x:Number, y:Number, w:Number, h:Number, groupID:int = 1):TerrainRegion
GameState
  
createCircularRegion(x:Number, y:Number, r:Number):Region
GameState
  
createCircularTerrainRegion(x:Number, y:Number, r:Number, groupID:int = 1):TerrainRegion
GameState
  
createCustomStickJoint(one:b2Body, x1:Number, y1:Number, two:b2Body, x2:Number, y2:Number):b2DistanceJoint
GameState
  
createDynamicTile(shape:b2Shape, x:Number, y:Number, layerID:Number, width:Number, height:Number):void
GameState
  
createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, torque:Number = 0, speed:Number = 0):b2RevoluteJoint
GameState
  
createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, force:Number = 0, speed:Number = 0):b2LineJoint
GameState
  
createStickJoint(one:b2Body, two:b2Body, jointID:int = -1, collide:Boolean = false, damping:Number = 0, frequencyHz:Number = 0):b2DistanceJoint
GameState
 Inherited
destroy():void
Override this function to handle any deleting or "shutdown" type operations you might need (such as removing traditional Flash children like Sprite objects).
FlxState
  
GameState
  
GameState
  
GameState
  
enterScene():void
GameState
  
getActor(ID:Number):Actor
GameState
  
GameState
  
GameState
  
getGameAttribute(name:String):*
GameState
  
getGroup(ID:Number, a:Actor = null):FlxGroup
GameState
  
getIDFromLayerOrder(layerOrder:int):int
GameState
  
GameState
  
GameState
  
getOrderForLayerID(layerID:int):int
GameState
  
GameState
  
GameState
  
getRecycledActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor
GameState
  
GameState
  
GameState
  
getRegions(ID:int):Array
GameState
  
GameState
  
getTerrainRegions(ID:int):Array
GameState
  
GameState
  
getValue(behaviorName:String, attributeName:String):Object
GameState
  
initBehaviors(manager:BehaviorManager, behaviorValues:Array, parent:Object, game:GameState, initialize:Boolean):void
[static]
GameState
  
GameState
  
GameState
  
isInRegion(a:Actor, r:Region):Boolean
GameState
  
isTransitioning():Boolean
GameState
  
leaveScene():void
GameState
  
loadActors():void
GameState
  
loadCamera():void
GameState
  
loadScene(sceneID:Number):void
GameState
  
GameState
  
moveToLayerOrder(a:Actor, layerOrder:int):void
GameState
  
GameState
  
GameState
  
GameState
 Inherited
Override this function to do special pre-processing FX like light bloom.
FlxState
 Inherited
preProcess():void
Override this function to do special pre-processing FX like motion blur.
FlxState
  
GameState
  
GameState
  
GameState
  
removeRegion(ID:int):void
GameState
  
removeTerrainRegion(ID:int):void
GameState
  
render():void
[override]
GameState
  
say(behaviorName:String, msg:String, args:Array):Object
GameState
  
GameState
  
GameState
  
GameState
  
GameState
  
setGameAttribute(name:String, value:*):void
GameState
  
setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void
GameState
  
setValue(behaviorName:String, attributeName:String, value:Object):void
GameState
  
shout(msg:String, args:Array):Object
GameState
  
switchScene(sceneID:Number, leave:Transition = null, enter:Transition = null):void
GameState
  
toPhysicalUnits(value:Number):Number
[static]
GameState
  
toPixelUnits(value:Number):Number
[static]
GameState
  
update():void
[override]
GameState
  
[static]
GameState
  
[static]
GameState
Public Constants
 ConstantDefined By
  MAX_ELAPSED : Number = 0.1
[static]
GameState
Property Detail
actorsproperty
public var actors:Array

actorsOfTypeproperty 
public var actorsOfType:Array

actorsOnScreenproperty 
public var actorsOnScreen:Array

actorsToCreateInNextSceneproperty 
public var actorsToCreateInNextScene:Array

actorsToRenderproperty 
public var actorsToRender:Array

allActorsproperty 
public var allActors:Array

behaviorsproperty 
public var behaviors:BehaviorManager

bottomproperty 
public var bottom:int

bottomLayerproperty 
public var bottomLayer:int

cameraproperty 
public var camera:Actor

debugproperty 
public static var debug:Boolean = false

debugDrawproperty 
public static var debugDraw:Boolean = false

debugDrawerproperty 
public static var debugDrawer:b2DebugDraw

dynamicTilesproperty 
public var dynamicTiles:Dictionary

enterTimerproperty 
public var enterTimer:Number = 0

gproperty 
public var g:Graphics

gameAttributesproperty 
public var gameAttributes:Array

gameIDproperty 
public static var gameID:int

gameNameproperty 
public static var gameName:String

groupsproperty 
public var groups:Array

hudActorsproperty 
public var hudActors:HashSet

initSceneIDproperty 
public static var initSceneID:int = -1

isLocalGameproperty 
public var isLocalGame:Boolean

ITERATIONSproperty 
public static var ITERATIONS:int = 3

jointsproperty 
public var joints:Array

layerOrdersproperty 
public var layerOrders:Array

layersproperty 
public var layers:Array

layersToDrawproperty 
public var layersToDraw:Array

leaveTimerproperty 
public var leaveTimer:Number = 0

leftproperty 
public var left:int

middleLayerproperty 
public var middleLayer:int

nextIDproperty 
public var nextID:uint

numLeftproperty 
public static var numLeft:int = 0

parallaxproperty 
public var parallax:ParallaxArea

passwordproperty 
public static var password:String = Offline

physicsScaleproperty 
public static var physicsScale:Number = 10.0

playfieldproperty 
public var playfield:Area

PSCALEproperty 
public static var PSCALE:Number = 1.0

recycledActorsOfTypeproperty 
public var recycledActorsOfType:Array

regionsproperty 
public var regions:Array

rightproperty 
public var right:int

rootPanelproperty 
public var rootPanel:Panel

rootPanelLayerproperty 
public var rootPanelLayer:int = -1

sceneproperty 
public var scene:Scene

startCounterproperty 
public var startCounter:int = 3000

startedproperty 
public var started:Boolean = false

STEP_SIZEproperty 
public static var STEP_SIZE:Number

STEP_SIZE_MSproperty 
public static var STEP_SIZE_MS:Number

terrainRegionsproperty 
public var terrainRegions:Array

tileLayersproperty 
public var tileLayers:Array

topproperty 
public var top:int

topLayerproperty 
public var topLayer:int

usernameproperty 
public static var username:String = Offline

worldproperty 
public var world:b2World

Method Detail
addAlwaysOnActor()method
public function addAlwaysOnActor(a:Actor):void

Parameters

a:Actor

addHUDActor()method 
public function addHUDActor(a:Actor):void

Parameters

a:Actor

addJoint()method 
public function addJoint(j:b2Joint):void

Parameters

j:b2Joint

addRegion()method 
public function addRegion(r:Region):void

Parameters

r:Region

addTask()method 
public function addTask(task:TimedTask):void

Parameters

task:TimedTask

addTerrainRegion()method 
public function addTerrainRegion(r:TerrainRegion):void

Parameters

r:TerrainRegion

begin()method 
public function begin():void

bringForward()method 
public function bringForward(a:Actor):void

Parameters

a:Actor

bringRootPanelForward()method 
public function bringRootPanelForward():void

bringRootPanelToFront()method 
public function bringRootPanelToFront():void

bringToFront()method 
public function bringToFront(a:Actor):void

Parameters

a:Actor

cacheActors()method 
public function cacheActors():Array

Returns
Array
cameraFollow()method 
public function cameraFollow(actor:Actor, lockX:Boolean = true, lockY:Boolean = true):void

Parameters

actor:Actor
 
lockX:Boolean (default = true)
 
lockY:Boolean (default = true)

cleanup()method 
public function cleanup():void

create()method 
override public function create():void

createActor()method 
public function createActor(ai:ActorInstance, offset:Boolean = false):Actor

Parameters

ai:ActorInstance
 
offset:Boolean (default = false)

Returns
Actor
createActorInNextScene()method 
public function createActorInNextScene(type:ActorType, x:int, y:int, layer:int):void

Parameters

type:ActorType
 
x:int
 
y:int
 
layer:int

createActorOfType()method 
public function createActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor

Parameters

type:ActorType
 
x:Number
 
y:Number
 
layerConst:int

Returns
Actor
createBoxRegion()method 
public function createBoxRegion(x:Number, y:Number, w:Number, h:Number):Region

Parameters

x:Number
 
y:Number
 
w:Number
 
h:Number

Returns
Region
createBoxTerrainRegion()method 
public function createBoxTerrainRegion(x:Number, y:Number, w:Number, h:Number, groupID:int = 1):TerrainRegion

Parameters

x:Number
 
y:Number
 
w:Number
 
h:Number
 
groupID:int (default = 1)

Returns
TerrainRegion
createCircularRegion()method 
public function createCircularRegion(x:Number, y:Number, r:Number):Region

Parameters

x:Number
 
y:Number
 
r:Number

Returns
Region
createCircularTerrainRegion()method 
public function createCircularTerrainRegion(x:Number, y:Number, r:Number, groupID:int = 1):TerrainRegion

Parameters

x:Number
 
y:Number
 
r:Number
 
groupID:int (default = 1)

Returns
TerrainRegion
createCustomStickJoint()method 
public function createCustomStickJoint(one:b2Body, x1:Number, y1:Number, two:b2Body, x2:Number, y2:Number):b2DistanceJoint

Parameters

one:b2Body
 
x1:Number
 
y1:Number
 
two:b2Body
 
x2:Number
 
y2:Number

Returns
b2DistanceJoint
createDynamicTile()method 
public function createDynamicTile(shape:b2Shape, x:Number, y:Number, layerID:Number, width:Number, height:Number):void

Parameters

shape:b2Shape
 
x:Number
 
y:Number
 
layerID:Number
 
width:Number
 
height:Number

createHingeJoint()method 
public function createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, torque:Number = 0, speed:Number = 0):b2RevoluteJoint

Parameters

one:b2Body
 
two:b2Body (default = null)
 
pt:V2 (default = null)
 
jointID:int (default = -1)
 
collide:Boolean (default = false)
 
limit:Boolean (default = false)
 
motor:Boolean (default = false)
 
lower:Number (default = 0)
 
upper:Number (default = 0)
 
torque:Number (default = 0)
 
speed:Number (default = 0)

Returns
b2RevoluteJoint
createSlidingJoint()method 
public function createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, force:Number = 0, speed:Number = 0):b2LineJoint

Parameters

one:b2Body
 
two:b2Body (default = null)
 
dir:V2 (default = null)
 
jointID:int (default = -1)
 
collide:Boolean (default = false)
 
limit:Boolean (default = false)
 
motor:Boolean (default = false)
 
lower:Number (default = 0)
 
upper:Number (default = 0)
 
force:Number (default = 0)
 
speed:Number (default = 0)

Returns
b2LineJoint
createStickJoint()method 
public function createStickJoint(one:b2Body, two:b2Body, jointID:int = -1, collide:Boolean = false, damping:Number = 0, frequencyHz:Number = 0):b2DistanceJoint

Parameters

one:b2Body
 
two:b2Body
 
jointID:int (default = -1)
 
collide:Boolean (default = false)
 
damping:Number (default = 0)
 
frequencyHz:Number (default = 0)

Returns
b2DistanceJoint
destroyJoint()method 
public function destroyJoint(j:b2Joint):void

Parameters

j:b2Joint

disableGlobalSleeping()method 
public function disableGlobalSleeping():void

enableGlobalSleeping()method 
public function enableGlobalSleeping():void

enterScene()method 
public function enterScene():void

getActor()method 
public function getActor(ID:Number):Actor

Parameters

ID:Number

Returns
Actor
getActorsOfType()method 
public function getActorsOfType(type:ActorType):HashSet

Parameters

type:ActorType

Returns
HashSet
getBottomLayer()method 
public function getBottomLayer():int

Returns
int
getGameAttribute()method 
public function getGameAttribute(name:String):*

Parameters

name:String

Returns
*
getGroup()method 
public function getGroup(ID:Number, a:Actor = null):FlxGroup

Parameters

ID:Number
 
a:Actor (default = null)

Returns
FlxGroup
getIDFromLayerOrder()method 
public function getIDFromLayerOrder(layerOrder:int):int

Parameters

layerOrder:int

Returns
int
getJoint()method 
public function getJoint(ID:int):b2Joint

Parameters

ID:int

Returns
b2Joint
getMiddleLayer()method 
public function getMiddleLayer():int

Returns
int
getOrderForLayerID()method 
public function getOrderForLayerID(layerID:int):int

Parameters

layerID:int

Returns
int
getPhysicalHeight()method 
public function getPhysicalHeight():Number

Returns
Number
getPhysicalWidth()method 
public function getPhysicalWidth():Number

Returns
Number
getRecycledActorOfType()method 
public function getRecycledActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor

Parameters

type:ActorType
 
x:Number
 
y:Number
 
layerConst:int

Returns
Actor
getRecycledActorsOfType()method 
public function getRecycledActorsOfType(type:ActorType):HashSet

Parameters

type:ActorType

Returns
HashSet
getRegion()method 
public function getRegion(ID:int):Region

Parameters

ID:int

Returns
Region
getRegions()method 
public function getRegions(ID:int):Array

Parameters

ID:int

Returns
Array
getTerrainRegion()method 
public function getTerrainRegion(ID:int):TerrainRegion

Parameters

ID:int

Returns
TerrainRegion
getTerrainRegions()method 
public function getTerrainRegions(ID:int):Array

Parameters

ID:int

Returns
Array
getTopLayer()method 
public function getTopLayer():int

Returns
int
getValue()method 
public function getValue(behaviorName:String, attributeName:String):Object

Parameters

behaviorName:String
 
attributeName:String

Returns
Object
initBehaviors()method 
public static function initBehaviors(manager:BehaviorManager, behaviorValues:Array, parent:Object, game:GameState, initialize:Boolean):void

Parameters

manager:BehaviorManager
 
behaviorValues:Array
 
parent:Object
 
game:GameState
 
initialize:Boolean

initPhysics()method 
public function initPhysics():void

innerUpdate()method 
public function innerUpdate():void

isInRegion()method 
public function isInRegion(a:Actor, r:Region):Boolean

Parameters

a:Actor
 
r:Region

Returns
Boolean
isTransitioning()method 
public function isTransitioning():Boolean

Returns
Boolean
leaveScene()method 
public function leaveScene():void

loadActors()method 
public function loadActors():void

loadCamera()method 
public function loadCamera():void

loadScene()method 
public function loadScene(sceneID:Number):void

Parameters

sceneID:Number

loadTerrain()method 
public function loadTerrain():void

moveToLayerOrder()method 
public function moveToLayerOrder(a:Actor, layerOrder:int):void

Parameters

a:Actor
 
layerOrder:int

nextJointID()method 
public function nextJointID():int

Returns
int
nextRegionID()method 
public function nextRegionID():int

Returns
int
nextTerrainRegionID()method 
public function nextTerrainRegionID():int

Returns
int
recycleActor()method 
public function recycleActor(a:Actor):void

Parameters

a:Actor

removeActor()method 
public function removeActor(a:Actor):void

Parameters

a:Actor

removeHUDActor()method 
public function removeHUDActor(a:Actor):void

Parameters

a:Actor

removeRegion()method 
public function removeRegion(ID:int):void

Parameters

ID:int

removeTerrainRegion()method 
public function removeTerrainRegion(ID:int):void

Parameters

ID:int

render()method 
override public function render():void

say()method 
public function say(behaviorName:String, msg:String, args:Array):Object

Parameters

behaviorName:String
 
msg:String
 
args:Array

Returns
Object
sendBackward()method 
public function sendBackward(a:Actor):void

Parameters

a:Actor

sendRootPanelBack()method 
public function sendRootPanelBack():void

sendRootPanelToBack()method 
public function sendRootPanelToBack():void

sendToBack()method 
public function sendToBack(a:Actor):void

Parameters

a:Actor

setGameAttribute()method 
public function setGameAttribute(name:String, value:*):void

Parameters

name:String
 
value:*

setOffscreenTolerance()method 
public function setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void

Parameters

top:int
 
left:int
 
bottom:int
 
right:int

setValue()method 
public function setValue(behaviorName:String, attributeName:String, value:Object):void

Parameters

behaviorName:String
 
attributeName:String
 
value:Object

shout()method 
public function shout(msg:String, args:Array):Object

Parameters

msg:String
 
args:Array

Returns
Object
switchScene()method 
public function switchScene(sceneID:Number, leave:Transition = null, enter:Transition = null):void

Parameters

sceneID:Number
 
leave:Transition (default = null)
 
enter:Transition (default = null)

toPhysicalUnits()method 
public static function toPhysicalUnits(value:Number):Number

Parameters

value:Number

Returns
Number
toPixelUnits()method 
public static function toPixelUnits(value:Number):Number

Parameters

value:Number

Returns
Number
update()method 
override public function update():void

vToPhysicalUnits()method 
public static function vToPhysicalUnits(v:V2):V2

Parameters

v:V2

Returns
V2
vToPixelUnits()method 
public static function vToPixelUnits(v:V2):V2

Parameters

v:V2

Returns
V2
Constant Detail
MAX_ELAPSEDConstant
public static const MAX_ELAPSED:Number = 0.1