agtors / agar.core

Actor core system for simple Agar implementation
Apache License 2.0
2 stars 0 forks source link

Implement the steering behaviors #14

Closed NotBad4U closed 6 years ago

NotBad4U commented 6 years ago

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: