[SOLVED] Process on_key_press during blocking scripts?

Started by tor.brandt, Tue 08/11/2016 10:19:59

Previous topic - Next topic

monkey0506

Quote from: tor.brandt on Sun 13/11/2016 12:01:24I tried putting your first code (from your post 10 Nov, 5.49) into my global script, and that resulted in the behaviour I described (i.e. if Space was held down, pause was toggled repeatedly, instead of just once). Here I'm not talking about how the script works, but about the actual experience when playing the game.

I don't think the problem as you describe it has anything to do with my code, so much as it has to do with the way that on_key_press works. So, to clarify, are you holding down the Space key during a blocking event, or during non-blocking event(s) when this happens?

tor.brandt

Quote from: monkey0506 on Sun 13/11/2016 12:26:13
I don't think the problem as you describe it has anything to do with my code, so much as it has to do with the way that on_key_press works. So, to clarify, are you holding down the Space key during a blocking event, or during non-blocking event(s) when this happens?

To be sure, I was not saying there is a problem with your code, just asking if that's how it was supposed to work, or if I had done something wrong? :smiley:
I have removed it from my script again, but I think the repeating toggle happened both during blocked and non-blocked...

Anyway, I now downloaded and imported your KeyPressAlways module, and that seems to do exactly what I was looking for, which is basically just the possibility of implementing a Lucas style pause function. So yeah, KeyPressAlways is perfect for my need, thanks!

Cassiebsg

Uhm? Why would you want a pause key that you need to keep pressing to keep the game paused?
That sounds very weird behaviour for a pause button. I would expect press key = pause game, press key again = unpause game. ???
There are those who believe that life here began out there...

Crimson Wizard

I too no longer understand what is going on here :D.

tor.brandt

Quote from: Cassiebsg on Sun 13/11/2016 15:13:07
Uhm? Why would you want a pause key that you need to keep pressing to keep the game paused?
That sounds very weird behaviour for a pause button. I would expect press key = pause game, press key again = unpause game. ???

Not really sure who you're asking, as I kinda also lost a bit track :smiley:

But if it's me, I don't want that, I want a perfectly normal press key = pause function like in the Lucas classics.
And that's what KeyPressAlways does (at least the way I use it).

SMF spam blocked by CleanTalk