def eat_food(cell): for f in range(NUM_FOOD): nom = food[f] if cells_collide(cell, nom): new_radius = palgame.get_radius(cell) + (1 - palgame.get_radius(cell) / 100) palgame.set_radius(cell, new_radius) food[f] = palgame.get_random_food()
def eat_cells(cell): for b in range(NUM_CELLS): other_cell = cells[b] if cell != other_cell and cells_collide(cell, other_cell): radius = palgame.get_radius(cell) if radius >= palgame.get_radius(other_cell): new_radius = radius + (1 - radius / 100) palgame.set_radius(cell, new_radius) cells[b] = palgame.get_random_ball()