home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / ellipsis.swf / scripts / DefineSprite_11_lineline9 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-02-20  |  2.6 KB  |  115 lines

  1. function moveMe()
  2. {
  3.    youSpeed = Math.min(youMaxSpeed,youSpeed + youAcc);
  4.    player._rotation += (Key.isDown(39) - Key.isDown(37)) * 7;
  5.    xC = Math.cos(player._rotation * 3.141592653589793 / 180) * youSpeed;
  6.    yC = Math.sin(player._rotation * 3.141592653589793 / 180) * youSpeed;
  7.    player._x += xC;
  8.    player._y += yC;
  9.    oldX = player._x;
  10.    oldY = player._y;
  11. }
  12. if(_root.globalDebris == false)
  13. {
  14.    this.removeMovieClip();
  15. }
  16. _root.particles = _root.particles + 1;
  17. life = 1.5;
  18. youAcc = 4;
  19. youDec = 0.2;
  20. youSpeed = 0;
  21. youMaxSpeed = random(5) + 5;
  22. if(_root.cstatus == 0)
  23. {
  24.    player._x = 0;
  25.    player._y = 0;
  26. }
  27. else
  28. {
  29.    player._x = _root._xmouse;
  30.    player._y = _root._ymouse;
  31. }
  32. player._rotation = random(360);
  33. var my_color = new Color(this);
  34. my_color.setRGB(8800141);
  35. life *= 50;
  36. onEnterFrame = function()
  37. {
  38.    life--;
  39.    if(_root.nmbr <= _root.fpsThresh)
  40.    {
  41.       life -= _root.globalDrop;
  42.    }
  43.    if(life < 25)
  44.    {
  45.       player._alpha = life * 4;
  46.    }
  47.    if(life <= 0)
  48.    {
  49.       _root.particles = _root.particles - 1;
  50.       this.removeMovieClip();
  51.    }
  52.    moveMe();
  53.    if(player._rotation >= 360)
  54.    {
  55.       player._rotation -= 360;
  56.    }
  57.    if(player._rotation < 0)
  58.    {
  59.       player._rotation += 360;
  60.    }
  61.    if(player._x >= 575)
  62.    {
  63.       if(player._rotation >= 0 && player._rotation < 90)
  64.       {
  65.          player._rotation = 180 - player._rotation;
  66.          moveMe();
  67.       }
  68.       if(player._rotation < 0 && player._rotation > -90)
  69.       {
  70.          player._rotation = 180 - player._rotation;
  71.          moveMe();
  72.       }
  73.    }
  74.    if(player._x <= 25)
  75.    {
  76.       if(player._rotation <= 180 && player._rotation > 90)
  77.       {
  78.          player._rotation = 180 - player._rotation;
  79.          moveMe();
  80.       }
  81.       if(player._rotation > -180 && player._rotation < -90)
  82.       {
  83.          player._rotation = 180 - player._rotation;
  84.          moveMe();
  85.       }
  86.    }
  87.    if(player._y <= 25)
  88.    {
  89.       if(player._rotation >= -180 && player._rotation <= -90)
  90.       {
  91.          player._rotation = - player._rotation;
  92.          moveMe();
  93.       }
  94.       if(player._rotation >= -90 && player._rotation <= 0)
  95.       {
  96.          player._rotation = - player._rotation;
  97.          moveMe();
  98.       }
  99.    }
  100.    if(player._y >= 575)
  101.    {
  102.       if(player._rotation >= 90 && player._rotation <= 180)
  103.       {
  104.          player._rotation = - player._rotation;
  105.          moveMe();
  106.       }
  107.       if(player._rotation <= 90 && player._rotation >= 0)
  108.       {
  109.          player._rotation = - player._rotation;
  110.          moveMe();
  111.       }
  112.    }
  113.    tracer = player._rotation;
  114. };
  115.