Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

Plants vs. Zombies: README, screenshots and GIFs

Mason3634df1b3ccf3c8
diff --git a/docs/media/gallery/pvz.gif b/docs/media/gallery/pvz.gif
new file mode 100644
index 00000000..1d040fa3
Binary files /dev/null and b/docs/media/gallery/pvz.gif differ
diff --git a/docs/media/pvz.gif b/docs/media/pvz.gif
new file mode 100644
index 00000000..ca762e6d
Binary files /dev/null and b/docs/media/pvz.gif differ
diff --git a/docs/media/thumb_pvz.png b/docs/media/thumb_pvz.png
new file mode 100644
index 00000000..61bbbaf2
Binary files /dev/null and b/docs/media/thumb_pvz.png differ
diff --git a/games/pvz/README.md b/games/pvz/README.md
new file mode 100644
index 00000000..93c49e14
--- /dev/null
+++ b/games/pvz/README.md
@@ -0,0 +1,105 @@
+> **Plants vs. Zombies is a [NumPlay](../../README.md) game that comes on its own.** It is too big to sit next to NumPlay. Get `PlantsVsZombies.nwa` from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).
+
+<p align="center">
+ <img src="src/icon.png" width="84" alt="Plants vs. Zombies icon">
+</p>
+
+<h1 align="center">Plants vs. Zombies</h1>
+
+<p align="center">
+ <b>Zombies are coming to your house: plant your lawn to stop them, on the NumWorks calculator.</b><br>
+ The whole Adventure: 50 levels from the front lawn to the roof, 40 plants, 24 zombies, Crazy Dave, his shop, the Almanac, and Dr. Zomboss in his Zombot.
+</p>
+
+<p align="center">
+ <a href="https://github.com/Mason363/NumPlay/releases/latest/download/PlantsVsZombies.nwa"><b>Download PlantsVsZombies.nwa</b></a>
+ &nbsp;·&nbsp; <a href="#controls">Controls</a>
+</p>
+
+<p align="center">
+ <img src="../../docs/media/pvz.gif" width="640" alt="The front lawn, the night with its graves, the pool, the fog, the roof and Dr. Zomboss">
+</p>
+
+## Highlights
+
+* **The whole Adventure, 50 levels:** the front lawn by day, then by night with its graves, the backyard's pool, the pool in the fog, and the roof, each world of ten levels with its own rules: no sun from the sky at night, mushrooms asleep in the day (wake them with a Coffee Bean), lanes of water that need Lily Pads, fog that hides the zombies until a Plantern lights it or a Blover blows it away, and a sloped roof where only lobbed shots get over the tiles, every plant in a Flower Pot.
+* **Its levels as the game makes them:** the same zombies in each level, the same waves built the same way, with their flags, "A Huge Wave of Zombies is Approaching!" and the Final Wave, graves that rise at night, zombies climbing out of the pool and bungee zombies dropping on the roof. The sod is rolled out row by row on the first levels, and the plant you find at the end of each one waits on the lawn.
+* **40 plants:** Peashooter, Sunflower, Cherry Bomb, Wall-nut, Potato Mine, Snow Pea, Chomper, Repeater; Puff-shroom, Sun-shroom, Fume-shroom, Grave Buster, Hypno-shroom, Scaredy-shroom, Ice-shroom, Doom-shroom; Lily Pad, Squash, Threepeater, Tangle Kelp, Jalapeno, Spikeweed, Torchwood, Tall-nut; Sea-shroom, Plantern, Cactus, Blover, Split Pea, Starfruit, Pumpkin, Magnet-shroom; Cabbage-pult, Flower Pot, Kernel-pult, Coffee Bean, Garlic, Umbrella Leaf, Marigold and Melon-pult, each with the game's cost, recharge, health, damage and timing.
+* **24 zombies, each with its own trick:** the Flag Zombie, Conehead and Buckethead, the Pole Vaulting Zombie who jumps your first plant, the Newspaper Zombie who gets angry when you tear his paper, the Screen Door Zombie, the Football Zombie, the Dancing Zombie and his Backup Dancers, the Ducky Tube, Snorkel and Dolphin Rider zombies in the pool, the Zomboni and its ice trail, the Zombie Bobsled Team, the Jack-in-the-Box Zombie, the Balloon Zombie floating over your plants, the Digger Zombie who comes up behind them, the Pogo Zombie, the Bungee Zombie who steals a plant, the Ladder Zombie, the Catapult Zombie and its basketballs, and the Gargantuar, who throws his Imp over your defenses.
+* **The mini-games of the Adventure:** Wall-nut Bowling, Whack-a-Zombie with a mallet, Big Trouble Little Zombie, Vasebreaker and Bungee Blitz, and the conveyor-belt levels that end each world.
+* **Dr. Zomboss:** the Zombot on the roof at night, summoning zombies, stomping your plants, dropping a camper van, sending bungees, and lowering his head to spit fire and ice balls (Ice-shroom puts out the fire, Jalapeno melts the ice), until he goes down.
+* **Crazy Dave** and what he has to say before the levels, **his shop**, Crazy Dave's Twiddydinkies (more seed slots, the Pool Cleaner, the Roof Cleaner, the rake and Wall-nut First Aid), paid with the coins zombies drop, and **the Almanac**, with every plant and zombie you have met.
+* **Lawn mowers** in every lane, the shovel, choosing your seeds before each level, "the zombies ate your brains!", the trophy at the end, and Adventure again once it is done.
+* **Saves:** your progress is saved after each level, and Home keeps the level you are playing: Continue in the menu brings it back. Both are also copied into `pvz_saves.py`, so installing the app again doesn't erase them.
+
+<table>
+ <tr>
+ <td align="center"><img src="docs/title.png" width="390" alt="The title"><br><sub>The title</sub></td>
+ <td align="center"><img src="docs/menu.png" width="390" alt="The menu"><br><sub>The menu on the tombstone</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/day.png" width="390" alt="The front lawn"><br><sub>The front lawn: sunflowers, snow peas and wall-nuts</sub></td>
+ <td align="center"><img src="docs/night.png" width="390" alt="The front lawn at night"><br><sub>Night: graves, mushrooms and a pole vaulter</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/pool.png" width="390" alt="The pool"><br><sub>The backyard's pool and its lily pads</sub></td>
+ <td align="center"><img src="docs/fog.png" width="390" alt="The fog"><br><sub>The fog, lit by planterns</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/roof.png" width="390" alt="The roof"><br><sub>The roof: everything in flower pots, lobbed over the slope</sub></td>
+ <td align="center"><img src="docs/boss.png" width="390" alt="Dr. Zomboss frozen"><br><sub>Dr. Zomboss, frozen by an Ice-shroom</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/boss2.png" width="390" alt="A Jalapeno before the Zombot"><br><sub>A Jalapeno burns a lane before the Zombot</sub></td>
+ <td align="center"><img src="docs/conveyor.png" width="390" alt="A conveyor-belt level"><br><sub>A conveyor-belt level</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/bowling.png" width="390" alt="Wall-nut Bowling"><br><sub>Wall-nut Bowling</sub></td>
+ <td align="center"><img src="docs/whack.png" width="390" alt="Whack-a-Zombie"><br><sub>Whack-a-Zombie</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/vase.png" width="390" alt="Vasebreaker"><br><sub>Vasebreaker</sub></td>
+ <td align="center"><img src="docs/dave.png" width="390" alt="Crazy Dave"><br><sub>Crazy Dave</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/chooser.png" width="390" alt="Choosing seeds"><br><sub>Choose your plants!</sub></td>
+ <td align="center"><img src="docs/shop.png" width="390" alt="Crazy Dave's shop"><br><sub>Crazy Dave's Twiddydinkies</sub></td>
+ </tr>
+ <tr>
+ <td align="center"><img src="docs/almanac.png" width="390" alt="The Almanac"><br><sub>The Almanac</sub></td>
+ <td align="center"><img src="docs/lost.png" width="390" alt="The zombies ate your brains"><br><sub>The zombies ate your brains!</sub></td>
+ </tr>
+</table>
+
+## Controls
+
+| Key | What it does |
+| --- | --- |
+| Arrows | Move over the lawn, choose in the menus |
+| 1 to 9, 0 | Pick the seed packet with that number (from the conveyor belt too) |
+| OK or EXE | Plant it, whack a zombie, break a vase, confirm |
+| The cursor | Moving it over sun and coins picks them up |
+| ⌫ (Delete) | The shovel: then OK digs up a plant |
+| Back | Put the seed back, or pause: Back to Game, Restart Level, Main Menu, Quit Game |
+| Toolbox | The Almanac, in the menu |
+| Home or On/Off | Keep the level and quit: Continue brings it back |
+
+## Good to know
+
+* **One app at a time:** Plants vs. Zombies is too big to sit next to NumPlay or the other big games. Installing it from the NumWorks website swaps them out, and installing them again swaps it out. Your saves in each one are kept.
+* **The Adventure, not the rest:** the mini-games, puzzles and survival modes of the main menu, the Zen Garden and the plants sold in the shop (Gatling Pea, Twin Sunflower and the other upgrades, the Imitater) aren't in it, and neither is the Yeti, who only shows up in a second Adventure.
+* **No music or sound:** the calculator has no speaker.
+* **The same game:** the pictures are the game's own, scaled to the calculator's screen, and the rules, numbers and Crazy Dave's lines follow the game, at its own 100 updates a second.
+
+## Credits
+
+Inspired by Plants vs. Zombies by PopCap Games, not affiliated with PopCap Games or Electronic Arts.
+
+* The pictures, the animations and the rules' numbers come from [pvz-web](https://github.com/xyxiao001/pvz-web), an open-source web version of the game that keeps the game's own pictures and follows its rules.
+* The **Rammetto One** font is by Sorkin Type and the **Nunito** font by Vernon Adams, Cyreal and Jacques Le Bailly, both under the SIL Open Font License, from [Google Fonts](https://fonts.google.com).
+
+Made by Mason Chen as part of NumPlay.
+
+## License
+
+The game's code is licensed under the GNU General Public License v3.0: see the `LICENSE` file at the root of the repository. The game's pictures and texts keep their own terms (see Credits).
diff --git a/games/pvz/docs/almanac.png b/games/pvz/docs/almanac.png
new file mode 100644
index 00000000..b01426ee
Binary files /dev/null and b/games/pvz/docs/almanac.png differ
diff --git a/games/pvz/docs/boss.png b/games/pvz/docs/boss.png
new file mode 100644
index 00000000..8a1c6c91
Binary files /dev/null and b/games/pvz/docs/boss.png differ
diff --git a/games/pvz/docs/boss2.png b/games/pvz/docs/boss2.png
new file mode 100644
index 00000000..4fb9406d
Binary files /dev/null and b/games/pvz/docs/boss2.png differ
diff --git a/games/pvz/docs/bowling.png b/games/pvz/docs/bowling.png
new file mode 100644
index 00000000..719ec19f
Binary files /dev/null and b/games/pvz/docs/bowling.png differ
diff --git a/games/pvz/docs/chooser.png b/games/pvz/docs/chooser.png
new file mode 100644
index 00000000..f7c3eba1
Binary files /dev/null and b/games/pvz/docs/chooser.png differ
diff --git a/games/pvz/docs/conveyor.png b/games/pvz/docs/conveyor.png
new file mode 100644
index 00000000..c691b4e6
Binary files /dev/null and b/games/pvz/docs/conveyor.png differ
diff --git a/games/pvz/docs/dave.png b/games/pvz/docs/dave.png
new file mode 100644
index 00000000..d8ca9509
Binary files /dev/null and b/games/pvz/docs/dave.png differ
diff --git a/games/pvz/docs/day.png b/games/pvz/docs/day.png
new file mode 100644
index 00000000..51cbf89c
Binary files /dev/null and b/games/pvz/docs/day.png differ
diff --git a/games/pvz/docs/fog.png b/games/pvz/docs/fog.png
new file mode 100644
index 00000000..f1a985cc
Binary files /dev/null and b/games/pvz/docs/fog.png differ
diff --git a/games/pvz/docs/help.png b/games/pvz/docs/help.png
new file mode 100644
index 00000000..57686565
Binary files /dev/null and b/games/pvz/docs/help.png differ
diff --git a/games/pvz/docs/lost.png b/games/pvz/docs/lost.png
new file mode 100644
index 00000000..87ca0ba5
Binary files /dev/null and b/games/pvz/docs/lost.png differ
diff --git a/games/pvz/docs/menu.png b/games/pvz/docs/menu.png
new file mode 100644
index 00000000..b25c98bb
Binary files /dev/null and b/games/pvz/docs/menu.png differ
diff --git a/games/pvz/docs/night.png b/games/pvz/docs/night.png
new file mode 100644
index 00000000..83f996d2
Binary files /dev/null and b/games/pvz/docs/night.png differ
diff --git a/games/pvz/docs/pool.png b/games/pvz/docs/pool.png
new file mode 100644
index 00000000..6d27bd1f
Binary files /dev/null and b/games/pvz/docs/pool.png differ
diff --git a/games/pvz/docs/roof.png b/games/pvz/docs/roof.png
new file mode 100644
index 00000000..d1d94019
Binary files /dev/null and b/games/pvz/docs/roof.png differ
diff --git a/games/pvz/docs/shop.png b/games/pvz/docs/shop.png
new file mode 100644
index 00000000..a04457c2
Binary files /dev/null and b/games/pvz/docs/shop.png differ
diff --git a/games/pvz/docs/title.png b/games/pvz/docs/title.png
new file mode 100644
index 00000000..6075a6fe
Binary files /dev/null and b/games/pvz/docs/title.png differ
diff --git a/games/pvz/docs/vase.png b/games/pvz/docs/vase.png
new file mode 100644
index 00000000..70c96b2a
Binary files /dev/null and b/games/pvz/docs/vase.png differ
diff --git a/games/pvz/docs/whack.png b/games/pvz/docs/whack.png
new file mode 100644
index 00000000..bb56ce45
Binary files /dev/null and b/games/pvz/docs/whack.png differ
diff --git a/games/pvz/src/data.h b/games/pvz/src/data.h
index acc365f7..3f3c26f5 100644
--- a/games/pvz/src/data.h
+++ b/games/pvz/src/data.h
@@ -1,4 +1,4 @@
-/* Generated by tools/pack.py: what data.bin holds. */
+/* Written by tools/pack.py: what data.bin holds. */
#ifndef PVZ_DATA_H
#define PVZ_DATA_H
diff --git a/games/pvz/src/screens.c b/games/pvz/src/screens.c
index e473082d..1117ce3e 100644
--- a/games/pvz/src/screens.c
+++ b/games/pvz/src/screens.c
@@ -1048,7 +1048,7 @@ static void draw_help(void) {
{"Arrows", "Move over the lawn"},
{"1 2 3 ... 0", "Pick a seed packet"},
{"OK", "Plant it (or whack, or break a vase)"},
- {"Cursor", "Moving over sun and coins picks them up"},
+ {"Cursor", "Over sun and coins, picks them up"},
{"Delete", "The shovel: then OK digs up a plant"},
{"Back", "Put the seed back, or pause"},
{"Toolbox", "The Almanac (in the menu)"},
diff --git a/games/pvz/tests/play.c b/games/pvz/tests/play.c
index 22a4762a..4c28e8fb 100644
--- a/games/pvz/tests/play.c
+++ b/games/pvz/tests/play.c
@@ -250,7 +250,8 @@ static void robot(void) {
return;
}
if (has_conveyor()) {
- if (!B.npackets || B.ticks % 25) return;
+ /* (with --sun-from, a few seeds on the belt first, as one plays) */
+ if (!B.npackets || B.ticks % 25 || (sun_from < (1 << 30) && B.npackets < 4)) return;
for (int i = 0; i < B.npackets; i++)
if (robot_packet(i)) return;
/* nowhere, the belt full: the first one dropped */
@@ -260,10 +261,11 @@ static void robot(void) {
}
return;
}
- /* plants: every cell, what it wants first */
- for (int r = 0; r < B.nrows; r++) {
- if (!(B.rows >> r & 1)) continue;
- for (int c = 0; c < 8; c++) {
+ /* plants: every cell, what it wants first (with --sun-from, a column at a time from the house, as one plays) */
+ for (int i = 0; i < 8 * B.nrows; i++) {
+ int c = sun_from < (1 << 30) ? i / B.nrows : i % 8, r = sun_from < (1 << 30) ? i % B.nrows : i / 8;
+ {
+ if (!(B.rows >> r & 1)) continue;
int kinds[24], n = want(c, r, kinds);
for (int k = 0; k < n; k++)
for (int s = 0; s < B.nseeds; s++)
diff --git a/games/pvz/tools/pack.py b/games/pvz/tools/pack.py
index 1b02700f..59016d58 100644
--- a/games/pvz/tools/pack.py
+++ b/games/pvz/tools/pack.py
@@ -423,7 +423,7 @@ class Pack:
struct.pack_into("<6I3I", out, 4, *tables, len(self.anims), len(self.frames), len(out))
with open(OUT_BIN, "wb") as f:
f.write(out)
- lines = ["/* Generated by tools/pack.py: what data.bin holds. */", "#ifndef PVZ_DATA_H", "#define PVZ_DATA_H",
+ lines = ["/* Written by tools/pack.py: what data.bin holds. */", "#ifndef PVZ_DATA_H", "#define PVZ_DATA_H",
""]
for key, *_ in self.anims:
lines.append(f"#define {key} {self.names[key]}")
diff --git a/tools/release.py b/tools/release.py
index 334dcbb9..158d0a48 100644
--- a/tools/release.py
+++ b/tools/release.py
@@ -49,6 +49,9 @@ ALONE = {
"Too big to share the calculator with NumPlay: install it on its own"),
"pvz": ("Plants vs. Zombies", "the whole Adventure, Day to Roof and Dr. Zomboss: 50 levels, 48 plants, 26 zombies, "
"Crazy Dave, the Almanac and his shop. Too big to share the calculator with NumPlay: install it on its own"),
+ "pvz": ("Plants vs. Zombies", "the whole Adventure, from the front lawn to the roof and Dr. Zomboss: 50 levels, 40 "
+ "plants, 24 zombies, Crazy Dave, his shop and the Almanac. Too big to share the calculator with NumPlay: "
+ "install it on its own"),
}
VARIANTS = [
("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),