Пример #1
0
 def init_game():
     game = GameEngine()
     game.put_player(1, 0)
     game.put_box(4, 6)
     game.put_box(4, 7)
     game.add_goal(1, 3)
     game.add_goal(9, 9)
     game.build_wall(2, 2, 1, 3)
     game.build_wall(0, 4, 3, 1)
     game.build_wall(5, 3, 2, 1)
     game.build_wall(4, 2, 1, 2)
     game.build_wall(4, 0, 1, 1)
     return game
Пример #2
0
from game_engine import Game

game = Game()
game.put_player(1, 0)
game.put_box(4, 6)
game.put_box(4, 7)
game.add_goal(1, 3)
game.add_goal(9, 9)
game.build_wall(2, 2, 1, 3)
game.build_wall(0, 4, 3, 1)
game.build_wall(4, 4, 3, 1)

while not game.win():
    print(game.board)
    move = input()

    if move == 'w':
        game.up()

    if move == 's':
        game.down()

    if move == 'a':
        game.left()

    if move == 'd':
        game.right()
print(game.board)