How abhinks151/battle-forge works
BattleForge is a small interactive command-line combat game. The player selects attack, heal, or exit; the game loop applies the player action, checks for death, runs an enemy action, and displays updated health. Character holds combat state, utilities implement choices and delays, and the renderer and death handler present outcomes. The README is empty, so this map follows the sampled runtime source; no additional product capabilities are documented.
Main entry points: index.js Game Loop · Character.js Character State · utils.js Combat Choices · handleDeath.js Death Handler
Components 7
Game Loop
- Game Loop
src/index.js
Combat Logic
- Game Constants
src/constants/gameConstants.js - Combat Choices
src/utils/utils.js - Death Handler
src/game/handleDeath.js
State and Display
- Character State
src/models/Character.js - Score Renderer
src/ui/renderScore.js
Other components
- Player
Connections 10
- Player → Game Loop: chooses moves
src/index.js - Game Loop → Character State: creates characters
src/index.js - Game Loop → Score Renderer: renders health
src/index.js - Game Loop → Combat Choices: applies choices
src/index.js - Game Loop → Death Handler: checks outcome
src/index.js - Game Loop → Game Constants: uses timing and messages
src/index.js - Combat Choices → Character State: updates combat state
src/utils/utils.js - Combat Choices → Game Constants: reads combat values
src/utils/utils.js - Score Renderer → Character State: reads names and health
src/ui/renderScore.js - Death Handler → Character State: checks health
src/game/handleDeath.js