Use the black boxes at the bottom of the page to navigate through the slides.
The Fly was my first big dive in to coding, and the product of my high school graduation project. It is a modeling of the basic behavior of a fruit fly, they are somewhat aimless, but are attracted to a light source. The point of interest in this case is your mouse.
Demo1 - Demo3: The first few slides are basics, figuring out how to call for the mouse's position, and distance, and then its relative angle -- the trickiest one of all.
Demo4: After I laid down the basic usable functions, the rest was a combination of those elements. You can click and drag these two objects, and modify the green number in the box on the upper left which affects the "cone" of vision to the unit.
Fly Alpha: Ring-based indicators that were never used.
Slide 6: Final version. Click the "Replicate" button to make flies, and click them to kill them. The parameters in the text boxes allow you to fiddle with their brains which are a combination of random turning, and movement based on if they are looking in the right direction.
"Tur" is a preset for "baby turtles". "Shy" is a preset that makes them shy.