Quote:
Originally Posted by Toxen
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 onKeyPressed( code, key )
{
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.