In Plants vs. Zombies, players place different types of plants and fungi, each with their own unique offensive or defensive capabilities, around their house, in order to stop a horde of zombies from reaching it. The playing field is divided into 5 to 6 horizontal lanes, each with lawnmowers, and with rare exceptions, a zombie will move towards the player's house along one lane only (the main exception is if it has bitten a garlic, causing it to move to another lane). Planting costs "sun", which can be gathered for free (albeit slowly) during daytime levels and by planting certain plants or fungi. Most plants can attack or defend against zombies in the lane they are planted in only. In later levels, players can purchase upgrades with different offensive and defensive abilities.
The game uses several different level types and layouts, each with their own gimmick. The game starts out in a front yard (the standard) and progresses to nighttime levels (sun won't be able to be gathered for free), where the gameplay is more challenging without any replenishing sun unless specific plants are used. Other levels feature the backyard, with a pool added (in general more to cost). Later levels are nighttime pool levels (where fog fills the right half of the screen except when specific plants are used), a lightning storm level in pitch black (except when illuminated by occasional flashes of lightning), and rooftop levels (where a slanted roof renders most offensive plants useless). On the final level, the player must face a huge robot operated by a zombie who takes the form of a mad scientist known as Dr. Zomboss. At set points throughout the game, the player is either warned through a letter by zombies or addressed by their neighbour, Crazy Dave, to prepare for an ambush, where the game takes on a bowling style, using Wall-nuts to bowl down zombies, or a modified version of regular levels, where random plant types come upon a conveyor belt, and the player can use the plants without spending sun.
The player starts with a limited number of seed pack types and seed pack slots that they can use during most levels. The number of slots can be increased through purchases with in-game money. At the start of a level, the player is shown the various types of zombies to expect and given the opportunity to select which seed packs to take into the level. Several plants are nocturnal, such as mushrooms, have a lower sunlight cost, and are ideal for nighttime levels. Certain plants are highly effective against specific types of zombies, such as the Magnet-shroom, which can remove metallic items from a zombie, such as helmets, buckets, ladders, and pogo sticks. Plants may be placed on any available square of lawn, on lily pads floating in a pool, or in flowerpots on a rooftop; these last two items may be chosen as a seed pack for their respective level types and deployed to increase the usable planting space.
The zombies also come in a number of types that have different attributes, in particular, speed, damage tolerance, and abilities. Zombies include those wearing makeshift armor, those who can jump or fly over plants, and a dancing zombie able to summon other zombies from the ground. At various points, the player will be inundated with a huge wave of zombies.
If a zombie reaches the end of a lane, a lawnmower will shoot forward and destroy all the zombies in that lane. However, if a zombie reaches the end of that same lane for a second time, it will reach the player's house. When this happens, the music changes and the other plants and zombies stop moving while that zombie enters the house. Crunching sounds will be heard, accompanied by a scream and a message saying "The zombies ate your brains!". The game will then end and display the Game Over dialog box along with an option to retry the level or return to the main menu at the upper-right side of the screen.
Game modes
The primary game mode is Adventure Mode in which the player can earn money to spend at an in-game store to buy new seed packets and other bonuses. There are also mini-games and puzzles. In the Xbox Live Arcade, PlayStation Network, and Nintendo DS versions, there is also a co-op mode, as well as 2 player mini-games and a Versus mode (only Versus mode in the Nintendo DS version & Xbox Live Arcade).
Adventure mode
The adventure mode consists of 5 different areas and 50 different area levels (each area contains 10 levels). They are shown with the area number first, followed by the level number (i.e. 1-10) in the game. Each level in this mode has a certain amount of flags and one final wave. The adventure mode is the first game mode and is also the main mode. Mini-games are unlocked from here. Every 5th level will be a mini-game, while the 10th level will be a conveyor level.
When and if the player plays through it a second time, Crazy Dave will pick 3 random seeds that the player must use based on the zombies and area they are in every level, this is of course optional but it can assist the player in getting more of the in game currency.
Mini games
Mini-games are unlocked during the adventure mode and are mostly for fun. Some of the minigames are inspired by earlier PopCap games.
Puzzles
Puzzles consist of 18 levels from 2 different "modes", Vasebreaker, where you break vases that either contains a plant seed or a zombie, and I, Zombie, where you create zombies to destroy cardboard cutouts of plants. On iOS and Android version, there's also a third mode called Last Stand that similar to the level with the same name from the Mini-Game Mode but with different zombies in each wave.
Survival
Survival is the second largest game mode in Plants vs Zombies. It involves two difficulties as hard and normal and also has different areas. Each normal round has 5 flags and each hard round has 10 flags. It also has an endless streak level as the final level. Survival is the last game mode in the game itself.
There is also a page of canceled mini-games called the Limbo Page which can be accessed using the Cheat Engine.
Zen Garden
The game also features a Zen Garden, where players can care for plants they previously purchased from Crazy Dave's Twiddydinkies or occasionally dropped by zombies. Players can also buy other Zen Garden areas for different plants. Fertilizer, water, and bug spray are necessary for a plant to grow. Plants will grow only when the game has been running for enough time.