yanablack/GameOfLife

Draw lines for the spawnNewCreatre

Opened this issue · 1 comments

This is what I understood from our conversation yesterday:

Find all "Creatures"
For every "creature"
--> check if "creature" is not ME
----> if neighbors == 2
-------> check for a free slot (in a sphere)
----------> spawn new creature in the free slot

WDYT?

almost :)

creatures:=find_all_with_tag("creature");
foreach (creature){
   spots = find_spots_around_creature(creature);
   foreach (spot){
      if spot_is_empty(spot) { 
            nc = find_neighbours(spot);
            if (nc==2){
               spwan_creature(location=spot);
            }
      }
}

Please not that spot_is_empty is actually count_neighbors with a small-enough radius.