Hello TDC.
Im having a problem with some movement in a game.
I need a way to make an event that occour when the user releases a certain key.
I only know theres an event when the user presses the key, but theres no event for when the user releases the key again.
I could ofcourse negate the key press so when the key is not pressed, but i need the event to only occour once everytime the user releases the key.
I think Construct does it much more easily You could try something like this:
Let's say you're pressing X.
On press X:
Set flag 1 on.
(Negate) On press X AND Flag 1 is ON:
Set Flag 1 OFF.
(The event that happens when you release the key)
Not sure if that works, but you could try.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Yah make sure you use the "Upon Pressing" for the first part, and (Negate) "Repeat While Pressing" for the second part. That would have caused it to malfunction otherwise.
Think of it like this. The Upon Pressing X event will activate only for a single frame when it is pressed, whereas Repeat While Pressing X will activate every single frame the key is held down, including the first one. If you negate the Upon Pressing X event, it will every OTHER frame than the one you pressed the key, and if you negate the Repeat one, it will activate every frame the key is *not* held down.
Thanks alot everyone. I didnt get it to work exactly that way, but found another way of doing it
Btw its for my MMORPG project, which seems to be going pretty well already.
Loginscreen is done, and now all the movement is done. Its very online-trafic efficient so i can have a huge amount of clients connected simultaneously and walking around chatting with eachother