-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (31 loc) · 1008 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
#!/usr/bin/env python
import os
import webapp2
from template_manager import render_template
# Load javascript files from these folders in this order. Ends with main program
game_files = [
"ThirdParty/Box2dWeb-2.1.a.3.min.js",
"ThirdParty/easeljs-0.6.1.min.js",
"ThirdParty/preloadjs-0.3.1.min.js",
"ThirdParty/tweenjs-0.4.1.min.js",
"Game/main.js",
]
game_canvas = [
"canvas",
# ,"debug"
]
class MainHandler(webapp2.RequestHandler):
def get(self):
# Information front page
self.response.out.write(os.path.join(os.path.dirname(__file__), "main.py"))
self.redirect("/gamemain")
class GameHandler(webapp2.RequestHandler):
def get(self):
# Game canvas page
title = "Aelik: Fleet Runner"
self.response.out.write(render_template("base.html", title=title, scripts=game_files, canvas=game_canvas))
app = webapp2.WSGIApplication([
('/', MainHandler),
# ('/g_login', GLogin)
('/gamemain', GameHandler)
], debug=True)