View Single Post
  #4  
Old 11-08-2005, 01:16 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Skyld
A bit of math will allow you to move by angle directions.

This might work. Not sure, though, as I have not checked it.
NPC Code:
this.var = (angle / 360) * (pi * 2);
move(cos(this.var) * speed, -sin(this.var) * speed, 0.5, 0);


You should put some kind of check in as to whether the angle is < 0 or > 360, though.
actually, i use radians for angle measure. I think most math people do. I know what you mean for angular movement. I meant rotational movement... like going in circles. i don't know what would cover all of the properties of rotational movement though.