Code: Select all
while(true) do
if (btn(❎)) then
sfx(30)
return
end
end
Code: Select all
while(true) do
if (btn(❎)) then
sfx(30)
return
end
end
So, maybe there are some ways to do that, but they will be from "hack" category...love.keyboard, love.mouse, and love.touch modules have several restrictions and therefore can only be used in the main thread.
Oh, thanks for that! I've expected something like this.Sasha264 wrote: ↑Tue Jan 10, 2023 9:09 pm About separate thread scanning keyboard: Love have some multi-thread support https://love2d.org/wiki/love.thread, but it is rather poor. And the wiki says that:So, maybe there are some ways to do that, but they will be from "hack" category...love.keyboard, love.mouse, and love.touch modules have several restrictions and therefore can only be used in the main thread.
I understand that Love and Picolove (PICO8 emulator) itself are great products with thought out architectures where infinite loop in main game thread just not expected and never should be used. So maybe there just one way to fix the problem - is to fix the PICO game itselfLove already have some kind of internal main loop inside https://love2d.org/wiki/love.run, which is hidden by default, but is still here. And that loop is carefully developed and already have important things (keyboard reaction included) embedded. So it looks like a bad idea to add some another infinite loop in your game. At least not in 95% of cases. That PICO-8 emulator did that ?
Yep! I've had high hopes it's possible to fix Love2D or emulator to avoid fixing the games ("the cartridges") itself, but do not see the easy way to achieve that now.BrotSagtMist wrote: ↑Tue Jan 10, 2023 9:19 pm You will need to put keyboard scanning inside this loop on your own.
see love.run
essentially you just need to copy the event pump and call parts.
I might fix my local game code easy peasy.
Absolutely!My main goal is to fix emulator, not the game itself.
Users browsing this forum: Ahrefs [Bot] and 3 guests