Beispiel #1
0
    def __init__(self):
        self.fpslabel = pyglet.text.Label('',
                                          font_name='Times New Roman',
                                          font_size=12,
                                          x=render.window.width - 50,
                                          y=render.window.height - 12 - 3)

        self.tilemap = tilemap.TileMap(config.TEST_MAP)
        self.tilegrid = tilegrid.TileGrid(config.WINDOW_RESOLUTION,
                                          self.tilemap)
        render.renderstack.add(self.fpslabel)
        render.renderstack.add(self.tilegrid)
Beispiel #2
0
    def __init__(self):
        self.tilemap = tilemap.TileMap()
        self.tilemap.filepath = '/home/prestonh/Desktop/Programming/gamedev/shoot/shoot/resources/rooms/simple/simple.tmp'
        self.tilemap.Load2()

        self.display = display_component.DisplayComponent(b'/home/prestonh/Desktop/Programming/gamedev/shoot/shoot/resources/rooms/simple/simple.png')
        self.display.source_rect = sdl2.SDL_Rect(0, 0, 640, 480)
        self.display.z = 0

        self.shape = shape_component.ShapeComponent()
        self.shape.w = 640
        self.shape.h = 480
def generate(Map, level, nRooms=50):
    if level == 0:
        # create base
        Map.cellular_automata(FUNGUS,
                              FLOOR,
                              8, (
                                  -1,
                                  -1,
                                  -1,
                                  -1,
                                  0,
                                  1,
                                  1,
                                  1,
                                  1,
                              ),
                              simultaneous=True)
        # create rooms
    elif level == 1:
        #unfinished code...
        floor = tilemap.TileMap(ROOMW, ROOMH)
        hyper = tilemap.TileMap(ROOMW, ROOMH)
        for rr in range(nRooms):
            build_random_room(hyper)
Beispiel #4
0
    def create(self):
        bg = tm.TileMap(self.map_path, self.controller)
        self.controller.scene.add(bg, z=-1)

        for s in self.sheep:
            self.controller.sheeps.append(s)
            self.controller.scene.add(s)
        self.controller.total_sheep = len(self.sheep)

        self.controller.dog = []
        for e, d in enumerate(self.dogs):
            self.controller.dog.append(d)
            self.controller.dog[e].player_number = e
            self.controller.scene.add(d)

        for a in self.threats:
            pass
Beispiel #5
0
    def __init__(self):
        self.tilemap = tilemap.TileMap()
        self.tilemap.filepath = '/home/prestonh/Desktop/Programming/gamedev/shoot/shoot/resources/rooms/prototype_2/prototype_2.tmp'
        self.tilemap.Load3()

        # Song file
        self.sound = sound_component.SoundComponent()
        song_file_path = '/home/prestonh/Desktop/Programming/gamedev/shoot/shoot/resources/rooms/prototype_2/prototype_2.wav'
        self.sound.sound_queue.append(sound_component.AmbientSound(song_file_path))

        self.display = display_component.DisplayComponent(b'/home/prestonh/Desktop/Programming/gamedev/shoot/shoot/resources/rooms/prototype_2/prototype_2.png')
        self.display.source_rect = sdl2.SDL_Rect(0, 0, 2880, 1760)
        self.display.z = 0

        self.shape = shape_component.ShapeComponent()
        self.shape.w = 2880
        self.shape.h = 1760
Beispiel #6
0
def create_map():
    Ref.Map=tilemap.TileMap(ROOMW,ROOMH)
    Ref.Map.init_specialGrids()
    Ref.Map.init_terrain()
Beispiel #7
0
 def __init__(self):
     self.map = tilemap.TileMap()