Mercurial > rinkhals
comparison 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 |
comparison
equal
deleted
inserted
replaced
426:d34be925b9fc | 427:e89a1afe4e84 |
---|---|
3 import random | 3 import random |
4 | 4 |
5 from pygame.locals import KEYDOWN, K_ESCAPE | 5 from pygame.locals import KEYDOWN, K_ESCAPE |
6 from pgu import gui | 6 from pgu import gui |
7 | 7 |
8 class Position(object): | 8 import serializer |
9 | |
10 class Position(serializer.Simplifiable): | |
9 """2D position / vector""" | 11 """2D position / vector""" |
12 | |
13 SIMPLIFY = ['x', 'y', 'z'] | |
10 | 14 |
11 def __init__(self, x, y, z=0): | 15 def __init__(self, x, y, z=0): |
12 self.x = x | 16 self.x = x |
13 self.y = y | 17 self.y = y |
14 self.z = z | 18 self.z = z |