This is an actual Lévy Walk Algorithm used by animals in Scratch. A Lévy Walk is a walk used by animals to find food efficiently. The Lévy Walk Algorithm does repeated turns and then walks in a straight line for a bit and then repeats the process. It will loop around tightly to explore an area, and then suddenly shoot across the screen in a long straight kind of line. When its raycasted vision spots food, it locks its heading and charges straight for it!
Sounds from Pixabay This project features an advanced backend with only 1 variable for the algorithm's functionality (Speed And Timer Variables Don't Count). Instead, the brain is powered entirely by a single list called Neurons. But, the vision is restricted so don't complain like "The animal is not moving to the food when it's in front of it!". The neurons fire into each other to create synaptic momentum, and a built-in decay mechanism on the turning neuron ensures the creature balances its tight loops with long, efficient straight walks.