From 7c8e1d7dd8b7f237db232d276a38a6c02e5e6f5d Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Tue, 7 Mar 2023 23:08:37 -0500 Subject: [PATCH] [+] Async updates --- tngame/telnet.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tngame/telnet.py b/tngame/telnet.py index 93dec0e..c0c561a 100644 --- a/tngame/telnet.py +++ b/tngame/telnet.py @@ -68,6 +68,12 @@ async def shell(reader: TelnetReaderUnicode, writer: TelnetWriterUnicode): # Draw the cat print_ascii(ASCII_CAT, x, y) + # Update frame function + async def update(): + while True: + draw_cat() + await asyncio.sleep(0.1) + def run(): # Create a new event loop, start the server and wait for it to close