public static int changeEnergy(float x, float y, int amount) {
        if (x < 0) x = 0;
        if (x > Game.width - 1) x = Game.width - 1;
        if (y < 0) y = 0;
        if (y > Game.height - 1) y = Game.height - 1;
        energy[(int) (x / 20)][(int) (y / 20)] += amount;
        if (energy[(int) (x / 20)][(int) (y / 20)] < 0) {
            amount -= energy[(int) (x / 20)][(int) (y / 20)];
            energy[(int) (x / 20)][(int) (y / 20)] = 0;
        }
        
        return amount;
    }