feat: make it web/pygbag deploy compatible
This commit is contained in:
7
main.py
7
main.py
@@ -3,17 +3,18 @@
|
||||
https://strategywiki.org/wiki/Tetris/Getting_Started
|
||||
https://tetris.com/play-tetris
|
||||
'''
|
||||
|
||||
import asyncio
|
||||
from tetri5.game import Game
|
||||
from tetri5.util import ConfigurationManager
|
||||
|
||||
def main() -> None:
|
||||
async def run_game():
|
||||
ConfigurationManager.init()
|
||||
Game.init()
|
||||
|
||||
while True:
|
||||
Game.update()
|
||||
Game.draw()
|
||||
await asyncio.sleep(0) # yield control to browser
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
asyncio.run(run_game())
|
||||
|
||||
Reference in New Issue
Block a user