Disabled actor rotation for speed
[flail.git] / flail.py
blob9c10a357016a1db6fafc5932fe1313858906c583
1 from __future__ import division
2 from config import config
3 from client import client
4 from pyglet.gl.gl import *
8 import pyglet
12 def main (argv):
13 from game import game
15 # default configuration settings
16 defaults = { 'window.fullscreen' : 'true',
17 'action.jump' : 'W',
18 'action.drop' : 'S',
19 'action.left' : 'A',
20 'action.right' : 'D' }
22 cfg = config ('data/config.xml', defaults)
23 win = game (cfg)
25 glEnable (GL_BLEND)
26 glEnable (GL_TEXTURE_2D)
27 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
29 # begin cloud
30 win.lvl.load ('data/grammar.lvl')
31 win.lvl.view.size.x = win.width / 2
32 win.lvl.view.size.y = win.height / 2
33 win.push_handlers (win.lvl.keys)
34 from egg import egg
35 from ball import ball
36 from geom import vector
37 from client import client
38 dude = egg (win.lvl)
39 dude.tex = pyglet.image.load ('data/egg.png').texture
40 dude.oval.pos = vector (500, 385)
41 dude.oval.size = vector (12, 15)
42 dude.vel = vector (-10, 0)
43 thing = ball (win.lvl, dude)
44 thing.oval.pos = vector (300, 400)
45 win.lvl.actors.append (dude)
46 win.lvl.actors.append (thing)
47 win.lvl.player = dude
48 cli = client (win.lvl, dude)
49 cli.start ()
50 # end cloud
52 @win.event
53 def on_draw ():
54 win.lvl.render ()
55 win.show_overlay ()
57 def update (dt):
58 win.lvl.update (dt)
60 pyglet.clock.schedule (update)
61 pyglet.app.run ()
62 cfg.save ()
64 cli.running = False
68 if __name__ == '__main__':
69 from sys import argv
70 main (argv)