Week3(?) Checkpoint, Enemies


Today that is definitely Friday, and not Sunday, I am checking in that the game currently has enemies.

Currently there is an IFF system, and a dumb fighter script that moves toward its closest enemy while the hardpoint shoots at it.

It works like this:
The GameState* script collects all the existing ships/stations, and sorts them into the different team types(Humans. Aliens, Neutrals, etc).
Then each AI gets these lists and sorts them into enemies, Allies, and neutrals.
Then during the AI tick(Random in range of 1 to 1.3 seconds) The AI will filter for the closest enemy.
Then during the Update function the AI will fire at its enemy and move towards it.

* the gamestate script is a static object that lasts throughout the entire program life. I use it to store things that the game needs to know on all levels. In the case of the AI, I decided that finding all the ship/station objects and sorting them into lists is best done once, instead of once in each individual AI.

Leave a comment

Log in with itch.io to leave a comment.