View Single Post
  #15  
Old 10-11-2007, 09:43 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Angel_Light View Post
[PHP]Example :
PHP Code:
function onKeyPressed() {
  if (
params[1] == "d") {
    
setShootParams(1this.xthis.y); //[1] being the unique ID to the projectile
    
shootplayer.xplayer.yplayer.zgetangle(vecxplayer.dir), vecyplayer.y)), 00"idle"null); //you only used the angle once, no need for the var
  
}
}

function 
onActionProjectile2(idhitxhity) {
  
//Upon adding the ID, you can do things like
  
switch(temp.id) {
    case 
1this.dropExplosion(2, {temp.hitxtemp.hity}); break;
    case 
2
      for (
temp.0temp.10temp.i++) {
        
this.dropExplosion(2, {random(temp.hitx 5temp.hitx 5random(temp.hity 5temp.hity 5});
      }
    break;
  }
}
  
//Could also make it dropExplosion(explosion type, bomb type, pos) [to support the other putexplosion]
function dropExplosion(typepos) {
  
putexplosion(temp.typetemp.pos[0], temp.pos[1]);

edit
__________________
Reply With Quote