From d20d2ed83c755747f3bf0ef81df3b83f833f765b Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Sat, 1 Jan 2022 21:17:20 -0700 Subject: [PATCH] first bk transition --- r3.py | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/r3.py b/r3.py index e857e97..c7bffd5 100644 --- a/r3.py +++ b/r3.py @@ -178,6 +178,8 @@ else: running = True live = True complete = False + bx = 0 + by = 0 debug = False # This set debug mode #rect = pygame.Rect((0, 0), (32, 32)) #image = pygame.Surface((32, 32)) @@ -188,20 +190,42 @@ else: dt = clock.tick(FPS) / 1000 #screen.fill(BLACK) datetime.datetime.now() + #bx = 0 + #by = 0 for event in pygame.event.get(): if event.type == pygame.QUIT: quit() + elif event.type == pygame.KEYDOWN: + if event.key == pygame.K_w: + by = -1 + elif event.key == pygame.K_s: + by = 1 + elif event.key == pygame.K_a: + bx = -1 + elif event.key == pygame.K_d: + bx = 1 + elif event.type == pygame.KEYUP: + if event.key == pygame.K_w: + by = 0 + elif event.key == pygame.K_s: + by = 0 + elif event.key == pygame.K_a: + bx = 0 + elif event.key == pygame.K_d: + bx = 0 #ax and ay are for left stick ax = joystick.get_axis(0) ay = joystick.get_axis(1) - if gamepad == 1: + #bx = 0 + #by = 0 + #if gamepad == 1: #bx and by are for right stick - bx = joystick.get_axis(2) - by = joystick.get_axis(3) - elif gamepad == 2: + #bx = joystick.get_axis(2) + #by = joystick.get_axis(3) + #elif gamepad == 2: #bx and by are for right stick - bx = joystick.get_axis(3) - by = joystick.get_axis(4) + #bx = joystick.get_axis(3) + #by = joystick.get_axis(4) #b0 is for cross button on ds4 b0 = joystick.get_button(0) #b1 is for circle button on ds4