[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:
-12
@@ -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)
|
||||
Reference in New Issue
Block a user