diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-06-16 13:53:26 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-06-16 15:26:39 (GMT) |
commit | 87573c6f21032a28f0acdb40b0859738e6f2d989 (patch) | |
tree | 6f5f3f1acc88c913fdc27cf7464b8ca7c647ace9 | |
parent | bea841eb9a3ed0e85bc6be26f2581d34f290279a (diff) |
Increase minimal time to read the accelerometer, to avoid loose drawings
-rw-r--r-- | game.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -293,9 +293,10 @@ class MazeGame(Gtk.DrawingArea): if self._ebook_mode_detector.get_ebook_mode() and \ player.elapsed is None: + # next_read depend on inclination next_read = 200 - int(100 * (float(value - TRIGGER) / 500)) - if next_read < 20: - next_read = 20 + # minimal time is 50 ms + next_read = max(50, next_read) self._start_accelerometer(delay=next_read) debug_msg = debug_msg + "next_read %s" % next_read |