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

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

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -