Hi,
I've followed the tutuorials and I've made a menu class and game
class. Both work independently, but I don't know how to go from
showing the menu to playing the game.
Here's how I'm loading the menu:
__docformat__ = 'restructuredtext'
import math
import pyglet
from pyglet.window import key
from pyglet.window import mouse
import Menu
menu_class = Menu
menu_items = ['Start Game','Options','Exit']
menu = menu_class(menu_items)
window = pyglet.window.Window(800, 600)
window.clear()
@window.event
def on_draw():
window.clear()
menu.display_item(window)
@window.event
def on_key_press(symbol, modifiers):
if symbol == key.UP:
menu.move(-1)
menu.display_item(window)
if symbol == key.DOWN:
menu.move(1)
menu.display_item(window)
if symbol == key.ENTER:
print "go to game"
pyglet.app.run()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---