Show HN: Sprite Garden – HTML Canvas 2D sandbox and farming

Share This Post

Sprite Garden: https://kherrick.github.io/sprite-garden/

A 2D sandbox exploration and farming game that runs entirely in the web browser. As a fully HTML, CSS, and JavaScript game, it is highly readable, hackable, and customizable. Included on “globalThis” is the “spriteGarden” global object with the game config and state readily available. Drawing with tiles is as easy as opening dev tools (use the menu in the browser as keyboard is captured), or entering the “Konami Code,” for a full screen view and a map editor.

– Share games from the world state manager

– Explore unique procedurally generated biomes

– Dig for resources like coal, iron, and gold

– Use collected materials to place blocks and shape the world

– Discover underground cave systems filled with resources

– Plant and harvest different crops with “realistic” growth cycles

Examples:

– Preparing a QR Code to be mined: https://gist.github.com/kherrick/1191ae457e1f6e1a65031c38c2d…

– Drawing a heart in the sky: https://gist.github.com/kherrick/3dc9af05bccc126b11cc26fb30a…

– Entering the Konami Code (map editor / fullscreen): https://gist.github.com/kherrick/effbe1463d9b78da046f27c5d42…

I’m unsure how the game should be taken further, or whether it should progress.

Some potential ideas for the future include:

– Input Box with JS Execution: Provide a safe, sandboxed input area in the game’s UI where players can write small JS functions or scripts (instead of exposing it on globalThis).

– API Exposure: Expose a controlled API or object representing game state and functions, like terrain manipulation, crop growth, player movement, to the user script so players can
automate or modify behaviors.

– Event Hooks: Allow players to register hooks into game events (e.g., world update, planting crops) where their custom code runs, enabling mods or custom automation.

– Multiplayer: Use WebRTC to allow many players in the same world.

– Actual gamification: Make reasons to play, health meter, powerups, plant combinations, enemies?

– Better mobile controls: Currently on screen, no swiping for movement.

– Easier building with blocks: Currently block position based on location of player.

Also featured on:

– Microsoft Store: https://apps.microsoft.com/detail/9mv5d0990kct

– Wayback Machine: https://web.archive.org/web/20251008155620/https://kherrick….

Feedback is highly welcome, and source is available at: https://github.com/kherrick/sprite-garden


Comments URL: https://news.ycombinator.com/item?id=45552978

Points: 2

# Comments: 0

Source: kherrick.github.io

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Windows Securitym Hackers Feeds

Art about Mathematics (Rinus Roelofs)

Article URL: https://www.nytimes.com/2025/10/10/science/mathematics-art-roelofs.html Comments URL: https://news.ycombinator.com/item?id=45555428 Points: 1 # Comments: 1 Source: www.nytimes.com

Do You Want To Boost Your Business?

drop us a line and keep in touch

We are here to help

One of our technicians will be with you shortly.