Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. var jmps=0;
  2. var ok=0;
  3. var hits=0;
  4. var xloop=0;
  5. var jumptimer=new Timer(1000,0);
  6.  
  7. function gogo() {
  8. if (ok==0) {
  9. jumptimer.start();
  10. }
  11. }
  12. gogo();
  13.  
  14. head.addEventListener(MouseEvent.CLICK,gtas);
  15. jumptimer.addEventListener(TimerEvent.TIMER,jump);
  16.  
  17. function jump(timer:TimerEvent) {
  18.  
  19. head.x=Math.floor(Math.random()*1+800-1)+1;
  20. head.y=Math.floor(Math.random()*1+600-1)+1;
  21. jmps=jmps+1;
  22. jumpcount.text=String(jmps);
  23. jumptimer.reset();
  24. ok=0;
  25. return 0;
  26.  
  27. }
  28.  
  29. function gtas(mevent:MouseEvent) {
  30. hits=hits+1;
  31. hitcount.text=hits;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement