Skip to content

1275/Text-adventure

Repository files navigation

# Adventure

Simple terminal text adventure written in C.

Targeted for the LuckFox Pico (Rockchip RV1103) with 64 MB RAM, but builds and runs on a regular Linux PC as well.

## Features

- Lightweight C11 code, minimal dependencies
- **Character classes** - Choose between Warrior (high damage/defense) or Mage (high health)
- **50x50 procedurally generated dungeon map** with position tracking
- **Experience and leveling system** - gain XP from combat and level up to increase stats
- **Random encounters** including combat, traps, treasures, and healing events
- **Difficulty scaling** based on distance from spawn point
- **Item system** with weapons, armor, consumables, and equipment
- **Item drops** from defeated enemies (30% chance)
- **Boss encounters** at the four corners of the map with legendary loot
- **Ancient shrines** at cardinal directions offering healing, gold, or wisdom
- Inventory management with 24 slot capacity
- Pure stdin/stdout; no graphics

## Project Layout

- main.c — entry point and game loop
- dungeon.c/.h — input, movement, room events, and map system
- enemies.c/.h — combat logic and monster encounters
- player.c/.h — player stats, inventory, experience, and leveling
- Makefile — GNU Make build

## Build

Requires GNU Make and a C compiler.

### Native build (Linux x86_64)

- Install tools (Debian/Ubuntu):
  - sudo apt update
  - sudo apt install build-essential
- Build:
  - make
- Run:
  - ./adventure
- Clean:
  - make clean

## Controls

- N/S/E/W — move north/south/east/west
- M — view map (15x15 area around player)
- Q — quit

## Gameplay Guide

- **Character Classes**: Choose your class at game start
  - **Warrior**: High base damage (15) and defense (8), standard health (100)
  - **Mage**: High max health (120), lower damage (8) and defense (4)
- **Starting Location**: You spawn at the center of the map [25, 25]
- **Map Size**: 50x50 grid (coordinates 0-49 in each direction)
- **Difficulty**: Increases as you move further from the spawn point
- **Experience**: Defeat monsters to gain XP and level up
- **Level Up**: Increases max HP (+20), damage (+3), and defense (+2)
- **Special Locations**:
  - **Corners [0,0], [0,49], [49,0], [49,49]**: Boss encounters with Ancient Dragons
  - **Cardinal Points [25,0], [25,49], [0,25], [49,25]**: Ancient Shrines
- **Items**: Dropped by enemies, found in chests, or earned from special events
- **Combat**: Turn-based; defeat enemies to earn gold, XP, and possibly items

## Make Targets

- all (default) — builds the adventure binary
- clean — removes objects and the binary

## Map Legend

- @ = Your position
- + = Spawn point (center of map)
- B = Boss location
- S = Ancient Shrine
- . = Unexplored area

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •