我想让它,所以我可以有一个墙跳在我的游戏,是否有一种方法来检查如果一个对象是触摸另一个物理对象的侧面类似于。接地()属性?
可以这样做:
player.collides(
'wall', // That's a tag.
() => {
// When player collides with anything tagged wall
}
);
或者如果你想手动检查每一帧,
player.action(() => {
if (player.isColliding(wall)) { // wall is a game object this time
// When player collides with game object wall
}
});