Write an flight computer mode
This document will explain the different inputs to the flight computer interpret. With this information it should be able to write a flight computer mode on your own and submit it as a PR.
Your class need to be based on FlightCommandInterpret
and you need to put a node with your script below the FlightComputer
on the player or enemy ships. Keep in mind the first entry in the row will be used as default flight mode on game start.
Output to ship
X output Component
A negative x component will strafe the ship to the left, while a positive one will strafe it to the right.
Y output Component
A negative Y component will accelerate the ship while a negative one will decelerate it.
Commanded Velocity
You will return a velocity to the ship in the form of a vector. Those output will be generated by one of the following methods
IdleBaseVelocity
InterpretBaseVelocity
Those methods will get the following inputs from the ship itself.
CommandedVelocity
This is the normalized vector2 with the input given by the player on how to move the ship.
Keep in mind that a negative y means the ship should accelerate and a negative x means it will strafe to the left
CurrentVelocity
The current local velocity of the ship. This will indicate the current drift. This vector is also normalized.
This velocity is inverted to the commanded velocity. A positive Y will indicate a acceleration while a positive X is a drift to the left. The reason for that is that you can simple generate an output by inverting this input vector.
RotationVelocity
The rotation speed of the ship as a vector. If this is negative the ship currently rotates to the left
currentShipRotation
The current rotation of the ship, this will always be a positive radian.