View Single Post
  #12  
Old 12-08-2001, 06:50 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
Re: Re: Whats wrong with this

NPC Code:

if (playerenters) {
toweapons *SpaceWars;
}

if (created&&isweapon) {
disabledefmovement;
disableweapons;
disableselectweapons;
timeout=.05;
}

/* moved everything to the block above
this text, since it would just timeout on
the in-level script and not the weapon
script. */

if (timeout) {
if (keydown(1)&&!onwall(playerx-0.5,playery)) {
playerx-=0.5;
playerdir = 0;
}
if (keydown(3)&&!onwall(playerx+0.5,playery)) {
playerx+=0.5;
playerdir = 0;
}
if (keydown(4)) {
this.mult=0;
}
while (this.mult<18) {
putexplosion 1,playerx,56-this.mult;
this.mult+=2;
sleep .1;
}
timeout = .05;
}


Still kinda ugly, but easy to read. I still think you should have figured that out yourself by troubleshooting...the original problem was just a missing ! in front of the onwall() functions.
Reply With Quote