home *** CD-ROM | disk | FTP | other *** search
- if(Key.isDown(37) && gameActive)
- {
- da = 6;
- ds += 0.1;
- tube.gotoAndStop("rActive");
- }
- else if(Key.isDown(39) && gameActive)
- {
- da = -6;
- ds += 0.1;
- tube.gotoAndStop("lActive");
- }
- else
- {
- da *= 0.5;
- ds *= 0.5;
- if(!gameActive)
- {
- tube.gotoAndStop("winGame");
- }
- else
- {
- tube.gotoAndStop("inActive");
- }
- }
- a += da;
- s = (s + ds) * waterRes;
- if(s < sMin)
- {
- s = sMin;
- }
- if(sMax < s)
- {
- s = sMax;
- }
- dx = Math.cos(3.141592653589793 * (a - 90) / 180) * s;
- dy = Math.sin(3.141592653589793 * (a - 90) / 180) * s;
- var tx = x + dx;
- var ty = y + dy;
- if(wall.hittest(tx,ty,true))
- {
- s *= -0.5;
- }
- else
- {
- x = tx;
- y = ty;
- }
- tube._x = x;
- tube._y = y;
- tube._rotation = a;
- if(finish.hittest(x,y,true))
- {
- if(lastmarker == 2)
- {
- lastmarker = 0;
- currentLap += 1;
- timer.currentLap = currentLap;
- if(currentLap == 2)
- {
- timer.timerActive = false;
- g1Result._visible = true;
- g1Result.finalTime = timer.elapsedTime + " seconds";
- _root.timeTracker += timer.elapsedTime;
- gameActive = false;
- }
- }
- }
- else if(partway1.hittest(x,y,true))
- {
- if(lastmarker == 0)
- {
- lastmarker = 1;
- }
- }
- else if(partway2.hittest(x,y,true))
- {
- if(lastmarker == 1)
- {
- lastmarker = 2;
- }
- }
-