Browser game with AI: illustration of code turning into a yellow danfo game running in a web browser, with a bus stop, coins and a leaderboard

Danfo Run took one engineer four to five weeks of evenings. Lagos Life’s first version took about eight hours. Both were built with AI and run in a web browser with no download. Danfo Run passed 140,000 players in a week, and Lagos Life passed a million in three days, by their creators’ counts (UrbanGeekz). Here’s how to build a browser game with AI the same way, what it costs and what to fix before you share the link.

TL;DR

  • You can start for free: a free AI assistant, a free code library and free hosting.
  • Build one small loop that looks like home, then grow it with players’ feedback.
  • Before you go viral, plan for traffic, cheating and the move to paid hosting if you sell ads.
  • We followed these steps to build Jollof Express: playable in about 15 minutes, and finished in about five hours of build time. Our results are below.

What Danfo Run and Lagos Life actually used

Opeyemi Adeniran built Danfo Run after work over four to five weeks, using AI tools including Anthropic’s Claude, plus AI-generated graphics. The game is hosted on Vercel, and its leaderboards run on a server in Frankfurt with an Upstash database, UrbanGeekz reported. Progress is saved in the player’s browser, and a service worker lets it load fast and work offline (Technext).

Shalom Rayhamen “leaned heavily on AI” for Lagos Life, and the first version was playable after roughly eight hours of coding, according to UrbanGeekz. She now uses AI agents to catch bugs and prioritise feature requests.

Adeniran explains why he chose the browser: “On platforms, the web is our home because it’s the fastest way to reach people: a link, no download.” For developers, he added, “there’s no review queue and no store fees, and when you fix something, every player gets it instantly” (Bijetic).

What it costs to make a game with AI

WhatExampleCost (checked 12 November 2026)
AI assistant that writes codeClaude, or another AI coding assistantFree plan with limits; Claude Pro is $20 a month and includes Claude Code (Anthropic)
Game code library (optional)Three.js for 3D, Phaser for 2DFree and open source. You can also skip a library: plain JavaScript and the browser’s canvas are enough for a simple game
HostingVercel, Cloudflare (Pages or Workers) or GitHub PagesVercel’s Hobby plan is free but for personal, non-commercial use; Pro is $20 a month (Vercel). Cloudflare Workers is free up to 100,000 requests a day; paid plans start at $5 a month (Cloudflare)
Leaderboard database (optional)Upstash Redis or Cloudflare D1Upstash: free up to 500,000 commands a month, then $0.20 per 100,000 (Upstash). D1: free up to 5 million row reads and 100,000 row writes a day (Cloudflare)

Prices are in US dollars, so what you pay in naira, cedis or shillings moves with the exchange rate. Start on free plans and upgrade only when players arrive.

How to build a browser game with AI in six steps

1. Pick one loop you can explain in a sentence

Danfo Run’s loop is simple: drive a danfo from Ojuelegba to Yaba, pick up passengers and drop them at their stops to get paid (Danfo Run). Write yours down before you open the AI tool. If you can’t say it in one sentence, it’s too big for a first version.

2. Ask the AI for something playable, not something perfect

Describe the loop, the controls and the screen, and ask for a single web page you can open in your browser. Then play it and ask for one change at a time. Open the file in your phone’s browser too, not just in the AI tool’s preview, because some bugs only show up there. An example prompt (ours, not Adeniran’s):

Build a browser game in one HTML file using Phaser. I drive a yellow minibus along a busy Lagos road. Arrow keys steer. Passengers wait at bus stops; stop next to them to pick them up and at their stop to drop them off for ₦200 each. Okadas cut in front of me; hitting one costs ₦100. Show my money top-left. Keep the code simple and commented.

3. Make it look like home

The details are why people share these games. Danfo Run runs on a real Lagos route, and players can tune in to public streams of real Lagos radio stations (Technext). Lagos Life’s map includes Amala Shitta and Quilox (Charge Africa). Use places, prices, slang and sounds your players know. Only use music, logos and photos you have the right to use.

4. Save progress on the player’s phone

You don’t need accounts at the start. Ask the AI to save progress in the browser (local storage) and to add a service worker so the game loads fast and works with a weak connection, as Danfo Run does. No sign-up means more people play.

Upload the files to Vercel, Cloudflare or GitHub Pages and you get a web address in minutes. Adeniran shared his with one post on X:

6. Add a leaderboard when people ask for one

Leaderboards and shared worlds need a server and a database, which is where costs and cheating start. Add them after people are playing, not before. Danfo Run shipped fixes from replies on X, such as clearer bus-stop markers (Technext).

We tried it: how we built Jollof Express with AI

To check this guide works, we followed it ourselves. Jollof Express, a food-delivery game set in Lagos traffic, went from idea to a live link in a few hours. The first playable version took about 15 minutes. Everything since, from the 3D view to six cities, a leaderboard and a second game, Lifeline, has taken about five hours of build time in total, over two sittings on 12 and 13 November. Precious directed and tested; Claudia, our AI editor, wrote the code. Here is what each step looked like, and what we got.

Step 1: one sentence

Ours: ride a delivery okada through Lagos go-slow, keep the battery alive and see how far you get. We picked it from three ideas because anyone in Lagos gets it in a second.

Step 2: something playable, fast

We described the loop, the controls and the screen in plain English. No code, no design file. About 15 minutes later we had a playable page: a top-down road, a battery meter and things to dodge. It was rough, but it worked, and that is the point of a first version.

Building a browser game with AI: two phone screenshots of Jollof Express: a plain top-down road in the first version, and a 3D Lagos street with a delivery rider chased by agberos after a day of changes
Left: our first playable version. Right: the same game a few hours of changes later.

Step 3: play it, then ask for one change at a time

We played, wrote down what felt wrong and asked for one change at a time. That has taken more than 50 rounds so far. The changes that made the biggest difference:

  • A camera behind the rider. The top-down view was fine; a 3D chase view made it feel like a real game.
  • Traffic that moves. Danfos, kekes, molues and other okadas drive at their own speed, so you overtake them instead of dodging parked boxes.
  • Second chances. Potholes and side-swipes cost health instead of ending the ride. Only riding into the back of a vehicle stops you dead.
  • Clear pick-ups. Charge points, nitro cans and a mechanic, each labelled the first time you see it, plus a red warning when the battery is low.
  • Home. The Lekki–Ikoyi Link Bridge before the first checkpoint, Third Mainland and other lagoon bridges later, rain and harmattan haze, agberos chasing you off the start line, cash at every checkpoint and Pidgin crash lines (“You jam danfo. Your food don pour.”).
Three phone screenshots of Jollof Express: riding over the Lekki–Ikoyi Link Bridge, a rainy road, and a crash with food spilled on the road
What a few hours of small changes add up to: the Lekki–Ikoyi Link Bridge, random weather and a crash that spills the food.

One lesson: when something feels off, describe what you saw and ask the AI for the cause before asking for a fix. Precious ran out of battery after grabbing every charge point. The cause was that the game decided where to put charge points based on the battery you had a long way back down the road. Fixing the cause took one change. Raising the battery would only have hidden it.

Step 4: save on the phone

Your best distance and your wallet of delivery fees are saved in your browser, and the game keeps working on a weak connection once it has loaded. No sign-up needed to play.

Charge Africa already runs on Cloudflare, so we hosted there rather than on Vercel. One small Cloudflare Worker serves the game, and a Cloudflare D1 database holds the leaderboard. Both have free plans: Workers allows 100,000 requests a day, and D1 allows 5 million row reads and 100,000 row writes a day (Cloudflare). The address, play.charge.africa, is now home to our games.

The Charge Africa Play homepage, with a card for Jollof Express and two coming-soon slots
play.charge.africa, our home for games. Two more are coming.

Step 6: a leaderboard, without making people sign up first

You can ride straight away. After a ride you can save your score with a username and password, or skip it. The server, not the player’s browser, decides whether a score counts: each ride is registered when it starts, can be saved only once, and the distance has to be possible in the time ridden. Passwords are never stored, only scrambled versions of them.

What we would do differently: test on a cheap Android phone on day one. Detailed 3D looks great on a laptop and is heavy on a budget phone, so the game now lowers its own graphics quality when a phone struggles.

Play it: play.charge.africa/jollof-express. Beat our best and send us your score.

Before you post the link

  • Plan for traffic. Lagos Life went down on 2 October, its second day, and gave every player ₦100,000 in virtual cash as an apology (Techpoint Africa). Check your host’s free limits and know how you’ll upgrade.
  • Expect cheating. An exploit let some Lagos Life players create balances running into trillions of virtual naira (Technext). Never trust scores sent from the player’s browser without checking them on your server.
  • Don’t collect what you can’t protect. If you ask for emails or phone numbers, Nigeria’s Data Protection Act applies. Ask only for what you need.
  • Read the code before you trust it. AI writes code fast, but you’re responsible for what it does, especially anything that touches money or personal data.

Getting paid

Both games make money from what happens inside them, not from charging players. Lagos Life rented virtual billboards from ₦5,000 a week at launch (Techpoint Africa). Danfo Run now sells road boards from ₦20,000 a week (Danfo Run). Once you sell ads, you’re a business: Vercel’s free plan is for non-commercial use, so budget for a paid plan.

Building a game with AI: common questions

Can you build a browser game with AI without coding?

Yes, at least to a first playable version. We described Jollof Express in plain English, with no code and no design file, and had a playable page in about 15 minutes. You still need to test what the AI writes and read the code before you trust it, especially anything that touches money or personal data.

How long does it take to make a game with AI?

Our first playable version took about 15 minutes. Two finished games, Jollof Express and Lifeline, took about five hours of build time in total. Lagos Life’s first version took its creator about eight hours, and Danfo Run took one engineer four to five weeks of evenings, according to UrbanGeekz.

How much does it cost to build a browser game with AI?

You can start for free. AI coding assistants have free plans with limits (Claude Pro is $20 a month), game libraries such as Three.js and Phaser are free, and Cloudflare Workers hosts a game free for up to 100,000 requests a day, with paid plans from $5 a month. Prices were checked on 12 November 2026.

Where can I host a browser game for free?

Vercel, Cloudflare and GitHub Pages all have free options. Vercel’s free Hobby plan is for personal, non-commercial use, so once your game sells ads, budget for a paid plan.

Can a browser game make money in Nigeria?

Yes, through ads inside the game. Lagos Life rented virtual billboards from ₦5,000 a week at launch, according to Techpoint Africa, and Danfo Run sells road boards from ₦20,000 a week.

What’s next

Built a browser game with AI? Send the link to [email protected]. We’re keeping a running list of African browser games. Catch up on the series: how Danfo Run helped spark the wave, how Lagos Life eclipsed them all and the games that followed.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Omeife; Africa’s First Humanoid Robot. Here’s all we know

Table of Contents Hide The NewsA closer look at OmeifeSo, what exactly…

How Danfo Run helped spark Nigeria’s browser-game wave

A Berlin-based Nigerian engineer’s free danfo game spread worldwide in days, and set off Nigeria’s browser-game wave.

Lagos Life: how a game built overnight eclipsed them all

Shalom Rayhamen built Lagos Life in one night. Nine days later her company had raised $500,000. Here’s what’s verified, and what isn’t.

Games like Lagos Life: the best-looking ones, and who built them

We opened 12 games that followed Lagos Life. Here are the best-looking ones, who built them and what each adds.