Interactive Fish Schooling Name Tank

Will Kennedy's personal portfolio. This is earlier work, made before Highland Willow. It is not Highland Willow client work.

The Fish Schooling Name Tank is an interactive, full-screen p5.js experience where colorful fish swim, school, and feed in a dynamic underwater scene. Each fish has its own unique name drawn from a large pool of ocean-inspired names, and users can reveal these names by tapping or clicking on individual fish.

The tank responds to user interaction in two ways: tapping or clicking on the water surface creates a temporary “feeding spot” with drifting pebbles that attract nearby fish into spiraling schools, and tapping or clicking directly on a fish opens a floating name popup. Tapping or clicking the popup itself hides it again, keeping the screen clear as the fish continue to swim and re-form their schools.

Key Features

  • Named Fish: Each fish is assigned a unique name from an extensive list of ocean- and water-themed names, ensuring minimal repetition while the tank fills with personality.
  • Schooling Behavior: Fish are grouped by size and color into schools that align, cohere, and separate using flocking rules, creating natural-looking group motion.
  • Interactive Feeding Spots: Tapping or clicking the water creates a feeding spot with animated pebbles that draw fish into a swirling, circling pattern before they drift back into free swim.
  • Name Popups: Clicking or tapping a fish opens a soft, rounded popup hovering above it, displaying the fish’s name on a readable card styled like a speech bubble.
  • Full-Screen Responsive Canvas: The p5.js canvas automatically resizes with the browser window and adjusts fish count based on screen area to maintain performance and density.
  • Mobile-Aware Motion: The simulation detects mobile devices and subtly scales speed and forces to keep the experience smooth on phones and tablets.
  • Layered Ocean Background: A gradient water background and subtle motion cues create the impression of looking down into a deep tank from above.

How It Works

  • Feed the Fish: Tap or click anywhere that is not on a fish to create a feeding spot. Nearby fish will curve toward the spot, spiral around it, and briefly grow as they “eat.”
  • Reveal a Name: Tap or click directly on a fish to open its name popup. Only one fish name is shown at a time to keep the screen clean.
  • Hide the Popup: Tap or click the popup itself to hide the name and return to an unobstructed view of the tank.
  • Watch the Schools: Fish continuously align with neighbors of similar size and color, forming fluid, shifting schools across the tank.
  • Resize the Window: The tank recalculates canvas size and fish count to fit any desktop or mobile screen, preserving a balanced, full-screen experience.

All code demos