comparison world.py @ 38:b30a72c41f90

Added components to the World class
author KarstenBock@gmx.net
date Mon, 05 Sep 2011 14:46:43 +0200
parents 708a6f651c31
children ff3e395abf91
comparison
equal deleted inserted replaced
37:59ea103917ae 38:b30a72c41f90
1 from parpg.grease.world import * 1 from parpg.grease.world import *
2
2 from parpg.mode import FifeMode 3 from parpg.mode import FifeMode
4 from parpg import components
3 5
4 class World(FifeMode, BaseWorld): 6 class World(FifeMode, BaseWorld):
5 7
6 def __init__(self): 8 def __init__(self):
7 FifeMode.__init__(self) 9 FifeMode.__init__(self)
8 BaseWorld.__init__(self) 10 BaseWorld.__init__(self)
11
12 def configure(self):
13 """Configure the game world's components, systems and renderers"""
14 self.components.behaviour = components.Behavior()
15 self.components.characterstats = components.CharacterStatistics()
16 self.components.containable = components.Containable()
17 self.components.container = components.Container()
18 self.components.description = components.Description()
19 self.components.dialog = components.Dialog()
20 self.components.fifeagent = components.FifeAgent()
21 self.components.lockable = components.Lockable()
22 self.components.usable = components.Usable()
9 23
10 def pump(self, dt): 24 def pump(self, dt):
11 for component in self.components: 25 for component in self.components:
12 if hasattr(component, "step"): 26 if hasattr(component, "step"):
13 component.step(dt) 27 component.step(dt)