-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
First way
class Game(object):
def __init__(self):
"setup"
def is_done(self):
pass
def tick(self, dt):
pass
while True:
game = Game()
while not game.is_done():
game.tick()
sleep(1)More complex, more flexible way.
def game():
not_done = True
"setup"
while not_done:
"do some stuff"
yield
while True:
for _ in game:
sleep(1)The second one can be nested, like you can have states in states (easier in python 3).
I would suggest the first way.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels