Milestone #3: The Food Chain is Alive! 🦊🌱
Hey everyone! I’m super excited to share the final milestone of my Artificial Life Simulator. Today, I turned a simple survival script into a fully functioning, two-level digital ecosystem.
Here is what’s new:
What I Built
The Predators (Red Cells): I introduced a new species to the world! Unlike the green guys, these red cells don’t move randomly. They use a cool math trick (np.linalg.norm) to calculate the distance to every single green cell, find the closest one, and hunt it down!
The Food Chain: Green cells eat yellow food to gain energy and split into two (Mitosis) when they get big enough. But now, red cells are hunting the green cells! When a predator catches its prey, it eats it, steals its energy, and the green cell is gone.
Smart Code Structure: Instead of copy-pasting code for every single creature, I moved everything into dynamic Python lists and dictionaries. Now, the simulation can handle hundreds of cells smoothly!
Thanks for following along on this building journey!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.