From 28154248e53c4668b8e45c498113ddd9eb33db7c Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sun, 5 Nov 2023 18:06:20 +0100 Subject: [PATCH] Deleted old code. --- cowyeet.py | 119 +---------------------------------------------------- 1 file changed, 1 insertion(+), 118 deletions(-) diff --git a/cowyeet.py b/cowyeet.py index e0f3803..44f7725 100644 --- a/cowyeet.py +++ b/cowyeet.py @@ -1,118 +1 @@ -#!/usr/bin/python3 - -import os -from time import sleep -from pynput import keyboard - - -FPS = 60 -BLA_SPEED = 1 - -tx, ty = os.get_terminal_size().columns, os.get_terminal_size().lines -half_tx = round(tx / 2) -bla_pos = 1 -bla_back = False -stop = None -yeet = None -yeet_dist = None - - -def clear(): - if os.name == "nt": - os.system("cls") - else: - os.system("clear") - - -def on_press(key): - global stop - global yeet_dist - - try: - if key == keyboard.Key.space: - if not stop: - stop = bla_pos - - bla_dist = half_tx - bla_pos - - if bla_dist < 0: - bla_dist = 0 - bla_dist - - yeet_dist = tx - 2 - bla_dist * 2 - 10 - - except AttributeError: - # print('special key {0} pressed'.format(key)) - pass - - -def on_release(key): - # print('{0} released'.format(key)) - - if key == keyboard.Key.esc: - # Stop listener - return False - - -def move_bla(): - global bla_pos - global bla_back - - print(" " * (half_tx - 1) + "↓") - print(" " * (bla_pos - 1) + "#") - - if bla_back: - bla_pos -= BLA_SPEED - - else: - bla_pos += BLA_SPEED - - if bla_pos >= tx: - bla_back = True - - elif bla_pos <= 1: - bla_back = False - - -def yeet_cow(): - global yeet - global running - - if not yeet: - yeet = 1 - - print("-" * (yeet - 1) + "🐄️") - - if yeet >= yeet_dist: - running = False - - yeet += 1 - - -def loop(): - clear() - - if not stop: - move_bla() - - else: - yeet_cow() - - sleep(1 / FPS) - - -listener = keyboard.Listener( - on_press=on_press, - on_release=on_release) - -listener.start() - - -running = True - -try: - while running: - loop() - -except KeyboardInterrupt: - clear() - print("Exit.") +#!/usr/bin/python3 \ No newline at end of file