小编she*_*iHD的帖子

我的僵尸不会发现自己.

听起来非常哲学不是吗?

无论如何,我有一个相当复杂的问题.

我的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)

java android imageview runnable

2
推荐指数
1
解决办法
412
查看次数

标签 统计

android ×1

imageview ×1

java ×1

runnable ×1