How can you go out of a function in python??
Look at this program
For example:
import pygame, sys
from pygame.locals import *
pygame.init()
level = 0
x = 0
def eg_func():
global x
x = 10
def eg_func2():
global x
x = 2
while True:
if level == 0:
eg_func()
if playing == True:
eg_func2()
print(x)
pygame.quit()
quit
So, how can I do that eg_func()
stops but level keeps being 0
and not changing global -> because in my program I can't change it?
Thanks for everything, probably it's a simple thing.