pkulev / xoinvader

Python space game in terminal
http://mmap.me
MIT License
12 stars 1 forks source link

Real-time bound update period checks in `animation.py` #42

Closed alex-eg closed 4 years ago

alex-eg commented 7 years ago

And maybe in other places too. Measuring real time in things like animation or status update can cause problems, since it's a major side effect, which we can't turn off. So we can't implement things like pause, because we can't stop global timer. Also we can't change animation speed just by altering timer threshold.

Current alternative is presented in the background module, which counts number of times update function was called. This is stub implementation, however.

We should really think about how to decouple Timer and real time measuring. However, real time measurements of course should be resent somewhere, but ideally there should be only one place, both logically and in sense of source code, where this happens.

pkulev commented 7 years ago

This is not only about animations. We need single game clock and all timers should be synchronized with it.

pkulev commented 4 years ago

Fixed in https://github.com/pkulev/xoinvader/commit/5bb304742332627220adc58d962180abbe11e84b