-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (25 loc) · 965 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
import tornado.ioloop
import tornado.web
import tornado.websocket
from games.pong.pong import PongWebSocketHandler, choose_positions
from games.snake.snake import SnakeWebSocketHandler
from games.spacerush import SpaceRushWebSocketHandler
from games.tictactoe import TicTacToeWebSocketHandler
from games.flappybird import FlappyBirdWebSocketHandler
from games.arkanoid import ArkanoidWebSocketHandler
def make_app():
return tornado.web.Application([
(r"/ws/snake/", SnakeWebSocketHandler),
(r"/ws/pong/", PongWebSocketHandler),
(r"/ws/tictactoe/", TicTacToeWebSocketHandler),
(r"/ws/spacerush/", SpaceRushWebSocketHandler),
(r"/ws/flappybird/", FlappyBirdWebSocketHandler),
(r"/ws/arkanoid/", ArkanoidWebSocketHandler),
])
def run():
choose_positions()
app = make_app()
app.listen(8001)
print("Started")
tornado.ioloop.IOLoop.current().start()
run()