Closed Gadgetoid closed 3 years ago
start()
while True: tick()
start() enters a blocking main loop that dispatches update/draw calls to the Python functions.
When quit() is called, start() will drop out of the loop, clean up the cached update/draw pointers and reset "tick".
quit()
Your scripts should now look like this:
def update(tick): pass def draw(tick): pass start()
tick() and _reset() are included for posterity, but these may both be deprecated since _reset() happens implicitly when quit() is called.
tick()
_reset()
gc.collect()
:thinking: Flipping, at least, should be a pretty constant time operation, can we stick a larger sleep value in here?
SCREEN
gc_heap
New API changes
start()
to breakstart()
to examples in place ofwhile True: tick()
start()
enters a blocking main loop that dispatches update/draw calls to the Python functions.When
quit()
is called,start()
will drop out of the loop, clean up the cached update/draw pointers and reset "tick".Your scripts should now look like this:
tick()
and_reset()
are included for posterity, but these may both be deprecated since_reset()
happens implicitly whenquit()
is called.Stats & GC
gc.collect()
in the main loop:thinking: Flipping, at least, should be a pretty constant time operation, can we stick a larger sleep value in here?
OC/Buffer
SCREEN
buffer back to C exclusively, MPY reduces thegc_heap
to accommodate this change