【发布时间】:2014-03-15 15:24:02
【问题描述】:
碰撞检测检查玩家是否与前景相交:
if (rbot2.intersects(r) && type == 8) {
System.out.println("Collision With Foreground");
}
现在,一旦您不再站在这片前景上,我需要玩家跌倒。但是我如何检测没有站在前台?
我试过了:
if (rbot2.intersects(r) && type == 8) {
System.out.println("Collision With Foreground");
}
else
System.out.println("No longer colliding with Foreground");
但是这样做的结果是无论你站在哪里,输出都是 ALWAYS:不再与 Foreground 碰撞。
我在这里做错了什么?
【问题讨论】: