Build Your Own City Game: A Browser Game Project for Teens

Home Build Your Own City Game: A Browser Game Project for Teens

A young girl in glasses concentrating on a coding project on a laptop

City games are having a moment. In October 2026, a browser game called Lagos Life went viral, with its developer saying it passed 1 million players in four days. Lagos Life is an adult game (players must be 18+), so it is not one for younger students. But the idea behind it is a brilliant learning opportunity: what if your teen built their own city game?

This guide is for parents, teachers and curious teens. It walks through a browser game project for teens, starting with a simple driving game and growing into a small city with jobs, money and places to visit.

Tokyo STEM School is not affiliated with Lagos Life or its developer.

Why city games are a great first project

They are personal

A student can model their own neighbourhood: the station, the convenience store, the park, the school gate. Building something you recognise is far more motivating than copying a generic tutorial.

They mix creativity and logic

A city game needs art and design (what does the city look like?) as well as rules and logic (how does money work? what happens at night?). That makes it a good fit for students who love drawing and students who love numbers.

They grow with the student

You can start with a car that moves across a screen. Months later, the same project can have buildings, characters and a working economy. The project never has to be “finished”.

What students learn

  • Game loops: the cycle that updates and redraws the game many times per second.
  • Variables: storing things like money, energy, time of day and score.
  • Coordinates and maps: placing roads and buildings on a grid using x and y positions.
  • Events and input: responding to key presses, taps and clicks.
  • Collision detection: knowing when a car hits a wall or a player enters a shop.
  • Simple economies: earning money from a job, spending it on rent and food, and balancing the numbers so the game is fun.
  • Design thinking: testing with friends, collecting feedback and improving.

These are real computer science concepts, wrapped in a project students actually want to finish.

Project steps: from a simple driving game to a mini city

Step 1: Draw the map

Start on paper. Sketch a small grid of streets with five to eight places: home, a workplace, a shop, a park and a station. Give each place a purpose in the game.

Step 2: Build a driving game

Make a vehicle that moves with the arrow keys. In Scratch, this takes a few blocks. Add a road background and make the vehicle stop at the edges. Add a few obstacles, such as other cars or traffic cones, and a timer.

This step alone is a complete mini game. Many students are proud to share it at this point.

Step 3: Add places you can enter

When the player reaches a building, show a message or switch to a new scene. “You arrived at the bakery. Buy bread for 100 coins?” Now the map has meaning.

Step 4: Add money and energy

Create two variables: money and energy. Working at a job gives money but uses energy. Eating restores energy but costs money. Paying rent once per “day” keeps things interesting.

Balancing these numbers is a great lesson in maths and game design. If rent is too high, the game is impossible. If it is too low, it is boring.

Step 5: Add day and night

Use a timer to switch between day and night every few minutes. Change the background colour, open and close shops, and give certain jobs only at night.

Step 6: Test, share and improve

Ask friends or family to play. Watch where they get confused. Fix one thing at a time. This is exactly how professional game studios work.

Tools for beginners: Scratch, then JavaScript

Start with Scratch (ages 8 and up)

Scratch is a free, block-based coding platform from MIT. Students drag and snap blocks together instead of typing code. It runs in a browser and lets students share games with a link, which is perfect for steps 1 to 5.

Move to JavaScript (ages 12 and up)

When students are ready for typed code, JavaScript is the natural next step because every web browser runs it. Free beginner-friendly options include:

  • p5.js: a creative coding library that makes drawing shapes and handling input simple.
  • Phaser: a popular open-source framework for 2D browser games, with maps, sprites and physics.
  • HTML canvas: building directly with plain JavaScript, for students who want to understand everything from scratch.

A great milestone is rebuilding the Scratch city in JavaScript. Students see how the same ideas (loops, variables, events) translate into “real” code.

Free art and sound

Students can draw their own sprites, which is encouraged. They can also use free, openly licensed game art from sites such as Kenney and OpenGameArt, as long as they follow each licence.

A note on safety

Keep student projects single-player or limited to friends and classmates. Online chat with strangers is not needed to learn game design, and it is one reason games like Lagos Life are set at 18+.

How our classes help

At Tokyo STEM School, we teach coding through projects just like this one. Students build games, apps and robots step by step, with instructors who guide them from their first Scratch blocks to real JavaScript.

Our programs are designed for young learners across Tokyo and online. If your child would love to build their own city game, register your interest and we will share upcoming class details.

Frequently asked questions

What age can a child start building games?

Many children can start with Scratch from around age 8. Typed JavaScript usually suits ages 12 and up, depending on the child.

Do students need to install anything?

No. Scratch and many JavaScript tools run in a web browser, so a laptop or Chromebook with internet access is enough.

Is Lagos Life suitable for children?

No. Independent guides citing its terms say players must be 18 or older. Building your own game is a safer and more creative alternative for younger students.

Sources

Featured image: Photo by UK Black Tech on Unsplash.

Comment