Beispiel #1
0
def main():
    librpg.init()
    graphics_config.config(screen_width=480, screen_height=320)
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    get_context_stack().stack_model(BarMenu())
    get_context_stack().gameloop()
Beispiel #2
0
def main():
    librpg.init()
    graphics_config.config(screen_width=480, screen_height=320)
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    get_context_stack().stack_model(BarMenu())
    get_context_stack().gameloop()
Beispiel #3
0
def main():
    librpg.init()

    librpg.config.graphics_config.config(screen_width=200,
                                         screen_height=200,
                                         scale=3)

    m = librpg.map.MapModel('maptest.map',
                            ('test16_lower_tileset.png',
                             'test16_lower_tileset.bnd'),
                            [('test16_upper_tileset.png',
                              'test16_upper_tileset.bnd'),
                             ('test16_upper_tileset.png',
                              'test16_upper_tileset.bnd')])

    print m

    print 'Terrain layer:'
    print m.terrain_layer

    print 'Scenario layer:'
    print m.scenario_layer

    world = librpg.world.MicroWorld(m, char_factory)
    world.initial_state(librpg.util.Position(0, 0), ['Andy'])

    print 'Starting gameloop()'
    world.gameloop()
    print 'Finished gameloop()'

    exit()
Beispiel #4
0
def main():
    librpg.init()

    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32)
    camera = librpg.camera.PartyConfinementCameraMode(50, 40)
    librpg.config.graphics_config.config(camera_mode=camera,
                                         screen_width=500,
                                         screen_height=400)
    librpg.config.game_config.config(key_up=set([K_w]),
                                     key_left=set([K_a]),
                                     key_down=set([K_s]),
                                     key_right=set([K_d]),
                                     key_action=set([K_e]),
                                     key_cancel=set([K_q]))

    m = librpg.map.MapModel('city.map',
                            (librpg.path.tileset_path('city_lower.png'),
                             librpg.path.tileset_path('city_lower.bnd')),
                            [(librpg.path.tileset_path('city_upper.png'),
                              librpg.path.tileset_path('city_upper.bnd'))])
    m.set_music('park_1.ogg')

    world = librpg.world.MicroWorld(m, char_factory)
    world.initial_state(librpg.util.Position(10, 10), ['Andy'])
    world.gameloop()

    exit()
Beispiel #5
0
def main():
    librpg.init()
    librpg.config.graphics_config.config(tile_size=16, object_height=32, object_width=24)

    game_config.config(fps=40)
    world = librpg.world.MicroWorld(ObjectTestMap(), char_factory)
    world.initial_state(Position(8, 8), ["Andy"])
    world.gameloop()

    exit()
Beispiel #6
0
def main():
    librpg.init('Object Test')
    librpg.config.graphics_config.config(tile_size=32, object_height=32,
                                         object_width=32)

    world = MicroWorld(ObjectTestMap(), char_factory)
    world.initial_state(Position(0, 0), ['Andy'])
    world.gameloop()

    exit()
Beispiel #7
0
def main():
    librpg.init('Boulder Test')
    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32,
                                         scale=1.7)

    world = librpg.world.MicroWorld(BoulderMaze(), char_factory)
    world.initial_state(position=Position(4, 9), chars=['Andy'])
    world.gameloop()
    exit()
Beispiel #8
0
def main():
    librpg.init('Boulder Test')
    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32,
                                         scale=1.7)

    world = librpg.world.MicroWorld(BoulderMaze(), char_factory)
    world.initial_state(position=Position(4, 9),
                         chars=['Andy'])
    world.gameloop()
    exit()
Beispiel #9
0
def main():
    librpg.init()
    librpg.config.graphics_config.config(tile_size=16,
                                         object_height=32,
                                         object_width=24)

    game_config.config(fps=40)
    world = librpg.world.MicroWorld(ObjectTestMap(), char_factory)
    world.initial_state(Position(8, 8), ['Andy'])
    world.gameloop()

    exit()
Beispiel #10
0
def main():
    librpg.init()
    config()

    lower_files = (librpg.path.tileset_path('city_lower.png'),
                   librpg.path.tileset_path('city_lower.bnd'))
    upper_files = [(librpg.path.tileset_path('world_upper.png'),
                    librpg.path.tileset_path('world_upper.bnd'))]
    m = librpg.map.MapModel('maptest32.map', lower_files, upper_files)


    print 'Starting gameloop()'
    world = librpg.world.MicroWorld(m, char_factory)
    world.initial_state(librpg.util.Position(0, 0), ['Andy'])
    world.gameloop()
    print 'Finished gameloop()'

    exit()
Beispiel #11
0
def main():
    librpg.init()

    # Config graphics
    librpg.config.graphics_config.config(tile_size=32, object_height=32,
                                         object_width=32)

    # Create world
    try:
        w = MyWorld('save')
    except IOError:
        w = MyWorld()

    # Run
    w.gameloop()

    # Terminate
    exit()
Beispiel #12
0
def main():
    librpg.init()

    # Config graphics
    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32)

    # Create world
    try:
        w = MyWorld('save')
    except IOError:
        w = MyWorld()

    # Run
    w.gameloop()

    # Terminate
    exit()
Beispiel #13
0
def main():
    librpg.init('Item Persist Test')
    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32,
                                         scale=2,
                                         screen_width=480,
                                         screen_height=320)
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    world = MicroWorld(PersistTestMap(), char_factory, party_factory)
    if SAVE_FILE in os.listdir('.'):
        world.load_state(SAVE_FILE)
    else:
        world.initial_state(Position(4, 3),
                             chars=['Andy', 'Brenda', 'Charles', 'Dylan'],
                             party_capacity=3,
                             party=['Andy'])
    world.gameloop()
    exit()
Beispiel #14
0
def main():
    librpg.init('Item Persist Test')
    librpg.config.graphics_config.config(tile_size=32,
                                         object_height=32,
                                         object_width=32,
                                         scale=2,
                                         screen_width=480,
                                         screen_height=320)
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    world = MicroWorld(PersistTestMap(), char_factory, party_factory)
    if SAVE_FILE in os.listdir('.'):
        world.load_state(SAVE_FILE)
    else:
        world.initial_state(Position(4, 3),
                            chars=['Andy', 'Brenda', 'Charles', 'Dylan'],
                            party_capacity=3,
                            party=['Andy'])
    world.gameloop()
    exit()
Beispiel #15
0
def main():
    librpg.init()
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    get_context_stack().stack_model(TestMenu())
    get_context_stack().gameloop()
Beispiel #16
0
def main():
    librpg.init()
    librpg.config.menu_config.config(theme=ClassicMenuTheme())

    get_context_stack().stack_model(TestMenu())
    get_context_stack().gameloop()