<div class="gmail_quote">On Tue, Jun 9, 2009 at 10:31 PM, Essah Mitges <span dir="ltr"><<a href="mailto:e_mitges@hotmail.com">e_mitges@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>i don't know if its what i am searching that is wrong but what i am trying to do is<br>link my game i made in pygame to my pygame menu the menu has 4 button classes on it one foe instruction one to quit one for high scores and one to start the game<br>
the 3 other buttons work all but the one to start the game this is basicly the menu i want people to see first the main menu</div></blockquote><div><br></div><div>So why don't you put your menu in your game? </div><div>
<br></div><div>Consider the following:</div><div><br></div><div># Lamegame.py - probably the lamest game ever!</div><div><br></div><div>print "Welcome to Lame Game!"</div><div>raw_input("Please type something and press enter: ")</div>
<div>print "You win!"</div><div><br></div><div>So there's a game. Now let's add a menu:</div><div><br></div><div># lamegameimproved.py - the lamest game, now with a menu!</div><div><br></div><div>import sys</div>
<div><br></div><div>print "Welcome to Lame Game!"</div><div>print "\nMenu:\n"</div><div>print "(Q)uit"</div><div>print "(P)lay"</div><div>choice = raw_input("Your Choice? (P or Q): ")</div>
<div><br></div><div>if choice.lower() == 'q':</div><div> sys.exit(0)</div><div>elif choice.lower() == 'p':</div><div> # add original code here</div><div><br></div><div>See? Quite simple. Even with pygame it shouldn't be a whole lot more complex than that. And that's really the most simple example I could think of and it's really not very good. For instance you could put the original code into a "game" function and then call it if the choice was P.</div>
<div><br></div><div>HTH,</div><div>Wayne</div></div>