Skip to content

Commit

Permalink
QA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Oct 28, 2024
1 parent 10d7086 commit d447db8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/multi_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def draw(self, display):
display.pixel(int(self.x), int(self.y))

def is_on_screen(self):
return self.x >= 0 and self.x < WIDTH and self.y >= 0 and self.y < HEIGHT
return self.x >= 0 and self.x < WIDTH and self.y >= 0 and self.y < HEIGHT

def has_hit(self, player):
xdiff = self.x - player.x
Expand Down Expand Up @@ -200,7 +200,7 @@ def check_hits(self, players):
p.update()
# Handle QwSTPads being disconnected unexpectedly
except OSError:
print(f"P{p.index + 1}: Diconnected ... Exiting")
print(f"P{p.index + 1}: Disconnected ... Exiting")
raise SystemExit

# Check if any projectiles have hit players
Expand Down
7 changes: 2 additions & 5 deletions examples/random_maze.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gc
import time
import random
import time
from collections import namedtuple

from machine import I2C
Expand All @@ -9,7 +9,6 @@

from qwstpad import ADDRESSES, QwSTPad


# General Constants
I2C_PINS = {"id": 0, "sda": 4, "scl": 5} # The I2C pins the QwSTPad is connected to
I2C_ADDRESS = ADDRESSES[0] # The I2C address of the connected QwSTPad
Expand Down Expand Up @@ -81,7 +80,7 @@ def build(self, width, height):
raise ValueError("width out of range. Expected greater than 0")

if height <= 0:
raise ValueError(f"height out of range. Expected greater than 0")
raise ValueError("height out of range. Expected greater than 0")

self.width = width
self.height = height
Expand Down Expand Up @@ -149,7 +148,6 @@ def build(self, width, height):
self.grid_columns = (self.width * 2 + 1)
self.grid_rows = (self.height * 2 + 1)


def choose_neighbour(self, current):
unvisited = []
for dx in range(-1, 2, 2):
Expand Down Expand Up @@ -243,7 +241,6 @@ def build_maze():
height = random.randrange(MIN_MAZE_HEIGHT, MAX_MAZE_HEIGHT)
builder.build(width + difficulty, height + difficulty)


wall_separation = min(HEIGHT // builder.grid_rows,
WIDTH // builder.grid_columns)
wall_size = wall_separation - WALL_GAP
Expand Down

0 comments on commit d447db8

Please sign in to comment.