Page 1 of 1

a new cmd

Posted: Sun May 06, 2007 5:56 am
by darksmaster923
self.key_released not pressed but released. it could really help in my game

Posted: Sun May 06, 2007 10:43 am
by Jay
I don't get the sense of this, because it's already possible with scripts.

This:

Code: Select all

if(self.key_released)
{
   (Code goes here)
}
is the same as this:

Code: Select all

KEY_RELEASED_XX [false]
if(self.key_pressed=XX)
{
   KEY_RELEASED_XX=false;
}
else
{
   if(KEY_RELEASED_XX=false)
   {
      (Code goes here)
      KEY_RELEASED_XX=true;
   }
}

The key state will stay 'released' until it is pressed again, but that doesn't affect your script code, it is only executed once. If you wanted, you could make it even more detailed with states like "pressed", "just released", "released", "just pressed"...