diff gamelib/misc.py @ 427:e89a1afe4e84

Make Position simplifiable. Override unsimplify for animals to update their image after recreating.
author Simon Cross <hodgestar@gmail.com>
date Sat, 21 Nov 2009 16:17:48 +0000
parents 2d0ff46118e2
children 129de5883524
line wrap: on
line diff
--- a/gamelib/misc.py	Sat Nov 21 15:58:54 2009 +0000
+++ b/gamelib/misc.py	Sat Nov 21 16:17:48 2009 +0000
@@ -5,9 +5,13 @@
 from pygame.locals import KEYDOWN, K_ESCAPE
 from pgu import gui
 
-class Position(object):
+import serializer
+
+class Position(serializer.Simplifiable):
     """2D position / vector"""
 
+    SIMPLIFY = ['x', 'y', 'z']
+
     def __init__(self, x, y, z=0):
         self.x = x
         self.y = y