Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game.py
diff options
context:
space:
mode:
Diffstat (limited to 'game.py')
-rwxr-xr-xgame.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/game.py b/game.py
index e5961c5..625c8df 100755
--- a/game.py
+++ b/game.py
@@ -9,16 +9,23 @@ class Game(glucosa.GameArea):
def __init__(self):
glucosa.GameArea.__init__(self)
- head = Head()
+ self.events = glucosa.Events(self)
+
+ head = Head(self.events)
self.add_sprite(head)
class Head(glucosa.Sprite):
- def __init__(self):
+ def __init__(self, events):
image = glucosa.Image('images/head.png')
glucosa.Sprite.__init__(self, image, 0, 0)
- pass
+ self.events = events
+
+ self.events.connect('key-press-event', self.key_pressed)
+
+ def key_pressed(self, widget):
+ print 'ok'
if __name__ == '__main__':
w = gtk.Window()