Phaser API Documentation

  Version: 
Filter
Namespace: Events
Phaser.Physics.Arcade.Events

Events

COLLIDE
Focus
Focus

Description:

The Arcade Physics World Collide Event.

This event is dispatched by an Arcade Physics World instance if two bodies collide and at least one of them has their onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('collide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

name type description
gameObject1 Phaser.GameObjects.GameObject

The first Game Object involved in the collision. This is the parent of body1.

gameObject2 Phaser.GameObjects.GameObject

The second Game Object involved in the collision. This is the parent of body2.

body1 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The first Physics Body involved in the collision.

body2 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The second Physics Body involved in the collision.

Since: 3.0.0
Focus
Focus
OVERLAP
Focus
Focus

Description:

The Arcade Physics World Overlap Event.

This event is dispatched by an Arcade Physics World instance if two bodies overlap and at least one of them has their onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('overlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

name type description
gameObject1 Phaser.GameObjects.GameObject

The first Game Object involved in the overlap. This is the parent of body1.

gameObject2 Phaser.GameObjects.GameObject

The second Game Object involved in the overlap. This is the parent of body2.

body1 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The first Physics Body involved in the overlap.

body2 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The second Physics Body involved in the overlap.

Since: 3.0.0
Focus
Focus
PAUSE
Focus
Focus

Description:

The Arcade Physics World Pause Event.

This event is dispatched by an Arcade Physics World instance when it is paused.

Listen to it from a Scene using: this.physics.world.on('pause', listener).

Since: 3.0.0
Focus
Focus
RESUME
Focus
Focus

Description:

The Arcade Physics World Resume Event.

This event is dispatched by an Arcade Physics World instance when it resumes from a paused state.

Listen to it from a Scene using: this.physics.world.on('resume', listener).

Since: 3.0.0
Focus
Focus
TILE_COLLIDE
Focus
Focus

Description:

The Arcade Physics Tile Collide Event.

This event is dispatched by an Arcade Physics World instance if a body collides with a Tile and has its onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tilecollide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object involved in the collision. This is the parent of body.

tile Phaser.Tilemaps.Tile

The tile the body collided with.

body Phaser.Physics.Arcade.Body

The Arcade Physics Body of the Game Object involved in the collision.

Since: 3.16.1
Focus
Focus
TILE_OVERLAP
Focus
Focus

Description:

The Arcade Physics Tile Overlap Event.

This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile and has its onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tileoverlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The Game Object involved in the overlap. This is the parent of body.

tile Phaser.Tilemaps.Tile

The tile the body overlapped.

body Phaser.Physics.Arcade.Body

The Arcade Physics Body of the Game Object involved in the overlap.

Since: 3.16.1
Focus
Focus
WORLD_BOUNDS
Focus
Focus

Description:

The Arcade Physics World Bounds Event.

This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds and it has its onWorldBounds property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('worldbounds', listener).

Parameters:

name type description
body Phaser.Physics.Arcade.Body

The Arcade Physics Body that hit the world bounds.

up boolean

Is the Body blocked up? I.e. collided with the top of the world bounds.

down boolean

Is the Body blocked down? I.e. collided with the bottom of the world bounds.

left boolean

Is the Body blocked left? I.e. collided with the left of the world bounds.

right boolean

Is the Body blocked right? I.e. collided with the right of the world bounds.

Focus
Focus
WORLD_STEP
Focus
Focus

Description:

The Arcade Physics World Step Event.

This event is dispatched by an Arcade Physics World instance whenever a physics step is run. It is emitted after the bodies and colliders have been updated.

In high framerate settings this can be multiple times per game frame.

Listen to it from a Scene using: this.physics.world.on('worldstep', listener).

Parameters:

name type description
delta number

The delta time amount of this step, in seconds.

Since: 3.18.0
Focus
Focus