Simulating Life

Just another UMass Boston Blogs site

Code Review 3/31/17 NN

| 2 Comments

OK, a little off topic from my own code, but I overheard people talking about “sticking” behavior and their troubles with it. I was personally thinking about creating a schooling behavior for my fish and had run into a wall.

I’m rather proud of this code, but I need to figure out how to make it work on non-collision so I can apply it to schooling behavior. This introduces a changing variable to distance and multiple counts of many “leader” agents, but it seems like a fun problem to tackle.

2 Comments

  1. cool
    but fish schools don’t have a leader – just set heading to heading of nearest fish and they should school (or set them with a decent random probability of heading towards the nearest fish)

    you could have them always be “grouped” – isn’t that how fish work?

    • Would that cause them to constantly circle one another? Doesn’t at least 1 fish need to move independent of the group, so the group moves?

Leave a Reply

Required fields are marked *.


Skip to toolbar