Mercurial > touhou
comparison pytouhou/game/element.py @ 440:b9d2db93972f
Add a base Element class for every object in pytouhou.game.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 30 Aug 2013 14:16:08 +0200 |
parents | |
children | d1f0bb0b7a17 |
comparison
equal
deleted
inserted
replaced
439:723a3e67a223 | 440:b9d2db93972f |
---|---|
1 # -*- encoding: utf-8 -*- | |
2 ## | |
3 ## Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | |
4 ## | |
5 ## This program is free software; you can redistribute it and/or modify | |
6 ## it under the terms of the GNU General Public License as published | |
7 ## by the Free Software Foundation; version 3 only. | |
8 ## | |
9 ## This program is distributed in the hope that it will be useful, | |
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 ## GNU General Public License for more details. | |
13 ## | |
14 | |
15 class Element(object): | |
16 def __init__(self, pos=None): | |
17 self.sprite = None | |
18 self.anmrunner = None | |
19 self.removed = False | |
20 self.objects = [self] | |
21 | |
22 if pos is not None: | |
23 self.x, self.y = pos |