Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

game help

Name: Anonymous 2007-11-28 7:14

Right if yu can help me you are legends.

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: Anonymous 2007-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.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List