简体   繁体   中英

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.

在此处输入图片说明

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

解决方案是在更新例程中使用man.body.velocity.y而不是man.body.y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM