Mercurial > rinkhals
comparison gamelib/animal.py @ 415:8f012ef1f64f
Start of ability to serialize game state.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 21 Nov 2009 12:55:08 +0000 |
parents | 9096c237928c |
children | d110d55c8449 |
comparison
equal
deleted
inserted
replaced
414:9096c237928c | 415:8f012ef1f64f |
---|---|
9 import tiles | 9 import tiles |
10 from misc import Position | 10 from misc import Position |
11 import sound | 11 import sound |
12 import equipment | 12 import equipment |
13 import animations | 13 import animations |
14 | 14 import serializer |
15 class Animal(Sprite): | 15 |
16 class Animal(Sprite, serializer.Simplifiable): | |
16 """Base class for animals""" | 17 """Base class for animals""" |
17 | 18 |
18 STEALTH = 0 | 19 STEALTH = 0 |
19 VISION_BONUS = 0 | 20 VISION_BONUS = 0 |
20 VISION_RANGE_PENALTY = 10 | 21 VISION_RANGE_PENALTY = 10 |
22 | |
23 SIMPLIFY = [ | |
24 'pos', | |
25 'equipment', | |
26 'accoutrements', | |
27 'abode', | |
28 'facing', | |
29 ] | |
21 | 30 |
22 def __init__(self, image_left, image_right, tile_pos): | 31 def __init__(self, image_left, image_right, tile_pos): |
23 # Create the animal somewhere far off screen | 32 # Create the animal somewhere far off screen |
24 Sprite.__init__(self, image_left, (-1000, -1000)) | 33 Sprite.__init__(self, image_left, (-1000, -1000)) |
25 self._image_left = image_left | 34 self._image_left = image_left |