Game Development Community

Homing Missile coding

by Kevin Epps · in Torque Game Builder · 02/15/2008 (11:25 am) · 4 replies

I'm trying to figure out how to code Homing missiles as I've never done it before. Does anyone have any tips on how to do this or possibly write a Behavior for?

Any help would just be great!!

#1
02/15/2008 (1:59 pm)
There is move toward object behavior already implemented. It can be found from TDN tdn.garagegames.com/wiki/TGB/Behaviors/Move_Toward_Object or from behavior playground project that comes with TGB. This combined with deal damage behavior would create a simple homing missile. Deal damage can also be found from TDN and example TGB project.
#2
02/23/2008 (9:27 am)
What would be the best way to search for the closest enemy?
#3
02/23/2008 (6:58 pm)
@Jussi:

Thanks! I didn't realize that you had replied! Thanks so much.
#4
02/23/2008 (10:33 pm)
Law, it depends on the situation. Lets say you're doing a desktop tower game, you'd put circluar triggers on top of your tower and then when an enemy enters it, you just start targeting that one until it's dead.

If this approach isn't what you're after, then you might want to check out the "pick" functions found the in sceneGraph docs. They will find objects contained within an area, which you can scroll through and determine which is closest.

Both of the methods above are fairly resource intensive, so use sparingly I would imagine.