View Single Post
  #5  
Old 01-19-2002, 06:58 AM
ArchOwl ArchOwl is offline
KHERRUPTED SHROOM
ArchOwl's Avatar
Join Date: Aug 2001
Location: SOMEWHERE, DAMNIT
Posts: 2,464
ArchOwl is on a distinguished road
Send a message via AIM to ArchOwl Send a message via Yahoo to ArchOwl
Quote:
Originally posted by TDO2000
u need to do showimg and hitplayer/hitobjects or just a triggeraction to attack (I had the best results with triggeraction)

something like:
NPC Code:

if(weaponfired && this.active==0){
this.xy={playerx,playery};
this.dir=playerdir;
this.distance=0;
this.maxdis=15;
this.active=1;
timeout=.05;
}

if(timeout){
if(this.distance < this.maxdis){
this.distance++;
this.xy[0]+=vecx(this.dir);
this.xy[1]+=vecy(this.dir);
showimg 1,yourprojectile.gif,this.xy[0],this.xy[1];
hitobjects 1,this.xy[0],this.xy[1];
}
else {this.active=0;}
if(this.active==1){timeout=.05;}
}



could be shorter but this should show u how to do it...
hmm, see the things im going to make are basically fireball clones except for the size/width of the blast (they are guns)
__________________

DDR Videos.
More DDR Videos.