K4ugummi / carambolage

A game written in Rust.
GNU General Public License v3.0
38 stars 5 forks source link

Input is not captured during sleep #39

Closed K4ugummi closed 6 years ago

K4ugummi commented 6 years ago

Describe the bug Modify the delta time sleep so input events are processed.

To Reproduce Steps to reproduce the behavior:

  1. Open the /game/mod.rs
  2. Go to the line where the frame limiter is constructed.
  3. Set the frame limit to 10 fps
  4. Run the game and realize, that the input is not processed during the sleep time.

Expected behavior Input sould be processed everythime.

Screenshots

Environment (please complete the following information):

Additional context Add any other context about the problem here.

K4ugummi commented 6 years ago

Maybe fix with something like this:

while self.frame_limiter.stop() {
    self.process_input(..);
    sleep(1);
}