Concept
I wanted to capture the contrast between patience and explosive action you see when a frog hunts. Frogs sit completely still, tracking flies with just their eyes, then BAM tongue shoots out in a split second. The whole personality comes from this timing difference, not from making it look realistic.
The movement is controlled purely through acceleration values. The frog’s body never moves (zero acceleration on position), but the tongue has two completely different acceleration modes: aggressive when extending (accel = 8) and gentle when retracting (accel = -0.8). The flies get constant random acceleration in small bursts, which creates that jittery, unpredictable flight pattern you see in real insects.
I found a few videos of frogs hunting online and what struck me was how much waiting happens. Most of the time nothing is moving except the eyes tracking. Then when the tongue extends, it’s over in like 200 milliseconds. I tried to capture that same rhythm lots of stillness punctuated by sudden action.
Code Highlight
The part I’m most proud of is how the tongue uses completely different acceleration values depending on its state:
if (this.state === 'striking') {
// Explosive acceleration out
this.tongueAccel = 8;
this.tongueVel += this.tongueAccel;
this.tongueLength += this.tongueVel;
if (this.tongueLength >= this.maxTongue) {
this.state = 'retracting';
this.tongueVel = 0;
}
}
if (this.state === 'retracting') {
// Gentle acceleration back
this.tongueAccel = -0.8;
this.tongueVel += this.tongueAccel;
this.tongueLength += this.tongueVel;
if (this.tongueLength <= 0) {
this.tongueLength = 0;
this.tongueVel = 0;
this.tongueAccel = 0;
this.state = 'idle';
}
}
The 10x difference in acceleration (8 vs 0.8) creates that snappy-then-slow feeling. The tongue rockets out but drifts back lazily. This tiny numerical difference gives it way more personality than any visual design could.
Embedded Sketch
Reflection & Future Ideas
The acceleration-only constraint actually made this more interesting than if I’d used direct position control. You get these natural easing curves without writing any easing functions. The tongue feels weighty and real.
Things I noticed while testing:
- The flies sometimes cluster in corners and the frog gives up. Maybe add a “frustration” behavior where it shifts position after too many misses?
- The eye tracking is subtle but really sells the “watching” behavior. Glad I added that.
- Random acceleration on the flies works better than I thought. They feel nervous and unpredictable.
Future improvements:
- Add multiple frogs competing for the same flies
- Make the frog’s strike range dependent on hunger (longer tongue when hungry = more acceleration)
- Flies could accelerate away when they sense the tongue coming
- Different frog personalities (patient vs aggressive = different strike thresholds)
- Tongue could miss sometimes based on fly speed
The constraint of “acceleration only” forced me to think about how motion creates personality. A patient hunter isn’t patient because of how it looks, it’s patient because of when and how it accelerates.
Reflection & Future Ideas
The acceleration-only constraint actually made this more interesting than if I’d used direct position control. You get these natural easing curves without writing any easing functions. The tongue feels weighty and real.
Things I noticed while testing:
- The flies sometimes cluster in corners and the frog gives up. Maybe add a “frustration” behavior where it shifts position after too many misses?
- The eye tracking is subtle but really sells the “watching” behavior. Glad I added that.
- Random acceleration on the flies works better than I thought. They feel nervous and unpredictable.
Future improvements:
- Add multiple frogs competing for the same flies
- Make the frog’s strike range dependent on hunger (longer tongue when hungry = more acceleration)
- Flies could accelerate away when they sense the tongue coming
- Different frog personalities (patient vs aggressive = different strike thresholds)
- Tongue could miss sometimes based on fly speed
The constraint of “acceleration only” forced me to think about how motion creates personality. A patient hunter isn’t patient because of how it looks, it’s patient because of when and how it accelerates.





