View Full Version : [AS1] FLASH RPG game (2)

07-05-2004, 01:18 PM
At the moment Im trying to create objects (human characters) moving on the stage to random (x,y). I want them walk to the point, then stop for few seconds, and pick up the new (x,y) random coordinates. The only problem is that it's all in the isometric-view (like Baldur's, Warcraft etc..) so I need another scripting to make them turn/look in the right direction.
Can anyone tell what the structure of this script should look like? Where shall I put script for new(x,y) and where the one regulating the rotation of character??
Will appreciate any help.

07-05-2004, 11:16 PM
start here http://www.actionscript.org/tutorials/advanced/trigonometry_and_flash/index.shtml

This will teach you how to take 2 points (characters current position and characters destination) , treat it like a right angled triangle and then use trig to work out the angle.

You then use this to decide how to display your character. I.E. if it were top down you could just rotate the character by the angle.


07-06-2004, 01:31 PM
Thanks a lot, mate. :)
I'll take a look and hopefully sort this out.