This PR is the work for #1 #2 #3 olé.
This implement the steering behaviors in an object. The methods only return the steering force. The player|resource|... must apply this force to his velocity and update his position after that.
The move method for the Player should look like that:
function update {
steering = <steering behavior of your choice>(<params needed>)
steering = truncate (steering, max_force) // optional
steering = steering / mass
self.velocity = truncate (velocity + steering , max_speed)
self.position = position + velocity
}
:warning: This PR is missing unit tests for the moment. :warning:
This PR is the work for #1 #2 #3 olé. This implement the steering behaviors in an object. The methods only return the steering force. The player|resource|... must apply this force to his velocity and update his position after that.
The
move
method for thePlayer
should look like that::warning: This PR is missing unit tests for the moment. :warning: