"homing" missiles?

BlitzPlus Forums/BlitzPlus Programming/"homing" missiles?

elseano(Posted 2004) [#1]
I've been trying to do this for a while now....Basically, what I need is an algorythm that points an enemy or enemy's missile towards the player each frame. I thought it would be something to do with sin/tan and the player's x and y position, but I can't get my head around it...:S

Can anyone help me with this?


Mr Brine(Posted 2004) [#2]
yo dude!

check it out:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1073

Mr Brine


Murilo(Posted 2004) [#3]
Doesn't work for me. Is it something to do with the scope of variables ox and oy (I only had a very quick glance)?


Floyd(Posted 2004) [#4]
The upload got corrupted. ox should be o\x.


Mr Brine(Posted 2004) [#5]
Thanks floyd! Ive fixed the code so it should work ok now!