def GOMenu():
font1 = pygame.font.Font(None, 130)
font2 = pygame.font.Font(None, 50)
text2 = font1.render("GAME OVER", True, (255,0,0))
text3 = font2.render(str(Score), True, (255,255,255))
text4 = font2.render("Final Score:", True, (255,255,255))
screen = pygame.display.set_mode((800,600),0,32)
screen.blit(text2, (120,200))
screen.blit(text4, (250, 300))
screen.blit(text3, (500, 300))
pygame.display.update()
pygame.time.delay(5000)
class Name(wx.Frame):
def __init__(self,parent,id):
box=wx.TextEntryDialog(None,'What is your name?','High Score Names','Enter Name Here')#Gives you a dialog box, the second parameter is the quesion, the third is the title of the box, the fourth is the default text#
if box.ShowModal()==wx.ID_OK: #So if the user clicks cancel then it wont store in the variable otherwise if you didnt you would get it stored#
HighScoreName=box.GetValue()#So if its ok then it will store it in answer
global HighScores
HighScores = {'Paul':9000000}
HighScores[HighScoreName] = Score
print HighScores
if __name__=='__main__':
app=wx.PySimpleApp()
frame=Name(parent=None,id=-1)
app.MainLoop()
def ScoreMenu():
font = pygame.font.Font(None, 50)
text = font.render(HighScores, True, (255,255,255))
screen = pygame.display.set_mode((800,600),0,32)
pygame.display.update()
So I have a GOMenu function which is the screen you see when you die. Then I used wxpython to make a window so I can get the players name and store it with the persons score in a dictionary. Now in my main menu I have "Start Game, Scores<< When the person goes to that scores i want it to show a list of all the high scores in the past 30 days which I know how to acomplish that but my problem is I cannot get the data from the Class which you have to make with wxpython into this function. I want to get the HighScores dicitonary from GOMenu() so I can use it for my display of scores. Thanks! Ill be happy to answer any questions to help solve this problem.

New Topic/Question
Reply



MultiQuote





|