Guest User

Untitled

a guest
Apr 26th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. onClipEvent(load) {
  2. fi=0;
  3. k=Math.PI/180;
  4. dR=0;
  5.  
  6. }
  7.  
  8. onClipEvent(enterFrame) {
  9. if(Key.isDown(Key.UP)) dR+=0.3;
  10. if(Key.isDown(Key.DOWN)) dR-=0.3;
  11. if(Key.isDown(Key.LEFT))
  12. {
  13. fi+=2;
  14. auto.gotoAndPlay('lewo');
  15. }
  16.  
  17. if(Key.isDown(Key.RIGHT))
  18. {
  19. fi-=2;
  20. auto.gotoAndPlay('prawo');
  21. }
  22. if(!trasa.hitTest(200,200,true)) dR*=0.9;
  23. fi_rad=k*fi;
  24. trasa._y+=dR.Math.cos(fi_rad);
  25. trasa.x+=dR.Math.sin(fi_rad);
  26. this._rotation=fi;
  27. auto._rotation=-fi;
  28. _parent.czas=Math.floor(getTimer()/1000)+" s";
  29. _parent.predkosc=Math.floor(dR*5)+" kmph";
  30. }
Add Comment
Please, Sign In to add comment