View Single Post
  #13  
Old 03-27-2001, 07:56 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by kyle0654
Actually....I think the keydown stuff (checking if keys are down) took three lines...then most of it was mathematical based on what keys were down...

Hint: Use an Array
NPC Code:

if (created) {
this.cKeyDown = {0,0,0,0,0,0,0,0,0,0,0};
timeout = .05;
}
if (timeout) {
for (this.z = 0; this.z < 11; this.z++)
this.cKeyDown[this.z] = (keydown(this.z));
}



You could also have it store how long a key has been down...
Hmm, thanks for that script I can probably use it to reduce the amountof scripting I have now in some cases.
__________________

Reply With Quote