Gather by day. Build before night. Protect the village.
Side-view survival! A/D walk, W/Space jump, 1–6 pick a hotbar slot, hold left-click to mine with your tool (craft a Pickaxe, Axe & Sword in the E menu), right-click/F to place buildings. Dig underground to mine stone and hide!
Your real progress on this device — updates as you play.
Small improvements are added to make Code Box games better, easier to play, and more fun.
The game and site were reviewed to keep the experience kid-friendly, with no guns, blood, chat, public profiles, or player-vs-player shooting.
A live stats section was added to show players online, games played today, total village defenders, and best night survived.
Clean advertisement placeholder sections were added so the site can support ads in the future while keeping the game free.
The game was updated with a side-view world style, ground movement, jumping, and clearer building placement.
The first playable version of Village Siege: Build & Survive was added to Code Box.
Hand-picked games to play next — all free in your browser.
Click, automate and build a giant factory empire.
Dash, jump and dodge through colorful obstacle courses.
Harvest crops fast before time runs out.
Walk the island and feed your pet to keep it happy!
Explore a dark cave by lantern-light and collect crystals.
Stack blocks to build the tallest tower under the stars.
Watch tutorials and learn to build your own browser games.
Build your own games faster with these ready-made resources.
Village Siege: Build & Survive is a friendly side-view survival building game you can play right in your browser. During the day, walk your character left and right with the arrow keys or WASD, jump with Space, and press F next to trees, boulders and berry bushes to gather wood, stone and food. Use those resources to build walls, campfires and traps around your village core by picking a building with the number keys and placing it on the ground.
When night falls, gentle fantasy creatures wander in from the edges of the map and slowly head toward your village core. Walls block their path, glowing campfires slow them down, and traps weaken them. Survive until morning and you'll earn stars to spend in the upgrade shop. Then it's a new day — gather, build, and get ready for an even bigger night!
Survival building games are addictive because they mix three satisfying loops: gathering resources, building something of your own, and defending what you built. Every night you survive makes you a little stronger, and the upgrade shop gives you a clear reason to keep playing "just one more night." The slow climb in difficulty means you're always learning, planning and improving — without ever feeling unfair. It's a cozy, creative challenge that's easy to start and hard to put down.
This entire game is built with nothing but HTML5, CSS, the Canvas element and plain JavaScript — no libraries, images or build tools. The webpage layout is regular HTML and CSS, while the game world is drawn frame-by-frame onto a single Canvas using simple shapes and colors. A game loop updates the player, creatures and buildings many times per second, and your browser's localStorage remembers your high score. If you'd like to make your own, start small: draw a square that moves with the keyboard, then add one feature at a time. Grab the starter kit above and start building!