zombiepaladin/scrolling-shooter — pull request #6 by Versaiteis (2012-09-02 07:07:07+00:00)
Title: Homing Missile Implementation - Nick Boen

I've implemented the Homing Missiles the best I can for the moment

So far the Missiles will fire based on a timer, initial positions of each missile in the volley is slightly random in the area of the nose of the ship, and Missiles will track and follow a moving target (not sure if its as optimized as can be, but I was able to get +12,000 missiles on screen before showing lag). The missiles also have three levels or tiers which determine the sprite, speed, and trajectory scalar that are used (the trajectory scalar determines how strict the missile adheres to a flight path, so a high value will fly straight at the target and a smaller value will arc toward it in a more realistic fashion)

The projectile is built to be recycled (as opposed to being destroyed)

I have yet to implement the rotation of the Missile, so it looks a bit...fake, but everything is documented so if anyone wants to play with it (which can be quite fun with tons of missiles) they can. At the moment I have them set up to follow the mouse position (If you want to use the mouse, you'll have to include the line "this.isMouseVisible = true" to the LoadContent() method in ScrollingShooterGame.cs.

I also have not added explosions or smoke trails, a separate animation class for each would probably be best for this.