Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onClipEvent(load) {
- fi=0;
- k=Math.PI/180;
- dR=0;
- }
- onClipEvent(enterFrame) {
- if(Key.isDown(Key.UP)) dR+=0.3;
- if(Key.isDown(Key.DOWN)) dR-=0.3;
- if(Key.isDown(Key.LEFT))
- {
- fi+=2;
- auto.gotoAndPlay('lewo');
- }
- if(Key.isDown(Key.RIGHT))
- {
- fi-=2;
- auto.gotoAndPlay('prawo');
- }
- if(!trasa.hitTest(200,200,true)) dR*=0.9;
- fi_rad=k*fi;
- trasa._y+=dR.Math.cos(fi_rad);
- trasa.x+=dR.Math.sin(fi_rad);
- this._rotation=fi;
- auto._rotation=-fi;
- _parent.czas=Math.floor(getTimer()/1000)+" s";
- _parent.predkosc=Math.floor(dR*5)+" kmph";
- }
Add Comment
Please, Sign In to add comment