Darthfett / A-Priori-Physics-System

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.
3 stars 0 forks source link

At low FPS, input events can be missed #8

Closed Darthfett closed 12 years ago

Darthfett commented 12 years ago

Because the event loop only checks input at a constant FPS, if that FPS is very low, you can press a key and release it, without the event getting seen.

Darthfett commented 12 years ago

Refactoring the event loop to not use pygame.time.Clock.tick could be a good chance to implement pausing (issue #9).

Darthfett commented 12 years ago

Re-opening the issue, as technically only 'q' and 'escape' key press events get seen outside of the FPS loop. This is because more refactoring will be needed to get a 'game time' for key-press/release/held/not-held events.

Because of the time speed update in commit b605949, negative time is possible (Not sure if it will be supported for rewind-like effects, but currently: why not?), which would mean ignoring new events for as long as speed is negative/zero, and recording positive key press/release times. Key events are supposed to be handled by controllable objects, but should I be having to deal with multiple key-press toggling in-between frames?

Darthfett commented 12 years ago

negative time is possible (Not sure if it will be supported for rewind-like effects, but currently: why not?)

YAGNI. Support only time speeds >= 0. If you need it later, refactor and add it in.