Game
Vortrus
7 years ago

How I Made The AI For The Protus Raider


Being an indie game dev and all, I have to minimize time spent on the game or I’ll quickly end up burning myself out. So oftentimes, I reuse scripts I wrote before for different purposes. For the Protus Raider ship, I reused the “Suicide Ship” script for this ship:

5d0a87d09bbb3.png

The first order of business was to make the ship fly back up towards the player in an arc. This was done using Rigidbody.Rotate and a couple of if statements. The general approach was to make sure the enemy wasn’t in the menu, the player wasn’t dead, etc and then make sure the Raider was below the player’s Y position. If it was and the X position is less than the player’s X position, then rotate to the right. Otherwise, if the X position is greater than the player’s X position, rotate to the left. The speed is determined by a public floating point variable in the inspector.

The rest of the code is mostly just plucked right from the suicide ship, and the result is that the ship was made in under an hour. Sometimes the best solutions are the least elegant :-)

5d0a87d3a1a90.gif


0 comments

Loading...

Next up

New To Vortrus: Volume Sliders!

Haven't had much time to work on Vortrus, but I have had time to add pretty post processing! Pretty good looking, huh?

New Creation Video Dropping Tomorrow Watch as this new concept art comes to life! Check it out on Youtube tomorrow at 1pm Eastern Time! Also keep watching for new updates in the days to come!

A New Enemy Type Appears! The Protus Raider will be in Protus Maximum and Minimum!

Working on a new type of ship! Hello, I am currently working hard on a new ship type called the Tyranis Carrier which will bring lots of new possibilities for the way you eliminate enemies. Stay tuned!

Working on level 6! I’m currently working on level 6 of Vortrus! This level will include combat against ground units among other new situations. It also will include the first actual terrain! :D Note that the screenshot is still very much a WIP.

A new patch just went live... along with this behemoth of a weapon! Why not earn it?

We are under attack!

Another house i made long time ago.

Shadow The Hedgehog X pixel art