예제 #1
0
def savegame():
    global game_state

    log('savegame function')

    save_and_load.encode_and_save(username, game_state)

    toplevel = Toplevel()
    msg = Message(toplevel, text="Game saved!")
    msg.pack()
예제 #2
0
def savegame():
    global game_state

    log('savegame function')

    save_and_load.encode_and_save(username, game_state)

    toplevel = Toplevel()
    msg = Message(toplevel, text="Game saved!")
    msg.pack()
예제 #3
0
    def createaccount(login_frame, uname):
        global game_state, username
        username = uname
        login_frame.destroy()
        game_state = game_model.GameState()

        try:
            save_and_load.encode_and_save(username, game_state)
            main()
        except IOError as ioe:
            log(ioe)
예제 #4
0
    def createaccount(login_frame, uname):
        global game_state, username
        username = uname
        login_frame.destroy()
        game_state = game_model.GameState()

        try:
            save_and_load.encode_and_save(username, game_state)
            main()
        except IOError as ioe:
            log(ioe)
예제 #5
0
def resetgame():
    log('resetgame invoked')
    toplevel = Toplevel()
    msg = Label(toplevel, text="Are you sure you want to reset?")
    msg.grid(row=0, column=0, columnspan=2)

    yesbutton = Button(toplevel, text="Yes", command=lambda: save_and_load.encode_and_save(username, game_state))
    yesbutton.grid(row=1, column=0)
    nobutton = Button(toplevel, text="No", command=toplevel.destroy)
    nobutton.grid(row=1, column=1)
예제 #6
0
def resetgame():
    log('resetgame invoked')
    toplevel = Toplevel()
    msg = Label(toplevel, text="Are you sure you want to reset?")
    msg.grid(row=0, column=0, columnspan=2)

    yesbutton = Button(
        toplevel,
        text="Yes",
        command=lambda: save_and_load.encode_and_save(username, game_state))
    yesbutton.grid(row=1, column=0)
    nobutton = Button(toplevel, text="No", command=toplevel.destroy)
    nobutton.grid(row=1, column=1)