These docs are for phaser 2 6 2 phaser 3 docs can be found on github pages.
Check touching floor phaser.
Before we get into collisions it s important to understand the role of the update method.
Get the source and assets for every phaser example from the phaser examples github repository.
Touching phaser types physics arcade arcadebodycollision whether this body is colliding with a body or static body and in which direction.
The phaser sandbox allows you to code games in your browser without having to download or install anything.
Android 2 x only supports 1 touch event at once no multi touch.
Touching up true means the collision happened to the top of this body for example.
In your phaser states you may have an update method that.
With literally hundreds of pieces of source code this is an invaluable resource to have available locally.
A fast free and fun open source framework for canvas and webgl powered browser games.
A fast free and fun open source framework for canvas and webgl powered browser games.
Desktop and mobile html5 game framework.
In a collision where both bodies have zero velocity embedded will be set instead.
For more phaser tutorials you can also check out the games category on the blog.
Call gameobject setinteractive to register touch input of game object before listening touching events.
Phaser touch handles touch events with your game.
This will set you up with a nice structure to start building html5 mobile games with phaser.
You should not normally access this class directly but instead use a phaser pointer object which normalises all game input for you.
If true the body will check itself against the sprite getbounds dimensions and adjust its width and height accordingly.
Set hit area from width height rectangle of the texture gameobject.
Set hit area from game object.
However we also test if the player is touching the floor otherwise they could jump while in mid air.
We check the variable hitplatform just to make sure the player did actually collide with the floor and not anything else.
An object containing touching results.