How teytra/rustvoidgame works
A small terminal RPG: the player creates a character, chooses rest, combat, statistics, or exit, and combat can award XP and level-ups. The main module owns the game loop and gameplay functions; Creature holds character state and scoring, while input.rs handles line input and pauses. README only identifies the product as a game, so the workflow is based on sampled source; no separate unsampled subsystems are shown.
Main entry points: main.rs Game Loop · input.rs Input Helpers · creature.rs Creature State
Components 9
Gameplay
- Game Loop
src/main.rs - Combat
src/main.rs - Rest
src/main.rs - Stats and Exit
src/main.rs - XP Progression
src/main.rs
Character Model
- Creature State
src/creature.rs
Terminal I/O
- Input Helpers
src/input.rs
Other components
- Player
- Terminal
Connections 20
- Player → Game Loop: chooses actions
- Game Loop → Input Helpers: reads input
- Input Helpers → Terminal: reads lines
- Game Loop → Terminal: prints menu
- Game Loop → Creature State: creates player
- Game Loop → Rest: dispatches
- Game Loop → Combat: dispatches
- Game Loop → Stats and Exit: dispatches
- Rest → Creature State: updates health
- Rest → Input Helpers: waits
- Combat → Input Helpers: reads choice
- Combat → Input Helpers: waits
- Combat → Creature State: creates enemy
- Combat → XP Progression: calculates XP
- Combat → Terminal: prints battle
- XP Progression → Creature State: updates stats
- Stats and Exit → Creature State: reads stats
- Stats and Exit → Input Helpers: waits
- Stats and Exit → Terminal: prints details
- Creature State → Input Helpers: score displayed by caller