Terminal text-adventure engine with a live minimap overlay.
Project description
coolmapmaker
A terminal text-adventure engine with a live minimap overlay.
Define your rooms and dialogue — the engine handles movement, rendering, and the map.
+-- SHRINE OF THE NAMELESS (1x1) +-------+--+--+--+--+
| A stone idol squats in the centre, | . . | | | | |
| ringed with offerings of bone. +--#----+ | | | |
| | . . . | |
| The idol's hollow eyes track you. +--+--+--+--+----+--+
+-- 3 exits [N E S] | |@ | | | |
+--+--+--+--+-------+
@ Shrine of the Nameless | exits: [N E S] | WASD/arrows = move | Q = quit
Install
pip install coolmapmaker
Or directly from GitHub:
pip install git+https://github.com/sheepishlyroyal/coolmapmaker.git
Quick start
from coolmapmaker import Room, Dungeon
rooms = [
Room(
room_id = "entrance",
name = "Cave Entrance",
description = "Damp stone walls glisten in the torchlight.",
),
Room(
room_id = "hall",
name = "Great Hall",
description = "Pillars rise into darkness above a cracked mosaic floor.",
width = 2,
height = 2,
),
]
Dungeon(rooms, start_room_id="entrance").run()
Controls: WASD or arrow keys to move. Q or Esc to quit.
Room parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
room_id |
str |
required | Unique identifier used for start_room_id and exits |
name |
str |
required | Display name shown in narrative and status bar |
description |
str |
required | Atmospheric text shown on room entry |
width |
int |
1 |
Grid cells wide (1–4) |
height |
int |
1 |
Grid cells tall (1–3) |
events |
list[str] |
[] |
Random atmospheric lines; falls back to engine defaults if empty |
on_enter |
callable |
None |
on_enter(dungeon) called every time the player enters |
entry_message |
str |
None |
Override the random "you step through…" line for this room |
exits |
list[str] |
None |
Explicit list of room_ids this room connects to. Auto-connects by grid adjacency if None |
Dungeon parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
rooms |
list[Room] |
required | All rooms in the dungeon |
start_room_id |
str |
random | room_id of the starting room |
entry_lines |
list[str] |
built-in | Override the "you step through…" lines |
event_lines |
list[str] |
built-in | Override global atmospheric events |
event_chance |
float |
0.55 |
Probability an atmospheric event fires on entry |
Custom logic with on_enter
def treasury_entered(dungeon):
if dungeon.get_room("shrine")._visited:
dungeon.print("The chest glows faintly — the idol's blessing.")
else:
dungeon.print("The chest is cold and empty.")
Room(
room_id = "treasury",
name = "Treasury",
description = "Iron chests line the walls.",
on_enter = treasury_entered,
)
dungeon.print(text) appends a line to the narrative from inside a callback.
Minimap legend
| Symbol | Meaning |
|---|---|
@ |
Your current position |
. |
Visited room floor |
# |
Open door (both rooms visited) |
? |
Passage hint (one side visited) |
|
Unexplored (fog of war) |
Publishing your own dungeon
See example/example_game.py for a full working demo.
Requirements
- Python 3.9+
pynput(installed automatically)- A proper terminal (not an IDE's embedded console)
- macOS/Linux: no extra setup. Windows: pynput works natively.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coolmapmaker-0.1.3.tar.gz.
File metadata
- Download URL: coolmapmaker-0.1.3.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26cf61390a708d9a591a89cab9fcc0a59bfeef25e16ca2e3ffb95f9080a80b15
|
|
| MD5 |
260ccc0e06959db8c8b5aba27c2c7f8b
|
|
| BLAKE2b-256 |
cccda663f472f86e1b1558282a78a05c14ebd5ca2901e6017ce85e565d96f9f9
|
Provenance
The following attestation bundles were made for coolmapmaker-0.1.3.tar.gz:
Publisher:
publish.yml on sheepishlyroyal/mapmaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coolmapmaker-0.1.3.tar.gz -
Subject digest:
26cf61390a708d9a591a89cab9fcc0a59bfeef25e16ca2e3ffb95f9080a80b15 - Sigstore transparency entry: 1412493030
- Sigstore integration time:
-
Permalink:
sheepishlyroyal/mapmaker@4b347ba00ccce6929c76706c7bc293d84b9fecf3 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sheepishlyroyal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b347ba00ccce6929c76706c7bc293d84b9fecf3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coolmapmaker-0.1.3-py3-none-any.whl.
File metadata
- Download URL: coolmapmaker-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc42b7a69d6a5aeb83156c7be9217632de1887c6e45bcf73a41f4aad5f8820ff
|
|
| MD5 |
3c2dbb11c81418bec8a69e5b7e3aca86
|
|
| BLAKE2b-256 |
bec999acbc8888e75f75e49f1a4d574a62550f09fcc6241723b5f5a5754225f5
|
Provenance
The following attestation bundles were made for coolmapmaker-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on sheepishlyroyal/mapmaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coolmapmaker-0.1.3-py3-none-any.whl -
Subject digest:
dc42b7a69d6a5aeb83156c7be9217632de1887c6e45bcf73a41f4aad5f8820ff - Sigstore transparency entry: 1412493085
- Sigstore integration time:
-
Permalink:
sheepishlyroyal/mapmaker@4b347ba00ccce6929c76706c7bc293d84b9fecf3 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sheepishlyroyal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b347ba00ccce6929c76706c7bc293d84b9fecf3 -
Trigger Event:
release
-
Statement type: