Some minor cleanup.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user