new State()
This is a base State class which can be extended if you are creating your own game. It provides quick access to common functions such as the camera, cache, input, match, sound and more.
- Source:
Members
-
add
-
- Default Value:
- null
- Source:
Properties:
Name Type Description addPhaser.GameObjectFactory Reference to the GameObjectFactory.
-
cache
-
- Default Value:
- null
- Source:
Properties:
Name Type Description cachePhaser.Cache Reference to the assets cache.
-
camera
-
- Default Value:
- null
- Source:
Properties:
Name Type Description cameraPhaser.Camera A handy reference to world.camera.
-
game
-
- Source:
Properties:
Name Type Description gamePhaser.Game A reference to the currently running Game.
-
input
-
- Default Value:
- null
- Source:
Properties:
Name Type Description inputPhaser.Input Reference to the input manager
-
load
-
- Default Value:
- null
- Source:
Properties:
Name Type Description loadPhaser.Loader Reference to the assets loader.
-
math
-
- Default Value:
- null
- Source:
Properties:
Name Type Description mathPhaser.Math Reference to the math helper.
-
particles
-
- Default Value:
- null
- Source:
Properties:
Name Type Description particlesPhaser.Particles The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it.
-
physics
-
- Default Value:
- null
- Source:
Properties:
Name Type Description physicsPhaser.Physics.PhysicsManager Reference to the physics manager.
-
sound
-
- Default Value:
- null
- Source:
Properties:
Name Type Description soundPhaser.SoundManager Reference to the sound manager.
-
stage
-
- Default Value:
- null
- Source:
Properties:
Name Type Description stagePhaser.Stage Reference to the stage.
-
time
-
- Default Value:
- null
- Source:
Properties:
Name Type Description timePhaser.TimeManager Reference to game clock.
-
tweens
-
- Default Value:
- null
- Source:
Properties:
Name Type Description tweensPhaser.TweenManager Reference to the tween manager.
-
world
-
- Default Value:
- null
- Source:
Properties:
Name Type Description worldPhaser.World Reference to the world.
Methods
-
create()
-
This method is called after the game engine successfully switches states. Feel free to add any setup code here (do not load anything here, override preload() instead).
- Source:
-
destroy()
-
This method will be called when the state is destroyed.
- Source:
-
loadRender()
-
Put render operations here.
- Source:
-
loadUpdate()
-
Put update logic here.
- Source:
-
paused()
-
This method will be called when game paused.
- Source:
-
preload()
-
Override this method to add some load operations. If you need to use the loader, you may need to use them here.
- Source:
-
render()
-
Put render operations here.
- Source:
-
update()
-
Put update logic here.
- Source: