elif level == 'Easy':

    objects = [choice(GAME_OBJECTS)() for i in range(7)]
    enemies = [choice(ENEMIES)() for i in range(4)]

    objects += enemies

x, y = randint(1, cave_x), randint(1, cave_y)
char = CHARACTERS[race](name, x, y)
char.show_stats()

player_x, player_y = char.get_coords()

game_map = GameMap(cave_x, cave_y, objects)
game_map.put_char(char, *char.get_coords())

print(f'Traps: {move.traps_list}')
print(f'Enemy: {move.enemy_list}')
print(f'Heal: {move.heal_list}')
print(f'Exit: {move.exit_list}')
print(f'Player:[{player_x}, {player_y}]')

while True:
    print(game_map)

    step = input('Move? w,a,s,d\n')

    game_map.clear_step(player_x, player_y)

    player_x, player_y = move.steps(step, player_x, player_y, cave_x, cave_y)
Exemple #2
0
    enemies = [choice(ENEMIES)() for i in range(3)]
    objects += enemies
elif level == 'Easy':
    objects = [choice(GAME_OBJECTS)() for i in range(2)]
    enemies = [choice(ENEMIES)() for i in range(1)]
    objects += enemies

x, y = randint(0, 5), randint(0, 5)
char = CHARACTERS[race](name, x, y)
char.show_stats()

map_dim_x = 8
map_dim_y = 8

game_map = GameMap(map_dim_x, map_dim_y, objects)
game_map.put_char(char, *char.get_coords())
count_enemy = game_map.get_count_enemy()
print(f'Left {count_enemy} enemies')
while True:

    print(game_map)
    old_x, old_y = char.get_coords()

    charkey = input('Move? left (l), right (r), up (u), down (d)')
    move_x, move_y = move_one_step(charkey)

    char.move_char(move_x, move_y)
    new_x, new_y = char.get_coords()

    if new_x < 0 or \
            new_y < 0 or \
Exemple #3
0
    objects = [choice(GAME_OBJECTS)() for i in range(5)]
    objects += [choice(ENEMIES)() for i in range(4)]
    objects += [choice(FINAL)() for i in range(1)]
elif level == 'Easy':
    objects = [choice(GAME_OBJECTS)() for i in range(5)]
    objects += [choice(ENEMIES)() for i in range(3)]
    objects += [choice(FINAL)() for i in range(2)]

x, y = randint(0, 4), randint(0, 4)
char = CHARACTERS[race](name, x, y)
char.show_stats()

map_measure = int(input('Choose the measure of map? '))

game_map = GameMap(map_measure, map_measure, objects)
game_map.put_char(char, *char.get_coords())

while True:

    print(game_map)

    step = input('Move? ')

    if step == 'up':
        move = (-1, 0)
    elif step == 'down':
        move = (1, 0)
    elif step == 'left':
        move = (0, -1)
    elif step == 'right':
        move = (0, 1)