Archived Sketch

This sketch is created with an older version of Processing,
and doesn't work on browsers anymore.

View Source Code

Click Record or
press 'R' to save 3 secs of animation

Prey and Predator Example

Prey and Predator Example

"2 Predator and 1 Prey Example" by Brian Schrank, October 2012 Hi Playgramming! Reuse and remix this code, but give attribution in your comments! :) This sketch shows how to make one creature scared of other creatures. The white "prey" ellipse is scared of the red "predator" ellipse and the green "predator" ellipse. All three creatures move and bounce off the walls.

Prey and Predator Example

"2 Predator and 1 Prey Example" by Brian Schrank, October 2012 Hi Playgramming! Reuse and remix this code, but give attribution in your comments! :) This sketch shows how to make one creature scared of other creatures. The white "prey" ellipse is scared of the red "predator" ellipse and the green "predator" ellipse. All three creatures move and bounce off the walls.
eg. "mouse, keyboard"
eg. "visualization, fractal, mouse"
learn more about Creative Commons
won't be published on feeds but still accessible on your profile
won't be accessible by anyone
source code won't be available on the page, however it will still be accessible via browser console

As a Plus+ Member feature, this source code is hidden by the owner.