Let it Home

So I have spent the past day or so tweaking the homing missile mechanic so it will function somewhat realistically and maintain a balance among the other weapons.  Currently I will not know for sure until the game is more complete and I have a chance to actually play through a level.  As it stands now the missiles are not driven by physics and are instead moved at a constant velocity towards the target.  In general, the missiles will be traveling slightly faster than the target so it actually has a chance of colliding.  The target system may change in the future as well, but for the time being, I am maintaining a list of on-screen enemy ships.  From this list, the missile launcher weapon sets the target for each bullet when fired.  Once the bullet is fired, the current target number is incremented:

bullet.TargetEntity = GameplayScreen.OnScreenShips[currentTargetNum % GameplayScreen.OnScreenShips.Count];                                                                currentTargetNum += 1;

Ships are removed from the list if they travel off-screen or are destroyed while on screen.  This may not be the most elegant solution, but for the time being it will suffice.  Enemy bullets always have their target set to the ship of the player.  I plan to add a time of decay so the missiles will not seek indefinitey, but rather explode after a specified amount of time.  I suppose that is all for now.  Hopefully I will have time to flesh this out even further in order to make it as robust as possible.  Next I may try to tackle the flame thrower as I have been putting it off for a while now.  The primary challenge with this weapon is the secondary fire; it disperses moderate amounts of nitrous oxide into the air that is then capable of being ignited by the primary fire.  I am still working on a way to accomplish this and will hopefully have something worthwhile in the near future.

~ by gwoodj on July 10, 2007.

Leave a Reply