View Single Post
  #9  
Old 03-27-2001, 07:22 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
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...
Reply With Quote