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 a game like Plants vs. Zombies

Lane defense is tower defense with the path removed: enemies walk straight down rows, and every decision is what to place, where, and when you can afford it.

Startbase Team
Editorial ink illustration of a garden bed divided by string lines with clay pots along the rows, the watering can in ember orange

Key takeaways

  • A lane game is a grid: a few rows, enemies walk straight along them, defenders sit in cells. The simplicity makes every placement readable.
  • The economy is the real game. A trickle of currency plus defenders that generate more creates an early choice between greed and safety.
  • Costs and cooldowns together stop players spamming the best defender. Its name, characters, art, humor and levels belong to its owner.

Lane defense, the genre Plants vs. Zombies made famous, works like this: the play field is a grid of horizontal rows, enemies enter from the right and walk straight down their row toward your side, and you place defenders in grid cells to stop them. A currency trickles in over time (and some defenders produce more of it), every defender has a cost and a recharge time, and waves get bigger until a final wave ends the level. Build the grid, the economy and five or six well-differentiated units and you have the core.

Plants vs. Zombies, its plant and zombie characters, its art, its humor, its music and its levels belong to its owner. Lane defense is a wider genre built on tower defense ideas. Your game needs its own theme and units; a different setting will also help yours stand out in a crowded genre.

Why lanes make strategy readable

  • No pathfinding to read. Every enemy goes straight, so the player sees threats row by row.
  • Placement is permanent and visible. Your defense is a picture you built, and its holes are obvious.
  • The economy forces choices. Spend on income now and risk an early leak, or defend first and grow slower.
  • Short levels. Three to six minutes, each introducing one new unit or enemy.

The grid and the data model

Start with 5 rows by 9 columns as a reference size, then pick your own. Fewer rows (4) suits small phone screens in landscape; more columns gives enemies time to walk. Each cell holds at most one defender.

  • Defender: `{ type, row, col, hp, cooldownLeft, level }`.
  • Enemy: `{ type, row, x, hp, speed, state: "walking" | "attacking" | "slowed" }`. Enemies use a continuous x position inside their row; collision only checks defenders in the same row.
  • Projectile: `{ row, x, speed, damage, effect }`. Projectiles also stay in their row, which keeps collision trivial.

Because everything is row-based, you never need full 2D collision: compare x positions within a row. That makes it cheap to run dozens of enemies on a phone. The grid-based movement guide covers snapping placement to cells.

The economy: numbers to start from

Pick your own currency scale; what matters is the ratios. One working set, in units of 10:

  • Starting currency: enough for one generator and one cheap defender, for example 120.
  • Passive trickle: a pickup worth 20 appears every 9 seconds or so; the player taps it to collect. Tapping pickups gives the player something to do during quiet moments.
  • Generator unit: costs 60, produces 15 every 18 seconds. It pays for itself in four cycles (a little over a minute), which is the greed decision: two generators early is strong only if your front holds.
  • Unit costs: a cheap attacker at 80, a blocker at 40, a heavy at 160, a one-shot area unit at 120.
  • Cooldowns: short for cheap units (5 to 8 seconds), long for powerful ones (30 to 45 seconds). Cooldown, not cost, is what stops players spamming blockers or bombs.

Tip

Put every cost, cooldown and income value in a dial. Balancing a lane game is mostly moving these numbers by 10 percent and replaying the same level.

Designing units and enemies

Think in roles, not in copies of famous units. Every lane game needs answers to the same few questions, and your theme decides how each answer looks and behaves:

  • Income: something that makes currency and is worth protecting.
  • Steady damage: the backbone of each row.
  • Delay: anything that buys time, by blocking, slowing, pushing back or freezing.
  • Burst: a costly, rare answer to a crowd.
  • Counters: units that exist because a specific enemy exists.

Then design enemies as questions for those answers: one tougher than steady damage can handle, one fast enough to punish an empty row, one that changes rows, one that splits when hit, one that heals its neighbors. Introduce one per level with a short "new enemy" card, and give each a silhouette and walking speed you can read from across a room. The tower defense guide covers damage types and counters more broadly.

Waves and the last line

A level is a wave table: a quiet start (one walker every 15 to 20 seconds for the first minute so the player can build income), a steady build, a "big wave" warning halfway, and a final wave. Spread enemies across rows with a rule that no row gets more than two in a row early on. The enemy waves and spawners guide shows wave tables as data.

Decide how forgiving a leak is. Instant loss on the first enemy through is harsh for new players; a small life pool (three leaks per level) or a one-time emergency action the player triggers by hand keeps the first mistake dramatic instead of final. Whatever you choose, make the left edge of every row unmistakable.

Progression between levels

Award one new unit per level for the first ten levels. Before each level, show the incoming enemy types and let the player choose a loadout of six or seven units from everything they own: choosing the loadout is a strategy layer in itself. Later, mix in special level rules (night with no passive trickle, a fog that hides the right half, a conveyor that hands you random units). The upgrades and progression article covers pacing new content.

Three twists that make it yours

  1. 01Defenders that move. Units can be slid one row up or down for a small cost, so the defense becomes active instead of set-and-watch.
  2. 02Lanes that merge. Some rows join halfway, so enemies from two rows combine into one, and placement around the junction matters.
  3. 03Day and night halves. Each level flips halfway, and every unit has a day and a night ability. Your layout has to work twice.

A brief to paste into Startbase

A 2D lane defense game for phones (landscape) and desktop with a cozy picnic theme. The field is a checkered picnic blanket of 6 rows by 8 columns, and rows 2 and 3 merge into one halfway across, as do rows 4 and 5. Bugs enter from the right and walk along their row toward a picnic basket on the left. The player places kitchen gadgets in cells: a toaster that pops out a crumb (currency, worth 15) every 18 seconds, a pepper grinder that fires along its row, a honey jar that sticks the first bug in place for 3 seconds, a desk fan that pushes bugs back one cell every few seconds, an ice tray that freezes a whole row once, and a salt shaker that sprinkles the two cells in front of it. Crumbs worth 20 also drop every 9 seconds; tap to collect. Each gadget has a cost and a recharge time. Bugs: ant, armored beetle, fast fly, caterpillar that splits into two small ones when hit, ladybug that heals bugs beside it, and a slow giant snail. Gadgets can be slid to an adjacent row for a small cost. Three bugs reaching the basket loses the level. 10 levels, one new gadget or bug per level, a loadout screen before each level, and a big wave warning halfway. Expose costs, recharges and bug speeds as dials.

Publish it with one click and share it to the Arcade. If you prefer a ready brief for a path-based defense game, the tower defense prompt is a sibling.

Common mistakes

  • A dominant unit. If one unit answers everything, raise its cost or cooldown, or add an enemy that counters it.
  • Fast openings. Players need a minute to build income before pressure arrives.
  • Unreadable enemies. Each enemy needs a distinct silhouette and walking speed you can tell apart at a glance.
  • Tap targets too small. On phones, cells must be big enough to place a unit without hitting the neighbor.

Frequently asked questions

What is the difference between lane defense and tower defense?

In tower defense, enemies follow a path and you build towers along it. In lane defense, enemies walk straight down fixed rows and you place defenders directly in their way on a grid.

How do I balance a lane defense economy?

Start with a passive trickle plus a cheap generator unit that pays for itself in two cycles, then tune costs and cooldowns so players can afford one meaningful purchase every 10 to 20 seconds.

Can I make a plants and zombies game too?

That theme is strongly associated with one game, and its characters and art belong to its owner. A different theme is safer and helps your game stand out.

How many units does a lane defense game need?

Six well-differentiated units and six enemy types are enough for a satisfying first ten levels. Add more once those are balanced.

On this page

  • Why lanes make strategy readable
  • The grid and the data model
  • The economy: numbers to start from
  • Designing units and enemies
  • Waves and the last line
  • Progression between levels
  • Three twists that make it yours
  • A brief to paste into Startbase
  • Common mistakes

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 tin wind-up runner on track pieces laid down ahead of it, the next track piece in ember orange
GamesNovember 22, 2026

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.

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.