Mercurial > mamba
annotate mamba/snake.py @ 79:f602a8c3d173
Fix bugs. Stubbed out get_entry for now.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sun, 11 Sep 2011 18:33:17 +0200 |
parents | b1019923cb12 |
children | 7ce2d2d8381a |
rev | line source |
---|---|
78 | 1 """The player snake object.""" |
2 | |
79
f602a8c3d173
Fix bugs. Stubbed out get_entry for now.
Simon Cross <hodgestar@gmail.com>
parents:
78
diff
changeset
|
3 from mamba.sprites import BaseSprite |
78 | 4 |
5 | |
6 class Snake(BaseSprite): | |
7 | |
8 UP, DOWN, LEFT, RIGHT = range(4) | |
9 | |
10 def __init__(self, tile_pos, orientation): | |
11 super(Snake, self).__init__("snake/" | |
79
f602a8c3d173
Fix bugs. Stubbed out get_entry for now.
Simon Cross <hodgestar@gmail.com>
parents:
78
diff
changeset
|
12 "snake-head-mouth-open-r") |
78 | 13 self.set_tile_pos(tile_pos) |
14 self.set_orientation(orientation) | |
15 | |
16 def set_orientation(self, orientation): | |
17 self._orientation = orientation | |
18 print ["UP", "DOWN", "LEFT", "RIGHT"][orientation] | |
19 # TODO: update image |