Compare commits

...

4 Commits

Author SHA1 Message Date
049525ca59 updating with master branch 2025-06-03 22:29:13 -05:00
Sam
737d595d50 Increase zoom threshold for smoother zoom transitions in simulation
All checks were successful
Build Simulation and Test / Run All Tests (push) Successful in 35s
2025-06-03 22:01:47 -05:00
Sam
330f199657 Update food object representation to use one decimal place for decay value
All checks were successful
Build Simulation and Test / Run All Tests (push) Successful in 30s
2025-06-03 22:00:40 -05:00
Sam
fe4e15eac1 Enforce world bounds for object positioning and update related tests
All checks were successful
Build Simulation and Test / Run All Tests (push) Successful in 30s
2025-06-03 21:55:40 -05:00
4 changed files with 9 additions and 5 deletions

View File

@ -83,5 +83,9 @@ def test_tick_all_calls_tick(world):
def test_add_object_out_of_bounds(world):
entity = DummyEntity(Position(x=1000, y=1000))
with pytest.raises(ValueError):
world.add_object(entity)
entity = world.get_objects()[0]
assert entity.position.x == 49 and entity.position.y == 49

View File

@ -170,4 +170,4 @@ class FoodObject(BaseEntity):
:return: String representation.
"""
return f"FoodObject({self.position}, decay={self.decay:.0f}, decay_rate={self.decay_rate * (1 + (self.neighbors / 10))})"
return f"FoodObject({self.position}, decay={self.decay:.1f}, decay_rate={self.decay_rate * (1 + (self.neighbors / 10))})"

View File

@ -80,7 +80,7 @@ class Camera:
zoom_smoothing_factor = 1 - pow(1 - self.zoom_smoothing, deltatime * 60)
self.zoom += (self.target_zoom - self.zoom) * zoom_smoothing_factor
zoom_threshold = 0.001
zoom_threshold = 0.01
if abs(self.zoom - self.target_zoom) < zoom_threshold:
self.zoom = self.target_zoom