听起来非常哲学不是吗?
无论如何,我有一个相当复杂的问题.
我的main_activity类收集了所有僵尸,如下所示:
//Testing Runnable (used to compare the first zombie with the player)
private Runnable updateLocations = new Runnable(){
@Override
public void run(){
try {
while(true) {
image_player.getLocationInWindow(pLoc);
Zombie zoms = zombieCollection.next();
if(!zoms.equals(null)){
zoms.getZombieImage().getLocationInWindow(zLoc);
}
System.out.println("Zombie: x = " + zLoc[0] + "; y = " + zLoc[1]);
System.out.println("Player: x = " + pLoc[0] + "; y = " + pLoc[1]);
Thread.sleep(500);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
Run Code Online (Sandbox Code Playgroud)
我的僵尸类收集信息如下:
public class Zombie{
float X, Y; …Run Code Online (Sandbox Code Playgroud)