@Override
    public void update() {
        // to handle animation and other stuff
        super.update();

        // AI stuff goes here
        double dist = Math.sqrt(Math.pow(Map.getPlayer().getX() - x, 2)
                + Math.pow(Map.getPlayer().getY() - y, 2));
        if (dist < 64 && dist > attackRange) {
            int dy = 0;
            int dx = 0;
            if (y < Map.getPlayer().getY())
                dy = 1;
            else if (y > Map.getPlayer().getY())
                dy = -1;
            if (x < Map.getPlayer().getX())
                dx = 1;
            else if (x > Map.getPlayer().getX())
                dx = -1;
            move(dx, dy);
        }
    }