View Single Post
  #6  
Old 01-21-2008, 05:45 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
Quote:
Originally Posted by Toxen View Post
Well try to change the key pressed part to this,

function onKeyPressed()
{
if (keydown2(getkeycode("s"),true))
{
if (this.active)
{
if (this.overheat = !100)
{
//shoot functions.. havent gotten that far..
this.overheat +=1;
}
}
}
}
Why would you do this? Simply

PHP Code:
function onKeyPressedcodekey )
{
  if ( 
key == "s" )
  {
    if ( 
this.active )
    {
       
// etc
    
}
  }

No need for keydown2 except to tell if something is held down; the onKeyPressed event tells you the key.
__________________
Reply With Quote