Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Gassy!!! (https://forums.graalonline.com/forums/showthread.php?t=75829)

Angel_Light 07-24-2007 04:39 PM

Gassy!!!
 
1 Attachment(s)
PHP Code:

//#CLIENTSIDE
// Made by Mr. Omega
//Inspired by a script of Napo
function onCreated() {
  
onTimeOut();
  
this.on 0;
}

function 
onWeaponFired() {
  if ( 
this.on == 0)
  {
    
this.on 1;
  
    
with findimg200)) {     
      
layer 2;
      
emitter.delaymin 0.1;
      
emitter.delaymax 0.5;
      
emitter.nrofparticles 1;

      
emitter.particle.lifetime 3;
      
emitter.particle.image "g4_particle_smoke.png";
      
emitter.particle.mode  1;
      
emitter.particle.red   0;
      
emitter.particle.green 1;
      
emitter.particle.blue  0;
      
emitter.particle.alpha 0.6;
      
emitter.particle.zoom  0.5;
      
emitter.particle.speed 4;
      
      
emitter.addglobalmodifier("range"01000"movex""add", -4, -10);
      
emitter.addglobalmodifier("impulse"0.20.2"spin""multiply"0.90.9);
      
emitter.addlocalmodifier("once"00"angle""add", -0.20.2);
      
emitter.addlocalmodifier("once"00"rotation""replace"02*pi);
      
emitter.addlocalmodifier("range"13"alpha""replace"0.60);
      
emitter.addlocalmodifier("range"03"zoom""add"0.50.25);
      
emitter.addlocalmodifier("range"00.5"speed""replace"84);
      
emitter.addlocalmodifier("range"0.53"speed""replace"41.5);
      
emitter.addlocalmodifier("once"00"spin""replace"24);
    }
  }

  else if ( 
this.on == 1)
  {
    
hideImg200);
    
this.on 0;
  }
}

function 
onTimeOut() {
  if (
this.on == 1)
  {
    
withfindImg200)) {
      if (
player.dir == 0)
      {
        
player.x-0.5;
        
player.y+1;
        
layer 2;
        
emitter.particle.angle pi*3/2;
      }
      
      if (
player.dir == 1)
      {
        
player.x+1;
        
player.y+0.3;
        
layer 2;
        
emitter.particle.angle 0;
      }
      
      if (
player.dir == 2)
      {
        
player.x-0.3;
        
player.y-0.5;
        
layer 0;
        
emitter.particle.angle pi/2;
      }
      
      if (
player.dir == 3)
      {
        
player.x-2;
        
player.y+0.3;
        
layer 2;
        
emitter.particle.angle pi;
      }
    }
  }
  
  
setTimer0.05);


Just press D to use it ;]

Here's a vid of what it does.

Twinny 07-24-2007 04:56 PM

Quote:

Originally Posted by Angel_Light (Post 1333970)
Here's a vid of what it does.

I can almost see the video! So close....

Anyhoo, the else if () isn't really necessary...it's a boolean condition. You could have also done if (this.on) {} else {}. Also, do setTimer(0) in the else part and add setTimer(0.05); to save the timeout from running when it's not needed.

Angel_Light 07-24-2007 05:01 PM

sorry the vid took some time to upload, and also because I choose not too :P

theHAWKER 07-28-2007 06:48 PM

good job xD, the video's a bit much of a file size...


All times are GMT +2. The time now is 11:09 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.