Closed lordmauve closed 4 years ago
Added something in 5d297a3. Needs a couple more tests, and also documentation, but looks very promising.
I think it would also be useful to be able to await an animation, eg.
await animate(bullet, pos=(400, 400))
await animate(bullet, scale=20)
bullet.delete()
You can now await animations.
It occurred to me that simply basing this on clock events might be a mistake. There are other things that you might want to await, including input.
With a unified clock/input loop you could write
msg = show_msg("game over, press any key to restart")
await key_down()
msg.delete()
game.reset()
It should be possible to use coroutines in games. This could be a feature of the
clock
:or