View Single Post
  #4  
Old 05-29-2012, 07:47 PM
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
You're confusing variables/methods/values and would probably benefit from reading a starting guide.

You will have to do the same thing for the arrow keys, either using their 'code' value, or ideally using keydown (so that it uses the key configured by players in the options).

This is obviously not going to work:

PHP Code:
this.(keydown(3)) 
because keydown(3) gets evaluated into either 1 or 0, and then it's checking the value of either this.1 or this.0, which doesn't make any sense.

Instead you'll want to keep track of when the direction keys are pressed.
__________________
Reply With Quote