From f04ffb1807e86eb8f96b03ca743db3de429f300a Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Tue, 7 Mar 2023 23:22:53 -0500 Subject: [PATCH] [+] Add velocity --- tngame/telnet.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tngame/telnet.py b/tngame/telnet.py index 1c3f5f1..b1b8135 100644 --- a/tngame/telnet.py +++ b/tngame/telnet.py @@ -29,9 +29,11 @@ COLORS = {RGB.from_hex(v) for v in { # Snow fall data structure -class Snow(NamedTuple): - x: int - y: int +class SnowParticle(NamedTuple): + x: int # x position + y: int # y position + xv: int # x velocity + yv: int # y velocity color: RGB @@ -43,7 +45,7 @@ async def shell(reader: TelnetReaderUnicode, writer: TelnetWriterUnicode): width: int x: int y: int - snow: list[Snow] + snow: list[SnowParticle] # Get the size of the terminal async def get_size() -> tuple[int, int]: