williamfiset / FruitFever

Fruit Fever adventure game by Micah Stairs and William Fiset
5 stars 2 forks source link

Cropping Negative Array Size #90

Closed williamfiset closed 10 years ago

williamfiset commented 10 years ago

Game crashes when you run out of health. I think it may be linked to pressing the space bar even when there is no energy.

screen shot 2014-06-03 at 9 35 48 pm

micahstairs commented 10 years ago

It's not health, it's energy. It's not linked to the spacebar, since there's a check to make sure you don't hit negative values there. However, the player is steadily losing 0.1 energy per frame.

I was aware of this bug, and was planning to fix it this morning, since I merely did not have time to finish implementing it!

micahstairs commented 10 years ago

Fixed this by adding a safeguard to ImageTransformer, and also fixed this in FruitFever to ensure that currentEnergy does not reach negative values.