tophat2d / tophat

:tophat: a 2d game library for Umka
https://tophat2d.dev
BSD 3-Clause "New" or "Revised" License
73 stars 5 forks source link

Playground: Moving rectangle demo not working #199

Closed vtereshkov closed 4 months ago

vtereshkov commented 4 months ago

The rectangle doesn't respond to keyboard input.

skejeton commented 4 months ago

Weird

skejeton commented 4 months ago

Which demo do you mean? The one in samples/rect allows you to move with the mouse.

vtereshkov commented 4 months ago

I mean the web playground.

skejeton commented 4 months ago

Ah

skejeton commented 4 months ago

Seems to be a Sokol issue, if you use isPressedRepeatc instead of isPressedc it will work, seems to send "repeat" keycodes all the time.

skejeton commented 4 months ago

Or rather an emscripten issue (https://github.com/emscripten-core/emscripten/pull/22201), I can't see why it would behave this way, It seems that it sends key_repeat all the time, instead of just after the first time, which registers it incorrectly. I will make a temporary hot fix for this until they fix emscripten, but I'm still not sure where is the issue coming from here.

vtereshkov commented 4 months ago

Can you reproduce it with a local build? I couldn't. Everything was OK when I built it and ran on localhost.

skejeton commented 4 months ago

Can you reproduce it with a local build? I couldn't. Everything was OK when I built it and ran on localhost.

Yeah, it seems to be related to some recent changes in emscripten - https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#3162---070224 I specified a version that should work.

vtereshkov commented 4 months ago

I see. I have 3.1.56 on my laptop.

skejeton commented 4 months ago

Downgrading worked.