How kishanpujari/wallom works
Purpose and Runtime
Wallom is a Windows terminal grid-survival game implemented in PowerShell 5.1+. It runs a turn-based loop: the player moves, places mines or permanent wall bombs, collects points, and attempts to eliminate an AI enemy. ANSI terminal output provides the UI; JSON files persist game and settings state.
Launch and Composition
Wallom.bat is the Windows entry point and launches the PowerShell game. The engine is modularized as dot-sourced PowerShell scripts under bin/, with the central coordinator in bin/engine.ps1.
Key entry paths:
• Wallom.bat
• bin/engine.ps1
• bin/splash.ps1
Engine and Game Lifecycle
bin/engine.ps1 owns high-level control flow: initialize/load a game, accept command input, advance game state, redraw the terminal, and exit or save. It composes domain modules rather than exposing a separate service or networked API.
Lifecycle boundaries:
1. Start/menu and settings selection.
2. Create or restore state.
3. Repeated player-command and enemy-update turns.
4. Persist state and return/quit.
Related UI modules:
• bin/splash.ps1
• bin/ui_settings.ps1
• bin/ui_help.ps1
Grid World and Rendering
bin/grid.ps1 defines the playable map behavior: procedural grid setup, placement and representation of walls, player, enemy, bombs, and collectibles, plus movement/blocking constraints. It is the primary shared spatial model used by player actions, enemy movement, and bomb effects.
Terminal presentation is separated into reusable color and menu/logo views:
• bin/grid.ps1
• bin/colors.ps1
• bin/ui_logo.ps1
Enemy and Combat Systems
bin/enemy.ps1 implements AI-driven enemy movement against the current grid state. The enemy’s turn depends on obstacle and mine placement, and it can be killed by stepping on a mine.
bin/bomb.ps1 manages player-deployed hazards: X1 mines with configurable lifetime/radius behavior and X2 wall bombs that create durable map obstacles. This module changes grid state and supplies the combat outcome that can end a session.
Core paths:
• bin/enemy.ps1
• bin/bomb.ps1
• bin/grid.ps1
Persistence and Settings
bin/db.ps1 is the persistence boundary for JSON game saves, including session/game ID, player and enemy positions, score, walls, bombs, and collectibles. It isolates saved-state serialization from turn logic.
bin/config.ps1 separately manages persistent gameplay configuration, notably maximum mine count and mine lifetime; settings UI updates this configuration rather than requiring source edits.
Core paths:
• bin/db.ps1
• bin/config.ps1
• bin/ui_settings.ps1
Infrastructure and External Dependencies
The repository has no web server, database service, package runtime, or external API dependency. Required infrastructure is a Windows console with PowerShell and ANSI-capable terminal rendering. Batch is used only as the launcher; JSON files are the sole durable storage mechanism.
Main entry points: engine.ps1 Game engine · grid.ps1 Grid world · config.ps1 Gameplay settings · splash.ps1 Start menu
Components 14
Launch & UI
- Wallom launcher · Starts the PowerShell game.
Wallom.bat - Start menu
bin/splash.ps1 - Settings UI
bin/ui_settings.ps1 - Help UI
bin/ui_help.ps1 - Terminal colors
bin/colors.ps1 - Logo view
bin/ui_logo.ps1
Game Engine
- Game engine · Owns lifecycle, turn loop, save, and exit flow.
bin/engine.ps1 - Grid world · Creates and enforces the shared playable map state.
bin/grid.ps1 - Enemy AI · Moves the enemy using current grid obstacles and hazards.
bin/enemy.ps1 - Bomb system · Manages mines and permanent wall bombs.
bin/bomb.ps1
State & Settings
- Game save store · Serializes sessions, positions, score, walls, bombs, and collectibles.
bin/db.ps1 - Gameplay settings · Persists mine limit and mine lifetime settings.
bin/config.ps1 - JSON files · Sole persistent storage for saves and settings.
Other components
- Windows ANSI terminal · Provides input and ANSI-rendered output under PowerShell 5.1+.
Connections 18
- Wallom launcher → Game engine: launches
- Game engine → Start menu: shows menu
- Game engine → Settings UI: opens
- Game engine → Help UI: opens
- Game engine → Grid world: initializes and updates
- Game engine → Enemy AI: runs enemy turn
- Game engine → Bomb system: processes player hazards
- Enemy AI → Grid world: reads and moves on
- Bomb system → Grid world: changes hazards and walls
- Game engine → Game save store: loads and saves session
- Game save store → JSON files: reads and writes
- Settings UI → Gameplay settings: updates
- Game engine → Gameplay settings: loads settings
- Gameplay settings → JSON files: reads and writes
- Game engine → Windows ANSI terminal: reads commands and redraws
- Grid world → Terminal colors: uses
- Start menu → Logo view: renders
- Game engine → Terminal colors: uses ANSI output