示例#1
0
    def setUp(self):
        # Here we will construct a Test World we can use to verify our systems
        # work well together.
        self.player = Player()
        self.g = Graphics()
        self.sim = Simulation()
        self.sun = SunMoon()

        # Build Test World
        self.worldmap = WorldMap(0, 0, 2, 2)
        self.worldmap.SetMapTile(0, 0,
                                 MapTile('00', 'ohoh', [MapTileTag.FOREST]))
        self.worldmap.SetMapTile(0, 1,
                                 MapTile('01', 'oh one', [MapTileTag.FOREST]))
        self.worldmap.SetMapTile(1, 0, MapTile('10', 'ten',
                                               [MapTileTag.FOREST]))
        self.worldmap.SetMapTile(1, 1,
                                 MapTile('11', 'eleven', [MapTileTag.FOREST]))

        self.worldmap.AddItemAt(0, 1, 'Test Item')

        # Create Test NPC
        self.worldmap.AddNPCAt(1, 0, 'roger')
        self.worldmap.AddNPCAt(1, 0, 'bob')

        self.game = MyGame(worldmap=self.worldmap,
                           sim=self.sim,
                           player1=self.player,
                           graphics=self.g,
                           sun=self.sun)