-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
42 lines (32 loc) · 907 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python2
import pygame
import game
import os
import controller
from threading import Thread
import sys
import pygame.camera
ON_ARCADE = os.getlogin() == 'capra'
def main():
pygame.init()
pygame.display.set_caption("L'ETS Play")
pygame.camera.init()
pygame.font.init()
if ON_ARCADE:
ctrl = controller.USB()
border = pygame.display.set_mode((game.Game.SCREEN_WIDTH, game.Game.SCREEN_HEIGHT), pygame.FULLSCREEN) #, pygame.FULLSCREEN)
else:
ctrl = controller.Keyboard()
border = pygame.display.set_mode((game.Game.SCREEN_WIDTH, game.Game.SCREEN_HEIGHT))
ctrl.start()
try:
while True:
app = game.Game(border)
print("Start game")
app.run()
print("Game stop")
except KeyboardInterrupt:
pygame.quit()
sys.exit(0)
if __name__ == "__main__":
main()