Bees & Bears: a tower-defense game built from scratch in Odin and WebAssembly
Bees & Bears is a top-down 2D tower-defense game. Build turrets along a winding forest path to stop bears, cubs, honeybadgers, moose, and foxes from reaching the hive across a 10-wave Normal defense or an endless Infinite mode, flip sides in Attack mode to spawn the animal horde yourself against an AI-controlled defender, or unwind in Peaceful Meadow, a combat-free creature sim where bees, butterflies, cows, and hedgehogs go about a full day/night cycle with nothing to lose.
How to play
In Normal and Infinite mode, press 1–4 to select a tower type (Basic, Rapid, Splash, or Slow, each with its own cost, range, damage, and fire rate), then click or tap a grass tile to build it. Click a placed tower to open its upgrade panel, or right-click/long-press it to sell for 60% of its build cost. In Attack mode the same number keys (1–5) instead spawn a bear, cub, honeybadger, moose, or fox against the AI's own towers. Enter or Space skips to the next wave (or ends the current round in Attack mode); M toggles sound effects, N toggles music, and [ / ] adjust volume. Esc returns to the main menu, and R restarts with the same mode from the Game Over or Victory screen. Peaceful Meadow has no controls to speak of; just watch the creatures wander, or press ? or H on the main menu for an in-game how-to-play overlay at any time.
How it's built
The whole game, logic, rendering, audio, and persistence, is written in the Odin programming language and compiled to WebAssembly, with zero image files, zero audio files, and zero JavaScript/npm runtime dependencies at runtime. Every sprite is drawn with raw pixel primitives onto a single RGBA canvas buffer (there's even a hand-authored bitmap font rather than a canvas text API), and every sound is a live Web Audio oscillator synthesized on the fly. The map, hex-grid background, and creature/tower sprites are pre-baked into pixel buffers once and blitted rather than redrawn every frame, and the Odin↔JavaScript bridge (odindom) exposes the DOM, Canvas 2D, Web Audio, and localStorage as thin foreign-imported procedures rather than generated bindings. Map layout, wave composition, and creature spawns all derive from a single seeded random-number generator, so a run is reproducible from its seed rather than relying on browser-supplied randomness scattered throughout the code.
About the developer
I'm Ewald Horn, a software developer: I build all kinds of things, not just games. Bees & Bears is one example from a personal collection of small browser projects used to explore systems programming, WebAssembly, and game AI from first principles. I might be available for freelance development work.