def main_game_loop(): ##-- This is for navigating the map --## global opening, x, y if os.path.getsize('Worldmap.db') == 8192: Engine.map_builder() # while os.path.getsize('Worldmap.db') != 10000: # print('Loading...........') if opening == True: Story.intro_story(player_in_game.name) input("Press Enter to continue: ") opening = False map_info = Engine.get_tile(x, y) Screen.display(f"Location: {map_info[0][2]}") move_to = input( "Which way do you want to travel?\n\n(1): North\n(2): South\n(3): East\n(4): West\n(5): Quit\nInput a Number:> " ) ##-- NORTH = 1, SOUTH = 2, EAST = 3, & WEST = 4 if move_to == '1': ##-- UP --## if y > 0: y -= 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '2': ##-- DOWN --## if y < small: y += 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '3': ##-- RIGHT --## if x > 0: x += 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '4': ##-- LEFT --## if x < small: x -= 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '5': ##-- QUIT, I'll take this out after testing --## sys.exit()
def main_game_loop(): ##-- This is for navigating the map --## global opening, x, y, sub_x, sub_y, biome_or_subBiome biome_or_subBiome = False if os.path.getsize('Worldmap.db') == 12288: Engine.map_builder() # while os.path.getsize('Worldmap.db') != 10000: # print('Loading...........') if opening == True: Story.intro_story(player_in_game.name) input("Press Enter to continue: ") opening = False map_info = Engine.get_tile(x, y) sub_x = map_info[0][8] sub_y = map_info[0][9] Engine.update_tile(x, y, True) Screen.display(f"Location: {map_info[0][3]}") move_to = input( "Which way do you want to travel?\n\n(1): North\n(2): South\n(3): East\n(4): West\n(5): Inspect Area\n(6): Inventory\n(7): Look For Resources\nInput a Number:> " ) ##-- NORTH = 1, SOUTH = 2, EAST = 3, & WEST = 4 if move_to == '1': ##-- UP --## if y > 0: y -= 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '2': ##-- DOWN --## if y < small: y += 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '3': ##-- RIGHT --## if x > 0: x += 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '4': ##-- LEFT --## if x < small: x -= 1 encounter() else: print('NEED TO MAKE THE PLAYER TO TELEPORT TO OTHER SIDE OF MAP') pause() main_game_loop() elif move_to == '5': inspect_area(map_info[0][2]) elif move_to == '6': look_in_inventory() elif move_to == '7': get_resouces() elif move_to == 'Quit': ##-- QUIT, I'll take this out after testing --## sys.exit() else: print("Not an option.") pause() main_game_loop()