Compare commits
	
		
			2 Commits
		
	
	
		
			8f6b9c8322
			...
			6c98d5d84e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6c98d5d84e | |||
| 15e12a73aa | 
| @ -69,19 +69,6 @@ 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 | ||||
| 
 | ||||
| @ -167,7 +154,7 @@ class FoodObject(BaseEntity): | ||||
|         if camera.is_in_view(*self.position.get_position()): | ||||
|             pygame.draw.circle( | ||||
|                 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()), | ||||
|                 int(5 * camera.zoom) | ||||
|             ) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user