View Single Post
  #10  
Old 01-23-2008, 05:26 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by PrinceOfKenshin View Post
I'm kinda new to gs2, why would you use a temp variable for that?
Because there's no point in taking up memory when this doesn't need to be stored past this function.

If you knew GS1, it's basically equivelant to a variable with no prefix, which is lost after the function is over.

temp.k just told me true/false the key is pressed. I could have eliminated this and made it into an if statement; this was just easier and simpler.

this.isKeyPressed tells me if LAST time around it was pressed, so I can tell if it is being held down, or touched once. This is so you can have modes such as single, automatic, etc.
__________________
Reply With Quote