Nature of Code: Week 1
Click on the image above to check out Squeaky, the lovable virtual mouse! This was my homework for week one of The Nature of Code. "Torus mode" means that when Squeaky reaches one side of the applet, he'll reappear on the opposite side (this gives him a little more leeway when he starts to sprint).
The assignment was to "find an example of real-world 'natural' motion" and mimic it using "controlled randomness." Squeaky uses two Perlin noise values to control direction and another Perlin noise value to control speed. The speed, however, is separated into three tiers: virtually still, slow, and lightning quick. I was hoping to replicate the way that rodents will stay motionless for a while, maybe wander around a bit, and then break into a run. Sort of a nervous movement.
My real-life examples of "real-world motion" were taken from Google Video and YouTube:
I'm happy with the way Squeaky moves, and I think the animation works well when he breaks into a run. Two future improvements: first, I need more frames of animation for when Squeaky is moving slowly or standing still. Second, Squeaky needs to learn how to turn when he reaches the wall, instead of trying to run through it.
