hannobraun / vndf-2020

Von Neumann Defense Force - a game about spaceships
2 stars 0 forks source link

Fuel value can go below zero #3

Closed hannobraun closed 4 years ago

hannobraun commented 4 years ago

As of now, every frame that the engine is on, some amount if fuel is subtracted from the current fuel. This can cause the fuel value to become slightly negative. (It won't become any more negative after that, as that whole operation will only be done, if the value is positive.)

There are two problems here:

  1. A negative fuel value looks weird.
  2. More fuel can be used than the craft has.

The first problem can be fixed easily, by making sure the fuel value is at leas zero after the subtraction. The second problem is not a big deal, but it might be nicer to be a bit smarter about the whole operation, and never use more fuel than is available.