home *** CD-ROM | disk | FTP | other *** search
- function moveMe()
- {
- youSpeed = Math.min(youMaxSpeed,youSpeed + youAcc);
- player._rotation += (Key.isDown(39) - Key.isDown(37)) * 7;
- xC = Math.cos(player._rotation * 3.141592653589793 / 180) * youSpeed;
- yC = Math.sin(player._rotation * 3.141592653589793 / 180) * youSpeed;
- player._x += xC;
- player._y += yC;
- oldX = player._x;
- oldY = player._y;
- }
- youAcc = 0.2;
- youDec = 0.2;
- youSpeed = 0;
- youMaxSpeed = 2;
- temp = random(2);
- if(temp == 0)
- {
- player._x = 25;
- }
- else
- {
- player._x = 575;
- }
- player._y = 25 + random(650);
- player._rotation = random(360);
- var sent = random(6) - 3;
- var sentD = "up";
- var sInc = 0.5;
- life *= 50;
- driftSpeed = 0.09;
- angle = 0;
- degrees = 0;
- onEnterFrame = function()
- {
- moveMe();
- circx = player._x;
- circy = player._y;
- prevx = _root._xmouse;
- prevy = _root._ymouse;
- if(circx < prevx && circy < prevy)
- {
- angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
- degrees = angle * 180 / 3.141592653589793;
- player._rotation = degrees + 90;
- }
- else if(circx < prevx && circy > prevy)
- {
- angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
- degrees = angle * 180 / 3.141592653589793;
- player._rotation = 90 - degrees;
- }
- else if(circx > prevx && circy < prevy)
- {
- angle = Math.atan(Math.abs(circx - prevx) / Math.abs(circy - prevy));
- degrees = angle * 180 / 3.141592653589793;
- player._rotation = - (180 - degrees);
- }
- else if(circx > prevx && circy > prevy)
- {
- angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
- degrees = angle * 180 / 3.141592653589793;
- player._rotation = - (90 - degrees);
- }
- if(Math.sqrt(Math.pow(circx - prevx,2) + Math.pow(circy - prevy,2)) <= 200)
- {
- player._rotation += 90;
- }
- else
- {
- player._rotation -= 90;
- }
- if(player._rotation >= 360)
- {
- player._rotation -= 360;
- }
- if(player._rotation < 0)
- {
- player._rotation += 360;
- }
- if(player._x >= 575)
- {
- if(player._rotation >= 0 && player._rotation < 90)
- {
- player._rotation = 180 - player._rotation;
- moveMe();
- }
- if(player._rotation < 0 && player._rotation > -90)
- {
- player._rotation = 180 - player._rotation;
- moveMe();
- }
- }
- if(player._x <= 25)
- {
- if(player._rotation <= 180 && player._rotation > 90)
- {
- player._rotation = 180 - player._rotation;
- moveMe();
- }
- if(player._rotation > -180 && player._rotation < -90)
- {
- player._rotation = 180 - player._rotation;
- moveMe();
- }
- }
- if(player._y <= 25)
- {
- if(player._rotation >= -180 && player._rotation <= -90)
- {
- player._rotation = - player._rotation;
- moveMe();
- }
- if(player._rotation >= -90 && player._rotation <= 0)
- {
- player._rotation = - player._rotation;
- moveMe();
- }
- }
- if(player._y >= 575)
- {
- if(player._rotation >= 90 && player._rotation <= 180)
- {
- player._rotation = - player._rotation;
- moveMe();
- }
- if(player._rotation <= 90 && player._rotation >= 0)
- {
- player._rotation = - player._rotation;
- moveMe();
- }
- }
- if(player.hitTest(_root.base))
- {
- _root.base.play();
- _root.life = _root.life - 1;
- }
- if(_root.life <= 0)
- {
- i = 0;
- while(i < 4)
- {
- e = _root.attachMovie("lineline8","l" + _root.k,_root.k++);
- e._x = player._x;
- e._y = player._y;
- i++;
- }
- this.removeMovieClip();
- }
- };
- onMouseDown = function()
- {
- if(player.hitTest(_root._xmouse,_root._ymouse))
- {
- _root.score += 450;
- _root.hitted.start();
- _root.kill = _root.kill + 1;
- i = 0;
- while(i < 10)
- {
- _root.attachMovie("lineline8","l" + _root.k,_root.k++);
- i++;
- }
- this.removeMovieClip();
- }
- };
-