view world.py @ 119:2399a8c3da0c

Modified EquipmentSlot to display an image instead of a text. Added EquipmentGui class, which handles the equipment slots of the player screen. An EquipmentGui instance will be created in the InventoryGUI constructor. The initializeInventory method of the Hud class supplies the players inventory and equipment to the InventoryGUI constructor.
author KarstenBock@gmx.net
date Wed, 05 Oct 2011 11:04:39 +0200
parents aed2e094e0c7
children 79d6b17b80a3
line wrap: on
line source

from parpg.bGrease.world import *
from parpg.bGrease.component import Component

from parpg.mode import FifeMode
from parpg import components

class World(FifeMode, BaseWorld):

    def __init__(self):
        FifeMode.__init__(self)
        BaseWorld.__init__(self)
        
    def configure(self):
        """Configure the game world's components, systems and renderers"""
        for name, component in components.components.iteritems():
            setattr(self.components, name, component)
    
    def pump(self, dt):
        for component in self.components:
            if hasattr(component, "step"):
                component.step(dt)
        for system in self.systems:
            if hasattr(system, "step"):
                system.step(dt)