home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / rocket_rush.swf / scripts / __Packages / Particle.as < prev    next >
Encoding:
Text File  |  2007-03-20  |  804 b   |  35 lines

  1. class Particle extends Position
  2. {
  3.    function Particle()
  4.    {
  5.       super();
  6.    }
  7.    function drawToScreen()
  8.    {
  9.       this.screenPosition();
  10.       this.render();
  11.       if(this.render_z < -200)
  12.       {
  13.          this.posZ += 200;
  14.          this.posX = Position.camera_x + Math.round(Math.random() * 250) - 125;
  15.          this.posY = Position.camera_y + Math.round(Math.random() * 250) - 175;
  16.       }
  17.       if(this.posX < Position.camera_x - 125)
  18.       {
  19.          this.posX += 250;
  20.       }
  21.       else if(this.posX > Position.camera_x + 125)
  22.       {
  23.          this.posX -= 250;
  24.       }
  25.       if(this.posY < Position.camera_y - 175)
  26.       {
  27.          this.posY += 250;
  28.       }
  29.       else if(this.posY > Position.camera_y + 75)
  30.       {
  31.          this.posY -= 250;
  32.       }
  33.    }
  34. }
  35.