[refactor] Cleanup code

- Rename joystick library to helpers
- Put color565 function in helpers.py
- Switch screen width and height names as game runs in landscrape
- Enumerate levels for readability
- Update docstrings
- Rework splash screen to use binary operators
- Extract create bricks and create lives functions
- Reowrk main game loop logic to support next level
This commit is contained in:
2025-04-04 05:53:14 +02:00
parent 0e5b5f67fa
commit ce7add6479
4 changed files with 143 additions and 93 deletions
-12
View File
@@ -1,12 +0,0 @@
from machine import Pin
class Joystick:
def __init__(self):
# Map buttons
self.button_a = Pin(15, Pin.IN, Pin.PULL_UP)
self.button_b = Pin(17, Pin.IN, Pin.PULL_UP)
# Map joystick
self.joy_up = Pin(2,Pin.IN, Pin.PULL_UP)
self.joy_down = Pin(18,Pin.IN, Pin.PULL_UP)
self.joy_left = Pin(16 ,Pin.IN, Pin.PULL_UP)
self.joy_right = Pin(20 ,Pin.IN, Pin.PULL_UP)
self.joy_click = Pin(3, Pin.IN, Pin.PULL_UP)