like i know roughly how i'm going to poll for gamepad inputs once a frame, but i'm just having a hard time wrapping my mind around how to do anything useful with that
this is a me problem, i'll have to figure something out
actually i guess i can "fake" synchronous code if, instead of having gamepad polling act as like a clock that ticks everything else (this is what i was thinking of and it's hard if it's even possible) i just have my main loop run once a frame and poll for gamepad input as part of it
@monorail yes with the caveat that with javascript generally you want to separate logic "frames" (which you run with setTimeout every N milliseconds) and rendering "frames" (which you run with requestAnimationFrame) [if applicable]
logic code can/should check input as a part of that
@monorail generally when i do games stuff in JS i have:
- event listeners, which write to a object which tracks input states
- logic loop, which reads input states and read/writes game state
- rendering loop, which reads (but does not write!!) game state and updates the page