
03-27-2001, 07:56 PM
|
|
Retired Oldbie
|
 |
Join Date: Mar 2001
Posts: 3,084
|
|
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. |
__________________
|
|
|
|