flash - Move an object in the direction its pointing Actionscript 3 -



flash - Move an object in the direction its pointing Actionscript 3 -

i'm messing in actionscript 3 , trying move object, can move on y axis have set object , rotate trying move in direction pointing not restricted move along y or x axis

anyone have tips?

just basic trigonometry should trick.

var speed:number = 10; var angle:number = math.pi/2; obj.x += speed * math.cos(angle); obj.y += speed * math.sin(angle);

for more advanced wizardry recommend learning linear algebra. start can made here :)

actionscript-3 flash actionscript

Comments

Popular posts from this blog

java - Bypassing "final local variable defined in an enclosing type" -

c - Compilation of a code: unkown type name string -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -