Skip to content
Fruit Fly Fruit Ninja

Fruit Fly Fruit Ninja

Tiny flies. Big slices. Learn, chop, repeat.

Created on 20th September 2026

Fruit Fly Fruit Ninja

Fruit Fly Fruit Ninja

Tiny flies. Big slices. Learn, chop, repeat.

The problem Fruit Fly Fruit Ninja solves

Neural learning can feel abstract: numbers change, but the consequence is hard to see. Fruit Fly Fruit Ninja makes that consequence playable: which flies volunteer, how they navigate, whether they can lift a shared knife, and whether a salad gets served. Players can teach, erase, compare, and retrain the behavior themselves.

The game

Welcome to the tiniest salad bar. Eight fruit flies wait on shelves, jars, and counter edges throughout a 3D kitchen. Order a salad and the flies that have learned to like its ingredients leave their perches, collect a shared knife, and prepare your bowl. Time each chop to build a streak, make custom recipes, or chase a best score in a 90-second rush.

Kiwi begins without fans. Order Green surprise and the kitchen waits. In Smell school, select two chefs and pair kiwi smell with a snack. Their simulated KC-to-MBON connection strengths change, their preference scores rise, and the waiting order resumes. Each fly has its own smell-learning history. Sniffing previews the circuit response without training it.

Learned movement you can inspect

Learned action readout is the default flight mode. It controls individual flights from shelf to knife and back, plus the crew's shared knife forces and rotation. The game selects spatial waypoints and desired banking angles; learned forces and torques move the simulated bodies toward them. Carriers share the knife's exact pose after attachment, keeping grips together without visual lag.

Switch between Autopilot, Learned action readout, and Untrained to compare behavior. Erase flight learning to remove thrust; retrain in the browser to recover. Tap the wind icon inside the game screen to disturb airborne flies or the carried knife and watch the controller respond.

The Brain panel follows a volunteer for the current fruit, with manual selection available. Its rotatable circuit view shows smell activity or flight features, alongside a live six-axis readout: fx/fy/fz for force and tx/ty/tz for torque. Signed numbers and centered bars show the applied output. Flight trails continue during navigation and knife carrying.

Apple, orange, strawberry, and kiwi have distinct 3D shapes and surfaces, with matching sliced interiors. The interface supports responsive layouts, fullscreen play, optional sound, saved flight lessons, and saved best scores.

How the learning works

The app uses a real, attributed MaleCNS anatomical extraction of 319 neurons and 2,117 edges. Synthetic fruit smells pass through fixed PN-to-KC connectivity, with simplified APL inhibition; snack pairing strengthens active KC-to-MBON connections through an engineered associative-learning rule. A preference score recruits the crew. The extracted PPL1 teaching pathway remains inactive in this game rule.

Flight uses supervised imitation learning: 13 engineered state inputs pass through 124 PN units and 192 KC features. Ridge regression fits six motor outputs to an engineered autopilot's answers for 1,800 synthetic states. Only the output weights are fitted; the encoder and anatomical PN-to-KC connections stay fixed. One shared lesson is copied to all eight flies. A Web Worker computes retraining locally while the game continues. This is not trial-and-error reinforcement learning, and ordinary play does not update flight weights.

JavaScript, Three.js and WebGL render the kitchen. Custom rigid-body physics handles XYZ movement, quaternion rotation, bounded forces and swept blade-fruit contact. A cut requires physical blade contact. Vercel hosts the static app. The mascot and social artwork were generated with ChatGPT's image-generation tool.

This is an interactive demonstration linking simulated connection changes to behavior, not a reconstruction of biological flight circuitry or evidence of improved human neuroplasticity. Code is MIT licensed; anatomical data are attributed under CC BY 4.0.

Challenges I ran into

  • Making navigation genuinely spatial: individual flies use learned forces and torques to travel between perches and knife grips, with visible banking and recovery. The coordinator still chooses waypoints and target attitudes.
  • Keeping carriers and knife coupled: every carrier must arrive before lifting, then share the knife's exact pose without attachment lag.
  • Making slices physical: timing bonuses cannot substitute for the moving blade reaching the fruit, and whole/sliced fruit geometry must remain visually consistent.
  • Keeping the learning claims precise: independent smell preferences use an engineered associative rule; flight uses a shared supervised imitation lesson, not biological motor reconstruction or trial-and-error reinforcement learning.
  • Making control observable without crowding the game: the responsive Brain panel follows the active crew and combines circuit activity with six live force/torque values; fullscreen and an in-scene wind icon make experiments accessible during play.
  • Making every fruit recognizable: distinct silhouettes, strawberry seeds and crown, orange peel and segments, apple core, and kiwi rind/flesh were visually reviewed both whole and sliced.

Discussion

Builders also viewed

See more projects on Devfolio