ikbensiep / lofigame

A 2D game without canvas, only html vibes. SVG is used not only for artwork but to annotate as much world/level data as possible, simply by drawing shapes accoring to a few rules. Exploring wether it's worthwile to make it into an open source 2d world game engine.
https://ikbensiep.github.io/lofigame/
GNU General Public License v3.0
1 stars 0 forks source link

Keyboard input bug #26

Open ikbensiep opened 9 months ago

ikbensiep commented 9 months ago

Sometimes, an input release may not be captured which you'll notice by the car sometimes going straight when you wanted to turn, or it may keep turning when you've clearly released the arrow key(s).

It is my hunch that this is because we're capturing key up and down events and handling those by storing pressed keys in an array. Because of the possibility of frame drop, we might sometimes not capture a keydown or keyup event.

Is there a solution where we capture input on a separate thread or something?