At the moment the grease code is in my personal code repo here:
http://code.google.com/p/caseman/
I plan to move it to either bitbucket or github though when I renew
development. There is no real issue tracker, feel free to mail bug
reports to the list for now. We'll get one once it has it's own repo.
-Casey
Thanks for the reply. The example game in the tutorial, Blasteroids,
does not work. The input and event handling is broken, which means you
can't actually control the ship. I don't know Pyglet or Grease well
enough to find the problem, but I was able to get input going by
attaching decorators and handlers directly to the window object by
following the Pyglet examples.
I'm looking forward to learning Grease; I've been looking for a
component-based Python game framework to learn from and Grease looks
really good.
-Casey
PYTHONPATH=/path/to/pyglet-1.1/:/path/to/grease-0.2/ python ./blasteroids2.py
Everything runs fine but there doesn't appear to be any key binding
done. I did a quick hack at 2am this morning just to check that
regular Pyglet event handling worked. In main(), after the "window"
object is created I added
@window.event
def on_key_press(symbol, modifiers):
if symbol == key.LEFT:
if world.system.game.player_ship.exists == true:
world.system.game.player_ship.turn(-1)
elif symbol == key.RIGHT:
if world.......
etc
Same code you've got in your KeyHandler, but thrown directly into
main() against the world.
def on_key_press(self, symbol, modifiers):
if symbol == key.LEFT:
into GameSystem and TitleScreenControls. I didn't even have to comment
out the existing decorators. All works well.
One small bug with the movement is that the ships position.angle
property only affects the thrust when you initially start thrusting.
If you turn while thrusting the new angle is not used.