Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2012-08-24 23:10:02 (GMT)
committer Manuel Kaufmann <humitos@gmail.com>2012-08-25 15:42:34 (GMT)
commit90e47b15a1741834c8850bc7d8afdd7b5dd2a32c (patch)
treeda027b245a44700d9118d96024807d78a37dcd3a
parent4f8b5ed4dac8e6e2288b1276b33c63c4f5f4b251 (diff)
Always show the hole into the screenHEADmaster
Sometimes the hole appears out of the screen or not all of it is shown, this patch corrects this bug. Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org>
-rwxr-xr-xgame.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/game.py b/game.py
index 225e69e..08dab45 100755
--- a/game.py
+++ b/game.py
@@ -191,8 +191,8 @@ class TiltGame(object):
# Success! Restart
self._ball.set_position(*self._level.get_ball_start())
x, y = self._screen.get_size()
- self._level.set_hole(random.randint(0 ,x),
- random.randint(0, y))
+ self._level.set_hole(random.randint(0, x - BALL_SIZE),
+ random.randint(0, y - BALL_SIZE))
if self._level.is_on_ground(self._ball.get_position()):
vx = int(x * self.accelerometer.acceleration)