Rpg Engine
@matthewbonig_pe3w/rpg-enginev2026.07.26.1
01README
Text-adventure RPG engine — swamp holds the world, the rules, and the save game; your agent narrates.
02Models
@matthewbonig_pe3w/rpg-enginev2026.07.26.1rpg_engine.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| title | string | Name of the adventure |
| intro | string | Opening text read at game start |
| startingLocation | string | Location id the player wakes up in |
| startingHp | number | |
| locations | array | |
| items | array | |
| npcs | array |
fn start(playerName: string, restart: boolean)
Begin a new game (or restart an existing one)
| Argument | Type | Description |
|---|---|---|
| playerName | string | |
| restart | boolean | Discard an existing save and begin again |
fn look()
Re-describe the current location without spending a turn
fn move(direction: string)
Walk through an exit to an adjacent location
| Argument | Type | Description |
|---|---|---|
| direction | string | An exit direction, e.g. north |
fn talk(npc: string, topic?: string)
Speak with an NPC in the current location
| Argument | Type | Description |
|---|---|---|
| npc | string | NPC id or name present in the current location |
| topic? | string | Optional subject to steer the reply |
fn take(item: string)
Pick up an item lying in the current location
| Argument | Type | Description |
|---|---|---|
| item | string | Item id or name lying in the current location |
Resources
state(infinite)— The save game: position, inventory, flags, history
scene(infinite)— What the player perceives after the latest action
03Stats
A
100 / 100
Downloads
0
Archive size
17.6 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
Repository
https://github.com/mbonig/swamp-game04Platforms
05Labels