home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / ellipsis.swf / scripts / DefineSprite_17_lineline2 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-02-20  |  2.6 KB  |  116 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. tap = Math.round(Math.random() * 16777215);
  34. var my_color = new Color(this);
  35. my_color.setRGB(tap);
  36. life *= 50;
  37. onEnterFrame = function()
  38. {
  39.    life--;
  40.    if(_root.nmbr <= _root.fpsThresh)
  41.    {
  42.       life -= _root.globalDrop;
  43.    }
  44.    if(life < 25)
  45.    {
  46.       player._alpha = life * 4;
  47.    }
  48.    if(life <= 0)
  49.    {
  50.       _root.particles = _root.particles - 1;
  51.       this.removeMovieClip();
  52.    }
  53.    moveMe();
  54.    if(player._rotation >= 360)
  55.    {
  56.       player._rotation -= 360;
  57.    }
  58.    if(player._rotation < 0)
  59.    {
  60.       player._rotation += 360;
  61.    }
  62.    if(player._x >= 575)
  63.    {
  64.       if(player._rotation >= 0 && player._rotation < 90)
  65.       {
  66.          player._rotation = 180 - player._rotation;
  67.          moveMe();
  68.       }
  69.       if(player._rotation < 0 && player._rotation > -90)
  70.       {
  71.          player._rotation = 180 - player._rotation;
  72.          moveMe();
  73.       }
  74.    }
  75.    if(player._x <= 25)
  76.    {
  77.       if(player._rotation <= 180 && player._rotation > 90)
  78.       {
  79.          player._rotation = 180 - player._rotation;
  80.          moveMe();
  81.       }
  82.       if(player._rotation > -180 && player._rotation < -90)
  83.       {
  84.          player._rotation = 180 - player._rotation;
  85.          moveMe();
  86.       }
  87.    }
  88.    if(player._y <= 25)
  89.    {
  90.       if(player._rotation >= -180 && player._rotation <= -90)
  91.       {
  92.          player._rotation = - player._rotation;
  93.          moveMe();
  94.       }
  95.       if(player._rotation >= -90 && player._rotation <= 0)
  96.       {
  97.          player._rotation = - player._rotation;
  98.          moveMe();
  99.       }
  100.    }
  101.    if(player._y >= 575)
  102.    {
  103.       if(player._rotation >= 90 && player._rotation <= 180)
  104.       {
  105.          player._rotation = - player._rotation;
  106.          moveMe();
  107.       }
  108.       if(player._rotation <= 90 && player._rotation >= 0)
  109.       {
  110.          player._rotation = - player._rotation;
  111.          moveMe();
  112.       }
  113.    }
  114.    tracer = player._rotation;
  115. };
  116.