Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bounce.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-10-01 11:10:01 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-10-01 11:10:01 (GMT)
commit6ca3311bb4490deeab3bf6d958b09475b57d2898 (patch)
treed02a97786226a3e1d91e482ef2b42f200673af24 /bounce.py
parentcfc6d1b7e4ccb2880cdcfd202538b80414716a42 (diff)
adjusted position of mark on bar
Diffstat (limited to 'bounce.py')
-rw-r--r--bounce.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bounce.py b/bounce.py
index 5677580..d003d22 100644
--- a/bounce.py
+++ b/bounce.py
@@ -210,7 +210,7 @@ class Bounce():
self.ball.move_relative((self.dx, -5))
else:
self.ball.move_relative((0, 5))
- if self.ball.get_xy()[1] < 1: # get_xy() returns (x, y)
+ if self.ball.get_xy()[1] < 1:
# hit the top
self.reached_the_top = True
gobject.timeout_add(50, self._move_ball)
@@ -234,7 +234,7 @@ class Bounce():
""" Test to see if we estimated correctly """
delta = self.ball.rect[2] / 4
x = self.ball.get_xy()[0] + self.ball.rect[2] / 2
- f = self.fraction * self.width
+ f = self.ball.rect[2] / 2 + self.fraction * self.bar.rect[2]
if x > f - delta and x < f + delta:
smiley = Sprite(self.sprites, 0, 0, self.smiley_graphic)
x = int(self.count * 25 % self.width)
@@ -243,7 +243,7 @@ class Bounce():
smiley.set_layer(-1)
self.count += 1
- self.mark.move((int(f), self.height - self.mark.rect[3]))
+ self.mark.move((int(f), self.bar.rect[1] - self.mark.rect[3]))
def _keypress_cb(self, area, event):
""" Keypress: moving the slides with the arrow keys """