changed food color, transitions from red to black
This commit is contained in:
parent
5b9b6df997
commit
15e12a73aa
@ -69,19 +69,6 @@ class DebugRenderObject(BaseEntity):
|
|||||||
"""
|
"""
|
||||||
return f"DebugRenderObject({self.position}, neighbors={self.neighbors})"
|
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):
|
def chance_to_grow(decay_rate):
|
||||||
return ((2**(-20*(decay_rate-1)))*12.5)+0.1
|
return ((2**(-20*(decay_rate-1)))*12.5)+0.1
|
||||||
|
|
||||||
@ -167,7 +154,7 @@ class FoodObject(BaseEntity):
|
|||||||
if camera.is_in_view(*self.position.get_position()):
|
if camera.is_in_view(*self.position.get_position()):
|
||||||
pygame.draw.circle(
|
pygame.draw.circle(
|
||||||
screen,
|
screen,
|
||||||
(255 - self.normalize_decay_to_color(), food_decay_yellow(self.normalize_decay_to_color()), 0),
|
(255 - self.normalize_decay_to_color(), 0, 0),
|
||||||
camera.world_to_screen(*self.position.get_position()),
|
camera.world_to_screen(*self.position.get_position()),
|
||||||
int(5 * camera.zoom)
|
int(5 * camera.zoom)
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user