a new cmd

Post your Feature Requests here...
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA
Contact:

a new cmd

Post by darksmaster923 » Sun May 06, 2007 5:56 am

self.key_released not pressed but released. it could really help in my game
Herp derp.

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay » Sun May 06, 2007 10:43 am

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"...
Everyone can see the difficult, but only the wise can see the simple.
-----

Post Reply