Mercurial > parpg-source
annotate mode.py @ 30:ec5a55266f6a
Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
author | KarstenBock@gmx.net |
---|---|
date | Mon, 05 Sep 2011 13:02:05 +0200 |
parents | 86799b61e5dc |
children | ff3e395abf91 |
rev | line source |
---|---|
5 | 1 |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
2 from parpg.grease.mode import * |
5 | 3 import abc |
4 | |
17
7b31de1dc964
FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents:
10
diff
changeset
|
5 class FifeManager(BaseManager): |
5 | 6 |
17
7b31de1dc964
FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents:
10
diff
changeset
|
7 def __init__(self): |
5 | 8 self.modes = [] |
9 | |
10 def _pump(self): | |
11 if self.current_mode: | |
29
86799b61e5dc
Fixed bug that the game crashes in the main menu after a few seconds.
KarstenBock@gmx.net
parents:
17
diff
changeset
|
12 self.current_mode.pump(self.current_mode.engine.getTimeManager().getTimeDelta() / 1000.0) |
5 | 13 |
14 class FifeMode(BaseMode): | |
15 | |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
16 def __init__(self): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
17 BaseMode.__init__(self) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
18 |
5 | 19 @abc.abstractmethod |
20 def pump(self, dt): | |
21 """Performs actions every frame""" |