home *** CD-ROM | disk | FTP | other *** search
- i = 1;
- if(actif == 1)
- {
- if(ball1.hitTest(zaa) && zaa._alpha == 100)
- {
- zaa._x = random(580) + 11;
- zaa._y = random(380) + 11;
- if(scori > 0)
- {
- scori--;
- }
- if(scori == 0)
- {
- actif = 0;
- stopDrag();
- if(thesound == 1)
- {
- win.start(0);
- }
- fond_noir_new.gotoAndPlay(2);
- }
- else if(thesound == 1)
- {
- generic.start(0);
- }
- score.score = scori;
- scorp += Math.round((Math.abs(speedx1) + Math.abs(speedy1)) / 10);
- scorepts.scorepts = scorp;
- }
- timeb._width -= step;
- if(timeb._width < 100 && first_boum == 0)
- {
- first_boum = 1;
- if(thesound == 1)
- {
- soundclocktick.start(0);
- }
- }
- if(timeb._width < 1)
- {
- actif = 0;
- stopDrag();
- game_over = 1;
- fond_noir_new.gotoAndPlay(2);
- }
- }
- while(Number(i) <= 2)
- {
- if(eval("drag" add i) == true)
- {
- set("thenx" add i,eval("nowx" add i));
- set("theny" add i,eval("nowy" add i));
- set("nowx" add i,getProperty("ball" add i, _X));
- set("nowy" add i,getProperty("ball" add i, _Y));
- set("speedx" add i,eval("nowx" add i) - eval("thenx" add i));
- set("speedy" add i,eval("nowy" add i) - eval("theny" add i));
- if(eval("nowx" add i) >= 590)
- {
- set("drag" add i,false);
- stopDrag();
- tellTarget("/right")
- {
- gotoAndStop("play");
- play();
- }
- if(eval("speedx" add i) < 0)
- {
- set("speedx" add i,eval("speedx" add i) - 1);
- }
- else
- {
- set("speedx" add i,eval("speedx" add i) * -1 - 1);
- }
- }
- if(eval("nowx" add i) <= 10)
- {
- set("drag" add i,false);
- stopDrag();
- tellTarget("/left")
- {
- gotoAndStop("play");
- play();
- }
- if(eval("speedx" add i) < 0)
- {
- set("speedx" add i,eval("speedx" add i) * -1 + 1);
- }
- else
- {
- set("speedx" add i,eval("speedx" add i) + 1);
- }
- }
- if(eval("nowy" add i) >= 390)
- {
- stopDrag();
- set("drag" add i,false);
- tellTarget("/bottom")
- {
- gotoAndStop("play");
- play();
- }
- if(eval("nowy" add i) < 0)
- {
- set("speedy" add i,eval("speedy" add i) - 1);
- }
- else
- {
- set("speedy" add i,eval("speedy" add i) * -1 - 1);
- }
- }
- if(eval("nowy" add i) <= 10)
- {
- set("drag" add i,false);
- stopDrag();
- tellTarget("/top")
- {
- gotoAndStop("play");
- play();
- }
- if(eval("speedy" add i) < 0)
- {
- set("speedy" add i,eval("speedy" add i) * -1 + 1);
- }
- else
- {
- set("speedy" add i,eval("speedy" add i) + 1);
- }
- }
- }
- i = Number(i) + 1;
- }
- duplicateMovieClip("line","tether",16383);
- setProperty("tether", _X, nowx1);
- setProperty("tether", _Y, nowy1);
- setProperty("tether", _xscale, nowx2 - nowx1);
- setProperty("tether", _yscale, nowy2 - nowy1);
- diffx = nowx2 - nowx1;
- diffy = nowy2 - nowy1;
- if(Number(Number(diffx * diffx) + Number(diffy * diffy)) >= 800)
- {
- touch = false;
- }
- if(Number(touch) == Number(false))
- {
- if(Number(Number(diffx * diffx) + Number(diffy * diffy)) <= 400)
- {
- touch = true;
- if(actif == 1)
- {
- tellTarget("/smack")
- {
- gotoAndStop("sound");
- play();
- if(_root.scorp > 4)
- {
- _root.scorp -= 5;
- }
- else
- {
- _root.scorp = 0;
- }
- _root.scorepts.scorepts = _root.scorp;
- }
- }
- speedxtemp = speedx1;
- speedytemp = speedy1;
- speedx1 = speedx2 * tap * (Number((random(100) / 2 - 25) / 100) + 1);
- if(Number(speedx1 * speedx1) >= Number(max * max))
- {
- speedx1 *= 0.95;
- }
- speedx2 = speedxtemp * tap * (Number((random(100) / 2 - 25) / 100) + 1);
- if(Number(speedx2 * speedx2) >= Number(max * max))
- {
- speedx2 *= 0.95;
- }
- speedy1 = speedy2 * tap * (Number((random(100) / 2 - 25) / 100) + 1);
- if(Number(speedy1 * speedy1) >= Number(max * max))
- {
- speedy1 *= 0.95;
- }
- speedy2 = speedytemp * tap * (Number((random(100) / 2 - 25) / 100) + 1);
- if(Number(speedy2 * speedy2) >= Number(max * max))
- {
- speedy2 *= 0.95;
- }
- }
- }
-