Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-06-16 13:53:26 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-06-16 15:26:39 (GMT)
commit87573c6f21032a28f0acdb40b0859738e6f2d989 (patch)
tree6f5f3f1acc88c913fdc27cf7464b8ca7c647ace9
parentbea841eb9a3ed0e85bc6be26f2581d34f290279a (diff)
Increase minimal time to read the accelerometer, to avoid loose drawings
-rw-r--r--game.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/game.py b/game.py
index 5ea1d89..f168ac8 100644
--- a/game.py
+++ b/game.py
@@ -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