Compare commits
No commits in common. "6c98d5d84ec7f4a75998dc21f600afdff91b066b" and "8f6b9c83220969022a67b13004c22b8d2bc023a0" have entirely different histories.
6c98d5d84e
...
8f6b9c8322
@ -69,6 +69,19 @@ class DebugRenderObject(BaseEntity):
|
||||
"""
|
||||
return f"DebugRenderObject({self.position}, neighbors={self.neighbors})"
|
||||
|
||||
|
||||
def food_decay_yellow(decay: int) -> int:
|
||||
"""
|
||||
Returns the yellow color component for food decay visualization.
|
||||
|
||||
:param decay: The current decay value (0-255).
|
||||
:return: The yellow component (0-255).
|
||||
"""
|
||||
if decay < 128:
|
||||
return decay
|
||||
else:
|
||||
return 255 - decay
|
||||
|
||||
def chance_to_grow(decay_rate):
|
||||
return ((2**(-20*(decay_rate-1)))*12.5)+0.1
|
||||
|
||||
@ -154,7 +167,7 @@ class FoodObject(BaseEntity):
|
||||
if camera.is_in_view(*self.position.get_position()):
|
||||
pygame.draw.circle(
|
||||
screen,
|
||||
(255 - self.normalize_decay_to_color(), 0, 0),
|
||||
(255 - self.normalize_decay_to_color(), food_decay_yellow(self.normalize_decay_to_color()), 0),
|
||||
camera.world_to_screen(*self.position.get_position()),
|
||||
int(5 * camera.zoom)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user