DemoProductions / shmup

3 stars 2 forks source link

missile ai #39

Closed flip40 closed 8 years ago

flip40 commented 8 years ago

create missile style ai for a "bullet" object.

Just some thoughts, I'll copy this into a discussion somewhere, but if we have different style bullets I think the Bullet class as a base works fine, it has no need for AI or smartness, it just goes forward. A missile AI class added on would tell the missile to track a target with some turn radius attached. Forwards motion would still be the bullet, if that makes any sense.

We might also want to have a weapon class that actually handles the bullet and how / how many are fired as well. A player or enemy can just ask their weapon to fire, and the weapon determines how and what is fired.

flip40 commented 8 years ago

Almost done with this, took me forever last night trying to find a method that would just let me do basic geometric math instead of spending a lot of time trying to figure out what a Quaternion is and how they work... At the moment tracking works, but I want to add functionality for a tracking radius as well.

flip40 commented 8 years ago

Oh, I'll also rename the class as TrackingAI, a bit more generic since it doesn't really do "missile" stuff, it does tracking. No reason one couldn't use this script component to cause an enemy to track and run into a player, for example...