02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

1 function setDirection(x1, y1){<br />

2 x = _x - x1;<br />

3 y = _y - y1;<br />

4 angle = Math.atan2(y, x) + _root.PI;<br />

5 frame = int(angle/_root.FRAMETORADIANS) + 1;<br />

6 setFrame(frame);<br />

7 if (speed

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!