Ad

Phaser Collision Not Working As Expected In Arcade

I have a man sprite (man) and a group of tree sprites (trees) setup with collision like this:

this.game.physics.arcade.collide(man,trees);

It works fine for the most part EXCEPT the man can walk UP into the tree (see below). Collision detect is working fine in all other directions (LEFT, RIGHT and DOWN, but not UP). Is this a bug? Gravity related or am i doing something wrong.

enter image description here

See Video: http://screencast.com/t/j5tLsqpO

Ad

Answer

Solution is to use man.body.velocity.y and NOT man.body.y in update routine

Ad
source: stackoverflow.com
Ad