Gold Runner

A game for the PX-42F calculator, in the style of the classic Lode Runner

You are a lone runner in a maze of brick floors, ladders and ropes. Gold lies about, and guards want you. Take every piece of gold, then climb out of the top of the screen. You can't jump and you can't fight: all you can do is run, climb, hang from ropes and dig holes for the guards to fall into.

Level 1 as it looks when it starts
Level 1 at the start: you are on the bottom floor, a guard is on the one above.

Starting the game

Gold Runner is a Games & Apps program. It needs the PX-42F firmware with app API version 3 or later (a firmware from the same time as this game will do).

  1. Copy GOLDRUN.bin into the BIN/GAMES folder of the PX-42F drive. (Settings → USB Drive → Connect to Computer makes the drive appear on your computer; the project's make install does the copy.)
  2. Eject the drive and let the calculator come back.
  3. Settings → Games & Apps → Games → GOLDRUN.

The game runs on its own, then the calculator comes back just as you left it: your stack, programs and the rest are not touched.

The title screen

The title screen

The keys

The number keys are a direction pad, as they are laid out on the calculator:

Move and dig

7dig left8up9dig right 4left56right 12down3
KeyDoes
4 6Run left, right. Along a rope, you move hand over hand.
8 2Climb up, down a ladder. On a rope, 2 lets go and you drop. In a hole, 8 climbs out.
▲ ▼The same as 8 and 2, if you prefer them.
7 9Dig a hole on your left, right.
Σ+ XEQThe same as 7 and 9: the two top corner keys, handy with a thumb on each side.
R/SPause. R/S again to go on, or ENTER to end the game and go back to the title screen.
a short ONPause too. On the pause screen ON quits Gold Runner.
← (backspace)Give up a man: you lose one and the level starts again. For when you are stuck.
ON held 2 secondsTurns the calculator off, as everywhere.

A key you hold keeps you moving; a quick tap moves you a little (a quarter of a tile), good for lining up exactly. Holding two directions follows the one pressed last. Everything is done by the position of the keys, so it works the same whatever the key labels say, and in ALPHA mode.

The screen

A level is 28 tiles wide and 16 high. The black bar at the top shows:

LV 1  SCORE 000250  MEN 5  GOLD 8

What things are

ThingWhat it does
BrickA floor or wall. You and the guards can't walk through it. You can dig it.
Solid wallThe same, but it can't be dug. The bottom row is always this.
LadderClimb up and down. You can step off it to either side. You can stand on the top of one.
RopeHang from it and move along it. Let go with down. You grab it if you fall onto it.
GoldWalk onto it to take it.
YouFaces the way you last went. Has its own pictures for running, climbing, hanging, falling and digging.
A guardThe same figure with a hollow head. A small mark at the top right of him means he is carrying gold.

There is one more thing you can't see: in every level a hidden ladder waits for you to take the last piece of gold. When you do, a high tone plays and the ladder appears, going up to the top of the screen.

How to play

When a level starts, its name and number are shown over the map. Press any key, or wait four seconds, to begin. The guards start moving at once.

  1. Take all the gold. Just walk onto each piece. GOLD in the bar counts down.
  2. Get to the top. The ladder that appears leads to the top row. Reaching the top row finishes the level: you get a bonus and a spare man, and the next level starts.
  3. Don't get caught. A guard touching you costs a man.

Moving about

Hanging from a rope across a gap
Hanging from a rope across a gap in the floor. Let go and you fall to the floor below.

Digging and guards

Digging

Stand still on a floor beside a brick and press 7 (left) or 9 (right). You turn and dig the brick below and beside you, the one just in front of your feet, not the one under them. The brick wears away for about a quarter of a second, during which you can't move, and then a hole is there.

You can dig when:

If you press the key when you're not quite lined up, the game waits a moment (about a third of a second) for you to be, and digs then.

A hole being dug beside the runner
Digging right: the brick in front of your feet wears away. Here the floor is two bricks thick, with a guard coming along it.

What a hole does

The guards

A guard trapped in a hole
The guard has walked into the hole and is trapped in it. You can run across the top of him.
Gold the guards carry still counts. The ladder only appears when GOLD reaches 0, so a guard that is holding gold has to be trapped, or has to drop it, before you can leave.

Men and score

You getPoints
a piece of gold250
a guard lost to a closing hole75
a level finished1500, and an extra man (up to 9)

Tips

Your own levels

The game has six levels built in. For others, make a text file named LEVELS.TXT and put it in the game's own folder on the drive, BIN/GAMES/GOLDRUN/ (the folder is made the first time the game saves something; make it yourself if it isn't there). If the file has any levels in it, they replace the built-in ones: up to 255 of them and 80 KB. Delete the file to get the built-in ones back. Your saved progress is by level number, so changing the levels can leave you with a "highest level" that no longer means anything: reset it by deleting SAVE (see below).

The format

Each level is 16 lines of 28 characters, one for each row of tiles, from the top of the screen down. Shorter lines are filled with spaces; longer ones are cut. A blank line ends a level. A line starting with ; is a comment, and the last comment before a level is its name, shown on the level screen (up to 23 characters).

CharacterIs
#brick (can be dug)
@solid wall (can't be dug)
Hladder
-rope
$gold
Sa ladder that appears when all the gold is taken
&where you start (one a level)
0a guard (up to 6 a level; a seventh is left out)
. or spaceempty

Use . for empty tiles, not spaces: a line of nothing but spaces counts as a blank line and ends the level.

; Two floors
..........................S.
..........................S.
..........................S.
..........................S.
..........$.....$.........S.
####H#######################
....H.......................
....H.......................
....H.......................
....H.......................
....H.........$...0.........
######################H#####
......................H.....
......................H.....
..&.....$.............H.....
@@@@@@@@@@@@@@@@@@@@@@@@@@@@

A level needs all 16 lines; one with fewer is ignored. Check yours with the checker below.

Making them playable

The checker

On your computer, python3 tools/make_levels.py MYFILE.TXT (in the Gold Runner project) checks a file: exactly one start, some gold and an S, no unknown characters, at most 6 guards, and that from the start you can reach every piece of gold and, after that, the top row. The check counts digging generously (any brick beside a floor can be dug, in any order) and ignores the guards, so a level that fails it has a real mistake, while one that passes can still be too hard.

The built-in levels are written the same way, in levels/builtin.txt. Run python3 tools/make_levels.py with no file after changing that, to check them and rebuild src/levels_data.c; then make.

Files the game keeps

File (in BIN/GAMES/GOLDRUN/)Is
SAVETwo numbers in a text file: your best score and the highest level reached (counting from 0). Written when a level is finished and when a game ends. Delete it to start from nothing.
LEVELS.TXTYour levels, if you made some (above).

The game only writes the drive when a level is finished or a game ends, never while you play, so it doesn't wear the calculator's flash.

If something is wrong

You seeTry
GOLDRUN isn't in the Games menuThe file must be in BIN/GAMES (not BIN/APPS) on the drive. The firmware must support app API version 3.
The calculator says the app can't runThe firmware is older than the game needs. Update it (Settings → USB Drive → Update Firmware).
My levels don't appearThe file must be named LEVELS.TXT, in the game's folder BIN/GAMES/GOLDRUN/, and each level needs all 16 lines. Check it with make_levels.py.
I can't digYou must be standing still on a floor (not on a ladder or rope), with an empty tile beside you and a brick below that tile. A hole already open there doesn't count either.
I can't get the last goldA guard is carrying it. Trap him, or wait: he drops it after a while.
The ladder to the top didn't appearLook at GOLD in the bar: it isn't 0. A guard has some.
I'm stuck← gives up a man and starts the level again.
The calculator turned offHeld ON for 2 s, the Sleep Timer ran out, or the battery is empty. The game ends, and the calculator's own memory is as you left it.

For tinkerers

The game is open source and built with the PX-42F app framework. The numbers that set how it plays are at the top of src/gold.c:

NameIsNow
TICK_MSthe length of a step; everything moves one step at a time45 ms
OPEN_TICKSsteps a hole stays open120 (5.4 s)
ESCAPE_MIN, ESCAPE_RANGEa trapped guard climbs out after this many of his steps, plus up to the range55 + 0-29
GUARD_MOVES / GUARD_PERIODa guard moves on this many steps out of every this many2 of 3
CARRY_MIN, CARRY_RANGEhow long a guard keeps gold before dropping it70 + 0-89
START_LIVESmen at the start5
GOLD_POINTS, GUARD_POINTS, LEVEL_POINTSthe scores250, 75, 1500

The pictures are drawn as text in src/sprites.c (an X is a black pixel) and can be edited as they look. make sim plays a scripted game on a computer and saves screenshots; make sim CFLAGS_SIM=-DGR_TRACE prints where everyone is on every step.