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
-
- Source:
Properties:
Name Type Description add
Phaser.GameObjectFactory Reference to the GameObjectFactory.
-
cache
-
- Source:
Properties:
Name Type Description cache
Phaser.Cache Reference to the assets cache.
-
camera
-
- Source:
Properties:
Name Type Description camera
Phaser.Camera A handy reference to world.camera.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running Game.
-
input
-
- Source:
Properties:
Name Type Description input
Phaser.Input Reference to the input manager
-
load
-
- Source:
Properties:
Name Type Description load
Phaser.Loader Reference to the assets loader.
-
make
-
- Source:
Properties:
Name Type Description make
Phaser.GameObjectCreator Reference to the GameObjectCreator.
-
math
-
- Source:
Properties:
Name Type Description math
Phaser.Math Reference to the math helper.
-
particles
-
- Source:
Properties:
Name Type Description particles
Phaser.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
-
- Source:
Properties:
Name Type Description physics
Phaser.Physics Reference to the physics manager.
-
rnd
-
- Source:
Properties:
Name Type Description rnd
Phaser.RandomDataGenerator Reference to the random data generator.
-
scale
-
- Source:
Properties:
Name Type Description scale
Phaser.ScaleManager Reference to the game scale manager.
-
sound
-
- Source:
Properties:
Name Type Description sound
Phaser.SoundManager Reference to the sound manager.
-
stage
-
- Source:
Properties:
Name Type Description stage
Phaser.Stage Reference to the stage.
-
time
-
- Source:
Properties:
Name Type Description time
Phaser.Time Reference to the core game clock.
-
tweens
-
- Source:
Properties:
Name Type Description tweens
Phaser.TweenManager Reference to the tween manager.
-
world
-
- Source:
Properties:
Name Type Description world
Phaser.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:
-
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:
-
shutdown()
-
This method will be called when the state is shut down (i.e. you switch to another state from this one).
- Source:
-
update()
-
Put update logic here.
- Source: