public void update() {
        super.update();
        if (level.player != null) {
            int xd = level.player.x - x;
            int yd = level.player.y - y;
            
            Rectangle r3 = level.player.getBounds();
            Rectangle r2 = getBounds();
            
            //if (xd * xd + yd * yd < 50 * 50) {
                //if(!intersects(level.player.x,level.player.y,(level.player.x + 16),(level.player.y + 16))){
                if (!r3.intersects(r2)) {
                    xa = 0;
                    ya = 0;
                    if (xd < 0) xa = -1;
                    if (xd > 0) xa = +1;
                    if (yd < 0) ya = -1;
                    if (yd > 0) ya = +1;
                }
                else{
                    xa = 0;
                    ya = 0;
                    level.player.gethurt();
                }
            //}

            if(xa != 0 || ya != 0) {
                    move(xa, ya);
                    walking = true;
            } else {
                    walking = false;	
            }
                    //System.out.println("alien: " + health);
        }
    }