Mercurial > parpg-core
annotate src/parpg/mode.py @ 61:23563e30da66
Added pos value to the FifeAgent component
author | KarstenBock@gmx.net |
---|---|
date | Mon, 05 Sep 2011 14:44:53 +0200 |
parents | 5e27c24acaef |
children | 96af64cf3b81 |
rev | line source |
---|---|
27 | 1 |
30
94cb5843dcbb
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
27
diff
changeset
|
2 from parpg.grease.mode import * |
27 | 3 import abc |
4 | |
39
8b3890f17f94
FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents:
32
diff
changeset
|
5 class FifeManager(BaseManager): |
27 | 6 |
39
8b3890f17f94
FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents:
32
diff
changeset
|
7 def __init__(self): |
27 | 8 self.modes = [] |
9 | |
10 def _pump(self): | |
11 if self.current_mode: | |
54
5e27c24acaef
Fixed bug that the game crashes in the main menu after a few seconds.
KarstenBock@gmx.net
parents:
39
diff
changeset
|
12 self.current_mode.pump(self.current_mode.engine.getTimeManager().getTimeDelta() / 1000.0) |
27 | 13 |
14 class FifeMode(BaseMode): | |
15 | |
30
94cb5843dcbb
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
27
diff
changeset
|
16 def __init__(self): |
94cb5843dcbb
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
27
diff
changeset
|
17 BaseMode.__init__(self) |
94cb5843dcbb
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
27
diff
changeset
|
18 |
27 | 19 @abc.abstractmethod |
20 def pump(self, dt): | |
21 """Performs actions every frame""" |