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)