darozak / Advolition

1 stars 0 forks source link

Don't allow a robot's power to drop below zero. #31

Closed darozak closed 7 months ago

darozak commented 7 months ago

Need to prevent the power from dropping below zero and only complete an action if enough power remains.

darozak commented 7 months ago

Created a new battery class that tracks power levels and won't let them fall below zero. I also created checks to ensure that the robot can't act if it's power drops to zero. (https://github.com/darozak/Advolition/commit/b16ba40ae82db8b5c25b678d2faf20dca4db4dfb)