The problem:
I'm making a game in java atm and I need the enemy objects to move towards the players ship as it is moved around.
Does anyone know an algorithm for this?
Cheers
Name:
Anonymous2007-11-28 7:16
MoveShitTowardsShit2d(),
and similarly,
MoveShitTowardsShit3d().
I think there is a complete analysis in Knuth.
Name:
Anonymous2007-11-28 7:18
what. the. fuck?
Name:
Anonymous2007-11-28 7:26
>>1
It's very simple. Just take the dot product to determine the distance between the two points, then reduce that distance by an amount determined from the speed of the object (i.e. bringing the objects closer together), then calculate the new position based on the previous angle(s) and new distance.