1
I tried it in various ways, using local variables and assigning them the two methods but it didn’t work, does anyone know where I went wrong?
def game(init, loop, frame_rate=60):
from time import sleep
stop = False
time_per_frame = 1 / frame_rate
frame = 1
init()
while True:
if stop == True:
break
sleep(time_per_frame)
frame += 1
if frame == frame_rate:
frame = 1
loop()
def method1():
print('Testando', end='')
def method2():
print('.', end='')
game(method1(), method2())
ERROR:
Traceback (most recent call last):
File "C:\Users\Lucas\Downloads\teste.py", line 28, in <module>
game(method1(), method2())
File "C:\Users\Lucas\Downloads\teste.py", line 8, in game
init()
TypeError: 'NoneType' object is not callable