home *** CD-ROM | disk | FTP | other *** search
- class Particle extends Position
- {
- function Particle()
- {
- super();
- }
- function drawToScreen()
- {
- this.screenPosition();
- this.render();
- if(this.render_z < -200)
- {
- this.posZ += 200;
- this.posX = Position.camera_x + Math.round(Math.random() * 250) - 125;
- this.posY = Position.camera_y + Math.round(Math.random() * 250) - 175;
- }
- if(this.posX < Position.camera_x - 125)
- {
- this.posX += 250;
- }
- else if(this.posX > Position.camera_x + 125)
- {
- this.posX -= 250;
- }
- if(this.posY < Position.camera_y - 175)
- {
- this.posY += 250;
- }
- else if(this.posY > Position.camera_y + 75)
- {
- this.posY -= 250;
- }
- }
- }
-