
09-10-2001, 12:16 PM
|
|
Registered User
|
Join Date: Aug 2001
Posts: 378
|
|
ok..
|
// NPC made by Josey Hunt
if (playerenters){toweapons Leaps test;}
if(weaponfired){
if(playerdir=3){
this.x1=playerx+.5;
this.x2=playerx+.5;
this.y1=playery-5;
this.y2=playery+7;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=3;
this.dirx2=3;
this.diry1=2;
this.diry2=0;
this.firedir=3;
}
if(playerdir=2){
this.x1=playerx+7;
this.x2=playerx-6;
this.y1=playery+.5;
this.y2=playery+.5;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=3;
this.diry1=2;
this.diry2=2;
this.firedir=2;
}
if(playerdir=1){
this.x1=playerx+.5;
this.x2=playerx+.5;
this.y1=playery-5;
this.y2=playery+7;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=1;
this.diry1=2;
this.diry2=0;
this.firedir=1;
}
if(playerdir=0){
this.x1=playerx+7;
this.x2=playerx-6;
this.y1=playery+.5;
this.y2=playery+.5;
this.originalx=playerx;
this.originaly=playery;
this.dirx1=1;
this.dirx2=3;
this.diry1=0;
this.diry2=0;
this.firedir=0;
}
timeout=.1;
playersprite=24;
this.firing=1;
}
if(timeout&&this.firing==1){
putleaps 3,this.x1,this.y1;
putleaps 3,this.x2,this.y2;
if(this.dirx1==1){this.x1--}
if(this.dirx2==1){this.x2--}
if(this.dirx1==3){this.x1++}
if(this.dirx2==3){this.x2++}
if(this.diry1==0){this.y1--}
if(this.diry2==0){this.y2--}
if(this.diry1==2){this.y1++}
if(this.diry2==2){this.y2++}
if(this.firedir==3||this.firedir==1){
if(this.diry1=0&&this.y1<=this.originaly-5){this.diry1=2}
if(this.diry1=2&&this.y1>=this.originaly+7){this.d iry1=0}
if(this.diry2=0&&this.y2<=this.originaly-5){this.diry2=2}
if(this.diry2=2&&this.y2>=this.originaly+7){this.d iry2=0}
}
if(this.firedir==0||this.firedir==2){
if(this.dirx1=1&&this.x1<=this.originalx-6){this.dirx1=3}
if(this.dirx1=3&&this.x1>=this.originalx+7){this.d irx1=1}
if(this.dirx2=1&&this.x2<=this.originalx-6){this.dirx2=3}
if(this.dirx2=3&&this.x2>=this.originalx+7){this.d irx2=1}
}
timeout=.1;
}
if(this.x1>=64||this.x1<=0){this.firing=0}
if(this.x2>=64||this.x2<=0){this.firing=0}
if(this.y1>=64||this.y1<=0){this.firing=0}
if(this.y2>=64||this.y2<=0){this.firing=0}
but you'll still have to put in the hurt compu and hurtplayer commands in this. it isnt a straight line, but it can be easily modified. =P |
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
|
|
|
|