AWS Builder Center
Weekend Creative Challenge: MapSnake

Weekend Creative Challenge: MapSnake

MapSnake is a fresh take on the classic snake game: instead of a blank grid, your snake slithers across a stylized world map, eating glowing cities (Tokyo, Paris, Cairo, Lagos...) to grow longer. The HUD tells you which continent you're currently traversing, your current score, and your all-time best. There's no sign-up, no install, no loading screen just open the link and start slithering. I wanted to make something that combined a nostalgic arcade mechanic with a global, exploratory vibe.

Cloud Architect



I kept the architecture deliberately tiny, one HTML file, zero backend, zero dependencies. The game runs entirely on HTML5 Canvas with vanilla JavaScript, which means:
  • No build step, no npm, no framework overhead.
  • The snake, food, map background, and glow effects are all drawn procedurally on canvas (no external image assets to host).
  • Mobile gets both swipe controls and an on-screen D-pad, auto-shown via  @media (hover: none) .
  • Best score persists in  localStorage , so returning players see their record.
Key decisions: The world map is drawn as polygon blobs inside the same canvas rather than a static image, keeping everything self-contained in one file. Food items are procedurally picked from a list of world cities, and the continent label updates based on the snake head's grid position. Speed ramps up gently as you eat more cities, capped at 60ms per tick to keep the game challenging but playable.
Challenge I hit: Getting swipe gestures and keyboard controls to coexist without conflicting was tricky I solved it by routing both through a single  setDirection()  function that also prevents 180° reversals (a common snake-game bug where pressing the opposite direction kills you instantly).

AWS Services Used / Architecture Overview

Just one AWS service, chosen deliberately:
Amazon S3 : static website hosting. The entire game is a single  index.html  file. S3 serves it over HTTP with a bucket policy granting  s3:GetObject  to  * , and public access is enabled via  PutPublicAccessBlock .
Browser → S3 Static Website Endpoint → index.html (game runs 100% client-side)
Why just S3? The creative goal was to build something that felt polished and fun while using the absolute minimum infrastructure. S3 static hosting is free-tier eligible, infinitely scalable, and costs effectively zero for demo traffic. Adding Lambda or API Gateway would have been over-engineering for a client-side game.

What You Learned

  • Constraints breed creativity. Limiting myself to a single HTML file forced me to draw the entire world map procedurally rather than grab a stock image and the result feels more cohesive.
  • S3 static hosting is still incredibly underrated. For a game like this, I didn't need servers, CDNs, or deployments. Upload the file, it's live.
  • Touch UX matters more than I expected. Adding swipe detection took 15 lines but made the game playable on phones something I almost skipped.
If I had another weekend, I'd add a "high-score leaderboard" using DynamoDB + Lambda, maybe let players pick different maps (historical, fantasy, moon), plus sound effects and a pause menu.

Link to App

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article