Eye in the sky

This week we refactored the flight control system. Heading and velocities are now independent components, allowing us to create entities that rotate and move, like our ship; entities that move but don’t rotate, like… railgun slugs? And entities that rotate but don’t move, like unmanned turrets. We created the later to test our new systems.

They are able to detect nearby targets in range, choose the closest one (AI is just the simplest), set a desired heading so their barrel faces towards the target and rotate:

They don’t shoot, yet. That will depend on the mounted weapon. Firing an energy weapon will require keeping an eye on heat while ballistic/kinetic weapons¬† require managing ammo and reloading times. We’ll get there.

Fun fact: we can create elite-like gimbal-mounted weapons by simply attaching a turret to our ship and telling what to look for. This one is targeting the planetoid:

mounted turret
R2D2 with a big weapon


Furthermore… by separating the current input control system into heading (rotation) and velocity (thrust & strafe) we could easily get manned turrets! And we would be a step closer to this:

Great, kid! Don’t get cocky