2018-10-23 16:27:27 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2018-12-13 10:57:22 +01:00
|
|
|
import contextlib
|
|
|
|
with contextlib.redirect_stdout(None):
|
|
|
|
import pygame
|
2018-10-23 16:27:27 +02:00
|
|
|
|
|
|
|
from map import Map
|
|
|
|
from game import Game
|
|
|
|
from window import Window
|
2018-12-13 11:17:35 +01:00
|
|
|
from player import Player, Direction, Decision, KeyboardDecision
|
2018-10-23 16:27:27 +02:00
|
|
|
|
|
|
|
def main():
|
|
|
|
pygame.init()
|
|
|
|
|
|
|
|
width = 40
|
|
|
|
height = 40
|
|
|
|
|
|
|
|
game = Game(width, height, [
|
2018-12-13 11:17:35 +01:00
|
|
|
Player(1, 0, (255, 0, 0), KeyboardDecision(Direction.RIGHT)),
|
|
|
|
Player(7, 0, (0, 255, 0), Decision(Direction.RIGHT)),
|
2018-10-23 16:27:27 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
window = Window(game, 10)
|
|
|
|
|
|
|
|
game.main_loop(window)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
|