Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var jmps=0;
- var ok=0;
- var hits=0;
- var xloop=0;
- var jumptimer=new Timer(1000,0);
- function gogo() {
- if (ok==0) {
- jumptimer.start();
- }
- }
- gogo();
- head.addEventListener(MouseEvent.CLICK,gtas);
- jumptimer.addEventListener(TimerEvent.TIMER,jump);
- function jump(timer:TimerEvent) {
- head.x=Math.floor(Math.random()*1+800-1)+1;
- head.y=Math.floor(Math.random()*1+600-1)+1;
- jmps=jmps+1;
- jumpcount.text=String(jmps);
- jumptimer.reset();
- ok=0;
- return 0;
- }
- function gtas(mevent:MouseEvent) {
- hits=hits+1;
- hitcount.text=hits;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement