mirror of
https://github.com/quantum5/punyverse.git
synced 2025-04-24 13:11:57 -04:00
Slightly better formatting.
This commit is contained in:
parent
672b5c0462
commit
3b221e4339
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
INITIAL_WIN_HEIGHT = 540
|
INITIAL_WIN_HEIGHT = 540
|
||||||
INITIAL_WIN_WIDTH = 700
|
INITIAL_WIN_WIDTH = 700
|
||||||
WIN_TITLE = "Punyverse"
|
WIN_TITLE = 'Punyverse'
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -58,9 +58,9 @@ class Applet(pyglet.window.Window):
|
||||||
super(Applet, self).__init__(*args, **kwargs)
|
super(Applet, self).__init__(*args, **kwargs)
|
||||||
texture.init()
|
texture.init()
|
||||||
|
|
||||||
l = clock()
|
start = clock()
|
||||||
self.fps = 0
|
self.fps = 0
|
||||||
self.world = load_world("world.json")
|
self.world = load_world('world.json')
|
||||||
print 'Initializing game...'
|
print 'Initializing game...'
|
||||||
self.speed = INITIAL_SPEED
|
self.speed = INITIAL_SPEED
|
||||||
self.keys = set()
|
self.keys = set()
|
||||||
|
@ -187,9 +187,9 @@ class Applet(pyglet.window.Window):
|
||||||
glLightfv(GL_LIGHT1, GL_SPECULAR, fv4(1, 1, 1, 1))
|
glLightfv(GL_LIGHT1, GL_SPECULAR, fv4(1, 1, 1, 1))
|
||||||
|
|
||||||
print 'Loading asteroids...'
|
print 'Loading asteroids...'
|
||||||
self.asteroid_ids = [model_list(load_model(r"asteroids\01.obj"), 5, 5, 5, (0, 0, 0)),
|
self.asteroid_ids = [model_list(load_model(r'asteroids/01.obj'), 5, 5, 5, (0, 0, 0)),
|
||||||
model_list(load_model(r"asteroids\02.obj"), 5, 5, 5, (0, 0, 0)),
|
model_list(load_model(r'asteroids/02.obj'), 5, 5, 5, (0, 0, 0)),
|
||||||
model_list(load_model(r"asteroids\03.obj"), 5, 5, 5, (0, 0, 0)),
|
model_list(load_model(r'asteroids/03.obj'), 5, 5, 5, (0, 0, 0)),
|
||||||
]
|
]
|
||||||
|
|
||||||
c = self.cam
|
c = self.cam
|
||||||
|
@ -200,7 +200,7 @@ class Applet(pyglet.window.Window):
|
||||||
for entity in self.world.tracker:
|
for entity in self.world.tracker:
|
||||||
entity.update()
|
entity.update()
|
||||||
|
|
||||||
print "Loaded in %s seconds." % (clock() - l)
|
print 'Loaded in %s seconds.' % (clock() - start)
|
||||||
|
|
||||||
def set_exclusive_mouse(self, exclusive):
|
def set_exclusive_mouse(self, exclusive):
|
||||||
super(Applet, self).set_exclusive_mouse(exclusive)
|
super(Applet, self).set_exclusive_mouse(exclusive)
|
||||||
|
@ -335,7 +335,7 @@ class Applet(pyglet.window.Window):
|
||||||
glCallList(entity.corona)
|
glCallList(entity.corona)
|
||||||
glPopMatrix()
|
glPopMatrix()
|
||||||
|
|
||||||
if self.cloud and hasattr(entity, "cloudmap") and entity.cloudmap:
|
if self.cloud and hasattr(entity, 'cloudmap') and entity.cloudmap:
|
||||||
glPushMatrix()
|
glPushMatrix()
|
||||||
glEnable(GL_ALPHA_TEST)
|
glEnable(GL_ALPHA_TEST)
|
||||||
glTranslatef(*entity.location)
|
glTranslatef(*entity.location)
|
||||||
|
|
|
@ -179,11 +179,11 @@ def load_world(file):
|
||||||
(pitch, yaw, roll), **params))
|
(pitch, yaw, roll), **params))
|
||||||
|
|
||||||
for satellite, info in info.get('satellites', {}).iteritems():
|
for satellite, info in info.get('satellites', {}).iteritems():
|
||||||
print "Loading %s, satellite of %s." % (satellite, name)
|
print 'Loading %s, satellite of %s.' % (satellite, name)
|
||||||
body(satellite, info, object)
|
body(satellite, info, object)
|
||||||
|
|
||||||
for planet, info in root['bodies'].iteritems():
|
for planet, info in root['bodies'].iteritems():
|
||||||
print "Loading %s." % planet
|
print 'Loading %s.' % planet
|
||||||
body(planet, info)
|
body(planet, info)
|
||||||
|
|
||||||
for name, info in root['belts'].iteritems():
|
for name, info in root['belts'].iteritems():
|
||||||
|
|
Loading…
Reference in a new issue