diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-08-24 23:10:02 (GMT) |
---|---|---|
committer | Manuel Kaufmann <humitos@gmail.com> | 2012-08-25 15:42:34 (GMT) |
commit | 90e47b15a1741834c8850bc7d8afdd7b5dd2a32c (patch) | |
tree | da027b245a44700d9118d96024807d78a37dcd3a | |
parent | 4f8b5ed4dac8e6e2288b1276b33c63c4f5f4b251 (diff) |
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-x | game.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |