Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GamesNovember 22, 20266 min read

How to Make an Endless Runner Game

An endless runner is a level generator with a character on top. Get the chunks, the speed curve and the controls right and the rest is art.

Startbase Team
Editorial ink illustration of a tin wind-up runner on track pieces laid down ahead of it, the next track piece in ember orange

Key takeaways

  • Generate the course from hand-made chunks tagged by difficulty, not from random single obstacles. Chunks are fair by construction.
  • Raise speed on a curve that flattens and caps, and widen gaps as speed rises so reaction time stays roughly constant.
  • One thumb, one or two gestures, and a restart in under a second. Runners are played in short bursts.

An endless runner is made of three systems: a course generator that stitches pre-built chunks together as the player moves, a speed curve that ramps difficulty and then levels off, and controls simple enough for one thumb. Build those three, add a score and an instant restart, and you have a complete game. You can describe all of it to an AI builder in one brief, then spend your time tuning the numbers below by playing.

Pick your runner shape first

Runners come in two main shapes, and the choice changes the controls, the chunks and the art.

  • Side-scrolling runner (the Canabalt and Jetpack Joyride family): the character moves right, the player jumps, double-jumps, or holds to fly. It is a 2D game and the cheapest to make look good.
  • Lane runner (the Subway Surfers and Temple Run family): the camera sits behind the character, there are usually three lanes, and the player swipes left, right, up to jump and down to slide. It is usually 3D, needs a camera and lighting, and reads well on tall phone screens.

If this is your first game, start with a side-scroller. You will get the generator and the speed curve right faster, and those transfer to a lane runner later.

Chunk-based generation, explained

Spawning random obstacles one at a time sounds simple and produces impossible situations: a spike right after a gap, two barriers a jump apart at high speed. The fix used by most shipped runners is chunks: short, hand-designed pieces of course, each one known to be beatable, chained together at random.

What a chunk is

  • A strip roughly one to two screens wide, with its obstacles, coins and pickups placed by a person.
  • A difficulty tag (1 to 5, say) and a list of the speeds it is fair at.
  • An entry and exit height (or lane) so the next chunk always connects. If a chunk ends on a high rooftop, the next one starts on a rooftop or with a drop the player can survive.
  • Optional tags such as “breather” or “coin trail”, so the generator can follow a hard chunk with an easy one.

The generator keeps a short queue: whenever the right edge of the last placed chunk comes within one screen of the camera, it picks the next chunk from the pool allowed at the current difficulty, avoids repeating the previous two, and places it. Chunks that scroll off the left edge are recycled rather than destroyed (object pooling), which keeps phones from stuttering as the run gets long. The procedural generation basics guide covers seeds and fairness checks for chunk pools.

Twenty to thirty chunks is enough for a game that feels varied for the first dozen runs. Fifty feels rich. On Startbase you can build chunks visually: ask the agent to set up each chunk as its own level so you can lay it out in the World Editor, then ask it to load those levels as the chunk pool.

The speed curve

Speed is the difficulty knob of a runner. A linear increase (add a fixed amount every second) feels fine for a minute and then becomes unplayable. Use a curve that rises quickly at first and flattens, with a hard cap:

  • Start speed: slow enough that a new player survives the first 10 to 15 seconds without trying hard.
  • Growth: for example, speed = start × (1 + 0.6 × (1 − e^(−distance ÷ 1500))). It climbs fast early and approaches 1.6 times the start speed.
  • Cap: a maximum speed you have actually played at and survived. Beyond the cap, difficulty comes from harder chunks, not more speed.
  • Steps you can feel: some runners raise speed in visible steps every 500 meters with a short whoosh and a color shift. Players like knowing they reached the next stage.

The part most first runners miss: gaps must grow with speed. The player needs a roughly constant reaction time (about 0.4 to 0.6 seconds from an obstacle appearing to the moment they must act). At double speed, the same chunk gives half the reaction time. Either scale the spacing of each chunk by the current speed or only allow wide chunks above a speed threshold. Ask for the camera to zoom out slightly as speed rises, too: more visible course, same reaction time. The game camera guide shows how to give fast runners more view ahead.

One-thumb controls that feel instant

  • React on touch down, not on release. A tap that waits for the finger to lift feels laggy by a tenth of a second.
  • Hold for height. Tap for a short hop, hold for a full jump (cut upward speed on release). One button, two moves.
  • Buffer inputs. A jump pressed 0.1 seconds before landing should still happen on landing. Same for a swipe pressed mid-air in a lane runner.
  • Swipes need thresholds. A swipe is about 30 to 50 pixels of movement within a fraction of a second; anything shorter is a tap. Decide direction by the larger axis.
  • The whole screen is the button. Do not make players hit a small target while things fly at them.

Tip

Test the controls on a phone in the first hour. A runner that feels perfect with a spacebar can feel sluggish with a thumb, and you want to know before you build 30 chunks around a jump you will change.

The brief to paste

A 2D side-scrolling endless runner, portrait friendly, for phones first. A paper-plane courier dashes across city rooftops at night. Tap anywhere to jump, hold for a higher jump, tap again in the air for one double jump. The course is built from hand-made chunks (about 20 to start), each tagged with a difficulty from 1 to 5 and an entry and exit height, chained so heights always connect. Speed starts gentle, rises on a curve that flattens, and caps at 1.6 times the start. Gaps in each chunk scale with speed. Coins on arcs between rooftops. Score is distance plus coins. On death: a short slow-motion beat, then the score, best score and a big Run again button. Run again restarts in under a second. Expose start speed, max speed, jump height and gravity as dials.

Score, pickups and reasons to return

Distance is the honest score. Coins add a second goal on top of survival: going for a risky coin arc is the interesting decision in a runner. Keep power-ups few and readable (a magnet, a shield that absorbs one hit, a short boost) and give each a distinct silhouette and sound.

For return visits, a best score saved on the device is the minimum. A daily seed (everyone gets the same chunk sequence today) gives friends something to compare. Missions like “collect 50 coins in one run” stack nicely on top. If you want scores shared across devices, attach Startbase Cloud and ask for a daily table of best runs. The leaderboards guide covers daily tables and how to keep them fair.

Where runners go wrong

  • Unfair seams. A chunk that ends with a jump into a chunk that starts with a wall. Tag entries and exits, and test chunk pairs at top speed.
  • Off-screen threats. Anything that can kill the player must be visible for the full reaction time.
  • Slow restarts. A results screen with three buttons and an animation kills the “one more run” loop. Restart should be one tap.
  • Long-run drift in 3D. After many minutes of running forward, position numbers get large and physics jitters. Move the world back toward the origin periodically instead of moving the player forever.
  • Ramping too fast. If most deaths happen in the first 20 seconds, your start speed or first chunks are too hard. New players need a win before they need a challenge.

Once the run is fun, publish it and put it in the Arcade, where short sessions are exactly what players are looking for. If you want to compare the runner to a platformer with hand-built levels, the platformer guide covers jump feel in more depth.

Frequently asked questions

How do endless runners generate levels?

Most use chunks: short sections designed by hand and chained together at random, filtered by difficulty and matched at their edges so every combination is beatable. Pure random obstacle spawning tends to create impossible patterns.

How fast should an endless runner speed up?

Quickly at first, then slower, with a hard cap. Many runners end up somewhere around 1.5 to 2 times their starting speed. Past the cap, raise difficulty with harder chunks rather than more speed.

Should my runner be 2D or 3D?

A 2D side-scroller is quicker to build and tune. A 3D lane runner looks impressive on phones but needs camera, lighting and more art. Prototype the 2D version if you are unsure.

Can I publish an endless runner for free?

Yes. Startbase publishes web games in one click on every plan, so players open your runner from a link on any phone with no install.

On this page

  • Pick your runner shape first
  • Chunk-based generation, explained
  • The speed curve
  • One-thumb controls that feel instant
  • The brief to paste
  • Score, pickups and reasons to return
  • Where runners go wrong

Keep reading

More in Games
Editorial ink illustration of a wooden toy figure jumping between two stone ledges, the coin above the gap in ember orange
GamesNovember 22, 2026

How to Make a Platformer Game with AI

A platformer lives or dies on its jump. Here are the numbers behind a jump that feels fair, how to build levels around it, and how to get an AI agent to build both.

7 min read
Editorial ink illustration of a wooden turret beside a winding path of marching beetles, the turret's cannonball in ember orange
GamesNovember 22, 2026

How to Make a Tower Defense Game

Tower defense is a spreadsheet you can play. Here is how to set up the path, the waves, the towers and the money so the spreadsheet is fun.

6 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.