new World(game)
"This world is but a canvas to our imagination." - Henry David Thoreau
<p> A game has only one world. The world is an abstract place in which all game objects live. It is not bound by stage limits and can be any size. You look into the world via cameras. All game objects live within the world at world-based coordinates. By default a world is created the same size as your Stage.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | Reference to the current game instance. |
- Source:
Members
-
bounds
-
- Source:
Properties:
Name Type Description bounds
Phaser.Rectangle Bound of this world that objects can not escape from.
-
camera
-
- Source:
Properties:
Name Type Description camera
Phaser.Camera Camera instance.
-
<readonly> centerX
-
- Source:
Properties:
Name Type Description centerX
number Gets the X position corresponding to the center point of the world.
-
<readonly> centerY
-
- Source:
Properties:
Name Type Description centerY
number Gets the Y position corresponding to the center point of the world.
-
currentRenderOrderID
-
- Source:
Properties:
Name Type Description currentRenderOrderID
number Reset each frame, keeps a count of the total number of objects updated.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running Game.
-
group
-
- Source:
Properties:
Name Type Description group
Phaser.Group Object container stores every object created with
create*
methods. -
height
-
- Source:
Properties:
Name Type Description height
number Gets or sets the current height of the game world.
-
<readonly> randomX
-
- Source:
Properties:
Name Type Description randomX
number Gets a random integer which is lesser than or equal to the current width of the game world.
-
<readonly> randomY
-
- Source:
Properties:
Name Type Description randomY
number Gets a random integer which is lesser than or equal to the current height of the game world.
-
width
-
- Source:
Properties:
Name Type Description width
number Gets or sets the current width of the game world.
Methods
-
<protected> boot()
-
Initialises the game world.
- Source:
-
destroy()
-
Destroyer of worlds.
- Source:
-
postUpdate()
-
This is called automatically every frame, and is where main logic happens.
- Source:
-
setSize(width, height)
-
Updates the size of this world.
Parameters:
Name Type Description width
number New width of the world.
height
number New height of the world.
- Source:
-
update()
-
This is called automatically every frame, and is where main logic happens.
- Source: