Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2012-10-10 19:39:52 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-10-10 19:39:52 (GMT)
commit646dbd252787515222ad09943000ce02bdee1e2d (patch)
tree7f49e420f655ec9eeff8b15f586b8d7b9b9cebfe
parentd2d4f1bd35512fc45a0cc36058d7d82e85106911 (diff)
Add a class Head
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rwxr-xr-x[-rw-r--r--]game.py21
-rw-r--r--images/head.pngbin0 -> 6995 bytes
2 files changed, 16 insertions, 5 deletions
diff --git a/game.py b/game.py
index efcfdf8..e5961c5 100644..100755
--- a/game.py
+++ b/game.py
@@ -1,16 +1,27 @@
#!/usr/bin/env python
import glucosa
+import gtk
-class Snake(glucosa.GameArea):
+class Game(glucosa.GameArea):
def __init__(self):
glucosa.GameArea.__init__(self)
- image = glucosa.Image('images/head.png')
- head = glucosa.Sprite(image, 100, 100, 18, 18, scale=2)
- self.add_sprite(head)
-
+ head = Head()
self.add_sprite(head)
+
+class Head(glucosa.Sprite):
+ def __init__(self):
+ image = glucosa.Image('images/head.png')
+ glucosa.Sprite.__init__(self, image, 0, 0)
+
+ pass
+
+if __name__ == '__main__':
+ w = gtk.Window()
+ w.add(Game())
+ w.show_all()
+ gtk.main()
diff --git a/images/head.png b/images/head.png
new file mode 100644
index 0000000..1eea793
--- /dev/null
+++ b/images/head.png
Binary files differ