When a physics body was freed by queue_free or free, it was possible
for the physics update to still happen on the specialized agent. The
Null body then caused a crash.
I made minimal changes, mostly cosmetic like so:
- rename KinematicMovementType to MovementType since
GSTKinematicBody2DAgent.KinematicMovementType.COLLIDE for example is
really more than a mouthful with repeated Kinematic in the name
- add optional movement_type parameter to the constructor, otherwise
we'd be forced to construct the object and then specify as an
aditional step the type of movement if we want something else than the
default
- rewrote the constructor to yield on ready and removed _on_body_ready
- renamed _apply_steering to apply_steering as this is a public method
- renamed _on_SceneTree_frame to _on_SceneTree_physics_frame
The agents auto-update themselves and can calculate their velocities.
This keeps the user from having to create an update_agent function.
It can also save the user from having to keep track of and update
velocities at all by using the provided `apply_steering` method.
Closes#15, closes#16