Skip to content

Repository files navigation

Snowball Effect

A survivors-like where you are the weapon. You're a snowball rolling through an endless dusk snowfield: anything smaller than you gets absorbed and makes you bigger, anything bigger grinds you down.

License: MIT Version

Play Snowball EffectReport Issue


Overview

Size is your health bar, your damage, and your progress bar all at once. Survive 15:00 (or absorb the Ice Titan) to become the avalanche, then keep rolling in endless mode.

Pure HTML5 canvas + vanilla JS + WebAudio synth. Zero asset files — every sprite and sound is generated in code. Works with mouse, keyboard, and touch.

Play it locally

Any static server works:

python -m http.server 8123
# then open http://localhost:8123

(Or use the Claude Code preview — .claude/launch.json is already set up.)

Controls

  • Desktop: WASD / arrow keys, or click-drag anywhere. P/Esc pause, M mute, 1/2/3 pick upgrade cards.
  • Mobile: touch anywhere and drag — a floating joystick appears. Tap cards to pick upgrades.

Upload to itch.io

  1. Build the zip (already done — snowball-effect-itch.zip — or rebuild):
    Compress-Archive -Path index.html, js -DestinationPath snowball-effect-itch.zip -Force
  2. On itch.io: Upload new project → Kind of project: HTML.
  3. Upload the zip and check "This file will be played in the browser."
  4. Embed options: viewport 1280 × 720, check Mobile friendly (orientation: either) and Fullscreen button. The game adapts to any size/orientation, including phones in portrait.
  5. Add screenshots from screenshots/ (real gameplay captures).

How the game is wired

File What's in it
js/data.js All tuning knobs: CFG (growth, damage, camera, XP curve), enemy types & sizes, spawn timeline STAGES, scripted BOSSES, the UPGRADES pool
js/game.js Main loop, spawn director, combat resolution, camera, render, UI states
js/entities.js Player/enemy behavior, weapons (spikes, orbs, hail, aura, avalanche), particles
js/sprites.js All art, drawn in code and cached to offscreen canvases; plus the Sky module (single time-of-day clock the whole dusk look reads from)
js/audio.js All sound, synthesized with WebAudio (absorb pitch climbs with your combo)
js/input.js Keyboard + floating touch joystick (pointer events)

Visual design — "Dusk Alpenglow Snowfield"

The whole game renders with zero image assets under one cohesive art direction: a high snowfield at dusk that walks from golden alpenglow to deep starry night across the 15-minute run (the Sky time-of-day clock in js/sprites.js). Key systems, all tuned to hold 60fps with ~230 enemies + hundreds of particles:

  • Atmosphere — screen-space dusk sky gradient, drifting stars, parallax mountain ridgelines, two-depth snowfall, wind-combed drift streaks, and a cached post chain (warm alpenglow band + cool/warm grade + vignette). All full-screen gradients are cached on a coarse time bucket — no per-frame createGradient.
  • The snowball — size-tapered glow (never blows out), cyan rim-light, packed-snow compression rings + crystalline facets, frosted-ice spikes.
  • Creatures — baked rim-light + ambient-occlusion spheres, contact shadows, and three baked face moods (calm / fearful when fleeing you / aggressive when a threat) keyed into the size-bucket sprite cache.
  • Juice — directional snow-gulp on absorb, squash-pop, rolling spray, ice-shard impacts with hitstop + directional shake, themed shockwaves, and a gold level-up/boss-absorb flash.
  • Sacred readability is preserved byte-for-byte: the coral/amber threat outlines, orange imps, and green edible-boss arrows draw in world space after everything and are never washed by the grade. prefers-reduced-motion gates all ambient motion.

Design rules that everything follows:

  • The size hierarchy is absolute. Nothing that can hurt you can be hurt: red-outlined enemies take zero damage from every weapon. You don't DPS threats down — you outgrow them, then eat them. Weapons only work on prey and on amber-ring rivals (Ice Spikes' niche).
  • Prey flees, predators chase. Anything you can eat runs from you — including outgrown bosses. Food never walks into your mouth; you hunt.
  • A still snowball melts. Stop rolling for more than ~1.5s and you start shrinking (the size readout turns red). Rolling is the win condition, melting is the idle penalty — there is no AFK build.
  • Enemies bigger than you get a red outline, near-your-size get amber, edible get nothing. Fire imps (orange) always hurt and can't be eaten.
  • Scripted boss events scale with your size so they're always scary on arrival; wave-spawned yetis stay fixed at their original size — that's the "the boss from minute one is a pebble now" moment, except now it flees from you.
  • All damage is still size transfer, and the meal ladder is explicit: swallow whole (100%) > shred a rival then eat it (~85%) > weapon kill (50%, dropped as chunks you must go collect). Weapons are harvest tools, never a way up the food chain.
  • Survive 15:00 or absorb the Ice Titan to win; endless mode after.

Debug console handles

window.G is the game. Useful in DevTools:

G.auto = true       // autopilot (used for balance soak-testing)
G.timeScale = 4     // fast-forward
G.player.r = 200    // instant chonk
G.skip(600)         // jump the clock without dogpiling skipped bosses

Ideas for v2

  • "Split into twin balls" upgrade from the original pitch (replaced by orbiting Twin Moons for v1 to keep one-finger controls).
  • Daily seeded runs, meta-unlocks, more boss patterns, cover image for itch.

About

A survivors-like where you are the weapon. You're a snowball rolling through an endless dusk snowfield: anything smaller than you gets absorbed and makes you bigger, anything bigger grinds you down.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages