From bdd6709ba303bfd41faf8968353b2b4af37f18cb Mon Sep 17 00:00:00 2001 From: Beesquit Date: Thu, 2 Feb 2023 11:51:25 +0300 Subject: [PATCH] Add files via upload --- beta2.py | 41 +++++++++++++++++++++++++++++++++++++++++ main.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 beta2.py create mode 100644 main.py diff --git a/beta2.py b/beta2.py new file mode 100644 index 0000000..3667718 --- /dev/null +++ b/beta2.py @@ -0,0 +1,41 @@ +# imports +import keyboard as kb +import time +import random +import pygame as pg + +pg.init() + + +# variables + +sw = 960 # screen width +sh = 540 # screen height +PINK = (255, 120, 220) + +# functions + +def draw(n): + pass + +# main +screen = pg.display.set_mode([sw, sh]) # first is x. Second - y. +running = True +while running: + circlex = 0 + circley = 0 + for event in pg.event.get(): + if event.type == pg.QUIT: + running = False + if event.type == pg.MOUSEBUTTONDOWN and event.pos == (circlex, circley): + pass + screen.fill((0, 0, 0)) + + objcounter = 0 + for i in range(objcounter): + draw(i) + pg.draw.circle(screen, PINK, (random.randint(50, sw - 50), random.randint(50, sh - 50)), 50) + + pg.display.flip() + +pg.quit() diff --git a/main.py b/main.py new file mode 100644 index 0000000..29b81c8 --- /dev/null +++ b/main.py @@ -0,0 +1,34 @@ +#imports +import keyboard as kb +import time +import random + +#variables + +#functions + +def react(key): + while True: + print('Press shift to start.') + kb.wait("shift") + time.sleep(random.uniform(0.5, 5)) + print('uwu') + startcounter = time.monotonic() + kb.wait("shift") + endcounter = time.monotonic() + print('Reaction time is {:>9.4f}'.format(endcounter - startcounter)) + time.sleep(0.5) + if(kb.is_pressed(key)): + print('Closing game. Thanks for playing.') + main() + +#main +def main(): + print('Choose the game:') + print('React') + + s = input() + if (s == 'react' or s == 'React'): + react('ctrl') + +main()