Skip to content
Loopfunder
Build a game with AI

How to Build a Game with Replit

How to build a game with Replit Agent, step by step, from the first prompt to a published link, with what the free plan covers and where the limits are.

By The Loopfunder Team · · 9 min read

Replit is one of the easiest places to make a first game with AI. It runs in your browser, so there is nothing to install. You describe the game in plain language, an AI agent writes the code, and a preview shows the result next to the chat. When it works, you publish it to a link.

This Replit tutorial is for people who can describe an idea but have never built a game. It covers choosing a plan, writing prompts that produce a playable game, testing in the preview, publishing, and the limits you will run into. Plans and features were checked against Replit's documentation on November 14, 2026.

What Replit is good for

Replit describes its approach as a loop: "You can describe an idea, preview the result, give feedback, make changes, and publish from the same place" (Vibe coding 101). The same page says "You do not have to be a developer to start building."

For games, Replit's own page lists "2D platformers, endless runners, puzzle games, racing games, or interactive stories" and promises "No engine to learn." Those are sensible targets. Small games that run in a web page are where it works best.

It is less suited to large 3D worlds, online multiplayer and anything that needs a traditional game engine's editor. More on those limits below.

Step 1: Pick a plan

Plan Price What matters for games
Starter Free Daily AI credits up to a monthly cap. One free published app, and the link "will automatically go down after 30 days."
Core $20 a month, or $18 a month billed annually Needed for the 3D game project type, planning mode and removing the "Made with Replit" badge.
Pro $100 a month, or $90 a month billed annually Aimed at commercial and professional builds.

Start on the free plan. It is enough to find out whether you enjoy working this way. Replit does not publish the exact number of free daily credits, so expect to run out partway through a longer session and pick up the next day.

One detail matters straight away. Replit projects come in types, which it calls artifacts, and one of them is "3D game." On the free plan, though, "building artifact types other than web and mobile apps requires Core." So on Starter, build your game as a Website. A browser game is a website, and this works fine for 2D games and simple 3D ones.

Step 2: Write down the game before you prompt

Five minutes of thinking saves an hour of back-and-forth. Decide:

  • The game in one sentence. "Steer a paper plane through a cave and collect stars."
  • The controls. Arrow keys, mouse, touch.
  • How you win or lose. Hit a wall and it is over. Score counts stars.
  • What it looks like. Simple shapes are fine to begin with.
  • What you are not building yet. No levels, no sound, no menus.

That last point follows Replit's own first-app guide, which recommends a five-part recipe: describe one useful outcome, add observable success criteria, set boundaries for what not to build yet, test in Preview, and ask for one focused improvement.

If you want a fuller plan, our game design document template fits on one page.

Step 3: Start the project

  1. Sign in at replit.com and start a new chat with Agent.
  2. Choose Website as the project type. Replit's guide says that if the prompt box shows "Output," open it and select Website.
  3. Open the mode selector and choose Free. Free Mode is available on the Starter, Core and Pro plans and picks the AI model for you.
  4. Paste your first prompt.

Replit used to offer starter templates for game libraries. Those have been retired: its docs say the old templates pages "now redirect to the Replit Gallery," and the first alternative listed is "Start with Replit Agent." Older tutorials that tell you to pick a game template are out of date.

Step 4: Write a first prompt that produces something playable

Replit's prompting guide makes two points that matter most for games: plan first, and build incrementally. A request for a complete game in one go usually produces something half-working. A request for the smallest playable version usually works.

Here is a first prompt you can adapt.

Prompt
Build a small browser game as a single web page using HTML, CSS and JavaScript with a canvas. No frameworks and no external assets.

The game: the player steers a paper plane through a side-scrolling cave and collects stars.

Controls: hold the spacebar or mouse button to rise; release to fall.

Rules:
- The cave walls scroll from right to left at a steady speed.
- Touching a wall ends the run.
- Each star collected adds 1 to the score shown at the top left.
- After a crash, show the score and "Press R to restart".

Looks: simple flat shapes. A white triangle for the plane, grey walls, yellow stars, dark blue background.

Do not build yet: menus, sound, levels, high-score saving.

Done when: I can play in the preview, crash, see my score and restart without reloading the page.

Notice what it contains: one outcome, exact controls, rules with specifics, a plain look, a list of what to leave out, and a clear test for done.

Agent will write the code and open the result in the preview.

Step 5: Play it in the preview and give feedback

The Preview pane is a live view of your game with logs and screen-size options. Play the game properly. Try to break it.

Then give feedback the way Replit's guide recommends for debugging: say exactly what happened. Compare these two:

  • Weak: "The game is broken."
  • Strong: "When I hold space, the plane rises too fast and leaves the top of the screen. Limit it so it cannot go above the top edge, and make it rise at half the current speed."

Change one thing per message. If you ask for five changes at once and something breaks, you will not know which one caused it.

Good follow-up prompts, in a sensible order:

Prompt
The core game works. Now make three changes, one at a time, and tell me after each so I can test:

1. Make the cave get narrower slowly, so the game gets harder the longer I survive.
2. Add a start screen with the game's name and "Press space to start".
3. Save the best score in the browser so it is still there when I come back.

A note about the preview link. Replit's docs say development URLs are "private by default and require authentication" and "intended for testing only." You cannot send that link to friends. For that you need to publish.

Step 6: Add the things that make it feel like a game

Once the loop is fun, add polish in small steps:

  • Feedback. A flash when you collect a star, a shake when you crash.
  • Sound. Ask for simple generated sound effects so there are no audio files to manage.
  • Difficulty. Speed that increases, or new obstacles over time.
  • Art. Replace the shapes with images. You can upload your own files to the project.
  • Mobile controls. Ask for touch support and test using the preview's screen-size options.

If you want to save scores for all players, Replit includes a database. Its docs use a game as the example: "a game that needs to save player information such as progress or high scores" (storage and databases). A shared leaderboard is a good second project, once the game works on its own.

Step 7: Publish

Publishing puts your game on a public web address ending in .replit.app. You can choose who has access, including public or password protected, and Replit runs a security scan first.

What to know about cost:

  • On the free plan you get one published app, and its link goes down after 30 days. That is long enough to share it and collect reactions.
  • On paid plans hosting is billed by usage. Replit's default hosting type goes idle after 15 minutes without visitors, which keeps costs low for a small game. Replit's own pages disagreed on the exact base fee when we checked, so look at the price shown in the product before you publish.
  • You can connect your own domain name if you have one.

To keep a free game online for longer, you can also move the code elsewhere. Replit has a Git panel that connects to GitHub, and a simple browser game can be hosted on sites such as itch.io.

The limits

Free credits run out. Agent usage is metered, and long sessions on the free plan will hit the daily limit. Short, specific prompts stretch it further.

Multiplayer is not a beginner project. We did not find an official Replit guide to real-time multiplayer games. It can be built, but it needs an always-on server, which costs more, and far more testing. Make a single-player game first.

Asset quality is on you. Agent writes code. It will draw simple shapes, but good art, music and animation have to come from you, from free asset libraries, or from other AI tools.

Big games get hard to steer. As a project grows, the AI has more to keep track of and mistakes become more likely. Replit's vibe coding principles are a good defence: build in small slices, manage context, review and test.

It will say it is done when it is not. Always play the game yourself after every change.

When to move beyond Replit

Replit is a fine place to stay for a small browser game. Consider other tools when:

For the whole process from idea to finished game, including story, characters and branding, read how to build a game with AI.

After the prototype: give it a home

A Replit link is a game. It is not yet a project people can follow. Once the game is playable, you need somewhere that explains what it is, shows what it could become, and lets interested people keep up with it.

That is the job of a project page. On Loopfunder you can turn the idea into concept art and a plan, publish a page, link your playable build, and gather followers while you keep improving it.