Permalink
Browse files

fixing catchers

  • Loading branch information...
1 parent 9086001 commit 3c282ed41bd44b2a58e3ea713487ad7fddb9a989 @andrewsmedina committed with flavioribeiro Aug 26, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 jailbreakerz/game.py
View
@@ -37,7 +37,7 @@ def load_sprites(self):
self.add(self.prison)
self.kombi = Sprite('media/imgs/kombi.png')
- self.kombi.position = 700,90
+ self.kombi.position = 790,90
self.add(self.kombi)
@@ -59,10 +59,10 @@ def fall(self):
class Catcher(Layer):
-
+
is_event_handler = True
- MOVEMENT_RATE = 50 # Constant used to move sprite
+ MOVEMENT_RATE = 100 # Constant used to move sprite
def __init__(self, *args, **kwargs):
super(Catcher, self).__init__()
@@ -71,9 +71,9 @@ def __init__(self, *args, **kwargs):
self.add(self.catcher)
def on_key_press(self, key, modifiers):
- if key == pyglet.window.key.LEFT:
+ if key == pyglet.window.key.LEFT and self.catcher.position[0] > 300:
self.catcher.position = self.catcher.position[0] - self.MOVEMENT_RATE, self.catcher.position[1]
- elif key == pyglet.window.key.RIGHT:
+ elif key == pyglet.window.key.RIGHT and self.catcher.position[0] < 500:
self.catcher.position = self.catcher.position[0] + self.MOVEMENT_RATE, self.catcher.position[1]
if __name__ == '__main__':

0 comments on commit 3c282ed

Please sign in to comment.