I'm trying to create a snake game where you can choose which character you want to be. I have the default character in my game set to be goomba. There is a "Characters" screen and from there, I want to be able to choose which character I want to be with buttons. I have tried to do
elif currentchar == "mario":
charU = pygame.image.load('mario up')
charD = pygame.image.load('mario down')
charL = pygame.image.load('mario left')
charR = pygame.image.load('mario right')
gameLoop()
but it comes up with "NameError: name 'currentchar' is not defined". I don't know what to do if I define it. The full code can be found here: https://pastebin.com/7gtvdf8E Any help is appreciated. Thank you in advance.
EDIT: oops I was tinkering a bit before pasting and forgot to change it. Here is the real pastebin https://pastebin.com/sYNHqPyD EDIT: When i press "mario", nothing happens