When I started off creating games on python or other applications, I was taught to use a while loop, in which the game would continuously register for events and react accordingly.
However, before I was taught this, I applied a different method, which consists of jumping sequentially from one function to the next. I really like this method, because it seems quite straightforward to me, but I was wondering whether there might be some issues with it, since no one seems to be using this.
Here an example:
def funcA(x):
x = input("Give a True or False value for x: ")
#We create a menu of possible actions:
if x:
funcB():
else:
funcC():
def funcB():
#Some sort of job is completed here:
#----------
#And then we return back to the menu:
funcA(x)
def funcC():
#Some other job is completed here:
#----------
#And then we return back to the menu:
funcA(x)
My suspicion is that python puts into memory each level within a function, and with this method, running it continuously would end up in an infinite memory requirement.