Addiing individual controller support. /JL
This commit is contained in:
@@ -26,9 +26,9 @@ def load_image(path, max_size):
|
||||
new_size = (int(image_rect.width * scale_factor), int(image_rect.height * scale_factor))
|
||||
return pygame.transform.smoothscale(image, new_size)
|
||||
|
||||
keyboard_image = load_image("keyboard.png", (100, 100))
|
||||
keyboard_image = load_image("resources/gfx/keyboard.png", (100, 100))
|
||||
#joystick_image = load_image("ps5-dualsense.png", (100, 100))
|
||||
joystick_image = load_image("gamepad.png", (100, 100))
|
||||
joystick_image = load_image("resources/gfx/gamepad.png", (100, 100))
|
||||
|
||||
# Abstract Control Class
|
||||
class Control(ABC):
|
||||
|
||||
@@ -57,7 +57,7 @@ def main():
|
||||
print("Joystick button pressed.")
|
||||
if event.button == 0:
|
||||
joystick = joysticks[event.instance_id]
|
||||
if joystick.rumble(0, 0.7, 500):
|
||||
if joystick.rumble(0.7, 1.0, 1000):
|
||||
print(f"Rumble effect played on joystick {event.instance_id}")
|
||||
|
||||
if event.type == pygame.JOYBUTTONUP:
|
||||
|
||||
Reference in New Issue
Block a user