home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / ellipsis.swf / scripts / DefineSprite_7_lineline13 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-02-20  |  1.4 KB  |  66 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.    tap = Math.round(Math.random() * 16777215);
  40.    my_color.setRGB(tap);
  41.    life--;
  42.    if(_root.nmbr <= _root.fpsThresh)
  43.    {
  44.       life -= _root.globalDrop;
  45.    }
  46.    if(life < 25)
  47.    {
  48.       player._alpha = life * 4;
  49.    }
  50.    if(life <= 0)
  51.    {
  52.       _root.particles = _root.particles - 1;
  53.       this.removeMovieClip();
  54.    }
  55.    moveMe();
  56.    if(player._rotation >= 360)
  57.    {
  58.       player._rotation -= 360;
  59.    }
  60.    if(player._rotation < 0)
  61.    {
  62.       player._rotation += 360;
  63.    }
  64.    tracer = player._rotation;
  65. };
  66.