Fixed problem with Unit's most recent position not being updated every frame.
Occurred because the normalizeMovement method in the PhysicsEngine class was only being called when the player moved. This meant that every frame the player didn't move, the deltaTime would increase further. When the player then moved on the first frame, the large deltaTime value was used to calculate how much the max speed could be and resulted in a skip like movement on the screen.
The temporary fix is to update the Unit's lastMoved value to the current system time every time the processMovement is called, which is every frame. This should probably be moved to the Unit itself at some point and we should make a call to a processUnit method of some sort that updates all relevant units.
Updated the code to include jump functionality.
Fixed problem with Unit's most recent position not being updated every frame.
normalizeMovement
method in thePhysicsEngine
class was only being called when the player moved. This meant that every frame the player didn't move, thedeltaTime
would increase further. When the player then moved on the first frame, the largedeltaTime
value was used to calculate how much the max speed could be and resulted in a skip like movement on the screen.lastMoved
value to the current system time every time theprocessMovement
is called, which is every frame. This should probably be moved to the Unit itself at some point and we should make a call to aprocessUnit
method of some sort that updates all relevant units.