I've been trying to figure how to set up pause and unpause function on my game that allows me to use space to pause and then unpause as well. I've been struggling mostly because I'm so new to coding. I feel like I'm not understanding the true and false or rather the binds. The code is as follows:
import random
from tkinter import *
def paused(window):
PAUSED = False
while True:
pause(window)
canvas.create_text(canvas.winfo_width() / 2, canvas.winfo_height() / 2, font=('consolas', 70), text="PAUSED", fill="white", tag='paused')
window.keys.bind("<space>", paused)
if not paused:
paused = False
window.update()