diff --git a/__pycache__/ascii.cpython-311.pyc b/__pycache__/ascii.cpython-311.pyc index 98560fb..8a31108 100644 Binary files a/__pycache__/ascii.cpython-311.pyc and b/__pycache__/ascii.cpython-311.pyc differ diff --git a/physics/__pycache__/parabelfunc.cpython-311.pyc b/physics/__pycache__/parabelfunc.cpython-311.pyc index 5d3403b..d3f4d4b 100644 Binary files a/physics/__pycache__/parabelfunc.cpython-311.pyc and b/physics/__pycache__/parabelfunc.cpython-311.pyc differ diff --git a/tengine/__pycache__/main.cpython-311.pyc b/tengine/__pycache__/main.cpython-311.pyc index a955f03..ef88ba7 100644 Binary files a/tengine/__pycache__/main.cpython-311.pyc and b/tengine/__pycache__/main.cpython-311.pyc differ diff --git a/tengine/main.py b/tengine/main.py index 00ccb5b..8f4a532 100644 --- a/tengine/main.py +++ b/tengine/main.py @@ -2,6 +2,9 @@ from os import get_terminal_size tx,ty = get_terminal_size().columns ,get_terminal_size().lines-2 +def clear(): + print('\033c', end='') + class tengine(): def __init__(self) -> None: self.screen = [[' ' for _ in range(tx)] for _ in range(ty+2)] @@ -24,7 +27,6 @@ class tengine(): back += line[:tx] + "\n" return back.lstrip('\n').rstrip('\n') - def set_char(self, character, position): self.screen[position[0]][position[1]] = character @@ -38,8 +40,7 @@ class tengine(): pposition = [pposition[0], pposition[1] + 1] self.screen[pposition[0]][pposition[1]] = zeichen - def clear(self): - print('\033c', end='') + def draw_border(self, border_char='+'): for i in range(len(self.screen)): diff --git a/v1.py b/v1.py index eb8390a..e11e296 100644 --- a/v1.py +++ b/v1.py @@ -1,17 +1,9 @@ #!/usr/bin/python3 import os -from forgejo.cowyeet_terminal.tengine.main import ty,tx,clear +from tengine.main import ty,tx,clear from pynput import keyboard from time import sleep - -#def clear(): -# if os.name == "nt": -# os.system("cls") -# else: -# os.system("clear") - - def on_press(key): global running if key == keyboard.Key.space: diff --git a/v2.py b/v2.py index dd44a8c..21d6370 100644 --- a/v2.py +++ b/v2.py @@ -44,7 +44,7 @@ if __name__ == "__main__" and running == True: scene.set_block(ascii.start_screen_text,[ty,int(tx/2-5)]) scene.print() sleep(0.2) - scene.clear() + clear() if key_space == True: while not key_space == False: startscreen = False @@ -52,7 +52,7 @@ if __name__ == "__main__" and running == True: scene.viereck([ty,int(tx/2-4)],11,1," ") scene.print() sleep(0.2) - scene.clear() + clear() if key_space == True: while not key_space == False: startscreen = False @@ -62,7 +62,7 @@ if __name__ == "__main__" and running == True: cows = "🐵🐒🦍🦧🐕🐯🦝🐩🐅🐴🐎🦄🦌🐗🐂🐃🐄🐪🐫🦙🦒🐹🦘🦡🐧🕊️ 🦅🦆🦉🐍🦎🐊🦜🦚🦩🐲🐉🦕" cowlistlength = len(cows) cow = "#" #cows[random.randint(0, cowlistlength - 1)] - scene.clear() + clear() #scene[ty][tx] ### 2zeichen kuhh mach probleme while running == True: wobl = "-" * (tx - wobble_pos - 5) @@ -95,18 +95,18 @@ if __name__ == "__main__" and running == True: wobble_way = "right" sleep(wobble_speed) - scene.clear() + clear() if key_space == True: break points_prozent = int((points/txhalb)*100) - scene.clear() + clear() for a in range(int(points*2)-2): scene.set_block("-"*a+cow,[0,0])#🐄️ scene.set_block(str(points_prozent)+"%",[1,int(tx/2-2)]) scene.print() sleep(0.01) - scene.clear() + clear() scene.print() exit()