, , .
-, , Math.PI/180 .. , , .
-, : , . GC, . -, Flash IDE, , -. Flash- , , , Flex , , GC.
, - (, Flash), , , , . , , , , ( ), . , triangulate , , .
, , , Flash- , . , , , , ( ), ( ). FPS.
, , Flash , , , . , vsync . , , , FPS .
edit: , , " ", . . , 12 16 , , - ; , -. ( , , .. .) , , , , . , , . , , , .
2
: " , , ?"
: , - . :
function onEnterFrame() {
ship.angle += dtheta;
ship.x += speed * Math.cos( ship.angle );
ship.y += speed * Math.sin( ship.angle );
}
function onEnterFrame2() {
var dt:Number = getTimeSinceLastFrame();
ship.angle += anglePerSecond * dt/1000;
var dist:Number = speedPerSecond * dt/1000;
ship.x += dist * Math.cos( ship.angle );
ship.y += dist * Math.sin( ship.angle );
}
, , . , , , Flash. , , " ", , . , , CPU, , ? . , , - , dt 2 3 (1/fps).
, , , , , - , " timestep!". . , , , . , , , , , , timestep. , , , .
6
-, , - , . , , , , . -, , , , -, , , , . , , , SWF- (moreso Firefox, IE). , (, , , - ).
, . , , . , , , ( ).
, , IDE.
http://www.fenomas.com/random/ship/
, , , . ( , Firefox.) , , , , . , , , , .