Some minor cleanup.

This commit is contained in:
Storm Dragon
2025-03-21 20:54:13 -04:00
parent cb69189c8e
commit 87d0764156
16 changed files with 193 additions and 193 deletions

View File

@@ -17,17 +17,17 @@ class Object:
self.isActive = True
# For collectibles in a range, track which positions have been collected
self.collectedPositions = set()
@property
def xPos(self):
"""Return center of range for audio positioning"""
return (self.xRange[0] + self.xRange[1]) / 2
def is_in_range(self, x):
"""Check if a given x position is within this object's range"""
tolerance = 0.5 # Half a unit tolerance
return (self.xRange[0] - tolerance) <= x <= (self.xRange[1] + tolerance)
def collect_at_position(self, x):
"""Mark a specific position in the range as collected"""
self.collectedPositions.add(x)