Metadata-Version: 2.5
Name: magmacrunch-caldera
Version: 0.1.0
Summary: CALDERA - climb the vent, outrun the magma. Terminal version.
Project-URL: Homepage, https://magmacrunch.com/arcade/caldera/
Author: magmacrunch media
License-Expression: PolyForm-Noncommercial-1.0.0
License-File: LICENSE
License-File: NOTICE
Keywords: arcade,climber,games,terminal,tui
Requires-Python: >=3.10
Requires-Dist: magmacrunch>=0.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# CALDERA (terminal)

Climb the vent. Outrun the magma. The second version of the game, beside
`web/`, on the [magmacrunch](https://github.com/magmacrunch-media/magmacrunch)
engine's terminal backend. It is a cabinet in the magmacrunch arcade and its
own command, and plays the same either way.

```
pipx install magmacrunch-caldera
caldera
```

For working on it:

```
pip install -e ".[dev]"
python -m caldera
```

## It is the browser's game, not a remake of it

The rules are a line-for-line port of `web/js/tower.js`, `player.js`,
`score.js` and `game.js`, in world units at 60 Hz, with the same seeded
generator. `tests/test_oracle.py` runs the real JS through
`tools/js_oracle.mjs`, replays every input it fed into `caldera/sim.py`, and
requires the same state back after every frame. Exactly the same, not close:
both sides are IEEE doubles doing the same operations in the same order, so any
difference is a transcription error. A tower is a seed on both sides, and a
score means the same thing on both boards. Scores are filed under `caldera`,
with the browser's `floor`, `crunch` and `character` fields beside them.

The terminal draws at 30 fps and steps the rules twice a frame. Stepping once
would play the browser's game at half speed without anything looking wrong.

## Running, in a terminal

A terminal reports that a key went down and never that it came up, and a held
key goes quiet for about half a second before it repeats. Read as held state,
that is a run that will not start and a climber that will not stop on a ledge.
So **running latches**:

| key | |
|---|---|
| `←` `→` (or A/D) | run that way, and keep running |
| `↓` (or S) | stop running; the rock's friction does the rest |
| `SPACE` `↑` W | jump |
| `P` | pause |
| `R` | restart |
| `Esc` | back to the title (from the title, back to the arcade) |
| `Q` | quit |

Tap the other arrow to turn round mid-run, and the browser's skid does what it
does for a player who swaps keys. Hit a wall in the air and your heading turns
with the bounce, which is what a good browser player does with their fingers at
every wall. Walking into a wall on the ground just stands you there.

`tests/test_sim.py` checks that this can play the game: a bot only allowed
to press keys climbs exactly as far through the latch as the same bot holding
keys directly.

## The rest

```
caldera --list-climbers      the cast
caldera --climber king       climb as somebody in particular
caldera --seed 42            the same towers every time
caldera --play               skip the title
caldera --ascii              no block or arrow glyphs
```

Every glyph it draws is in the engine's degradation table, so a cp1252 or cp437
terminal gets the same layout in plain characters. `tests/test_app.py` sweeps
every screen for anything that is not. Under `NO_COLOR` the climber and the
magma are drawn in glyphs rather than background colour, so they do not vanish
when colour does.

Needs a 40x20 terminal; 80x24 is comfortable and anything wider adds side
panels for the run's numbers rather than a wider vent.

## Licence

[PolyForm Noncommercial 1.0.0](LICENSE), as the rest of this repository. See
[NOTICE](NOTICE).
