Bash.tv → GitHub → itch.io

Tactical and turn-based games (grid tactics like XCOM / Fire Emblem / Into the Breach, hex strategy, 4X-lite, turn-based RPG battles). Turn and phase structure, action points, movement range with weighted pathfinding, attack ranges and line of sight, hit chance and damage forecasts, cover and terrain, enemy AI that scores moves, undo, animation queues separate from rules, deterministic game sta...

Download skill (.zip) Files on GitHub

Turn-based strategy

Core: meaningful decisions with full information (or calculated risk), one move at a time.

Starter template

A playable starter for the game-scaffolding template is in assets/starter/. Grid tactics: terrain costs and defense, movement range (Dijkstra), melee and ranged attack ranges, damage forecast with counterattacks, undo move, end turn, and an enemy AI that scores every reachable tile.

python3 <game-scaffolding>/scripts/scaffold.py my-game --title "My Game" --starter <this skill>/assets/starter

Controls: Tap a unit, then a blue tile to move or a red enemy to attack. Keys: arrows + Enter, C cancel, Q wait, Z undo, E end turn. Esc pauses. All numbers to tune are in src/config.js; the gameplay is in src/scenes/play.js. Selection, movement, undo, the enemy turn and a multi-round battle were tested with a bot.

Architecture that makes it easy

Growing the starter (tested modules)

  1. Grid (or hex) map with terrain costs; movement range = Dijkstra up to the unit’s points (pathfinding flowField from the unit with a distance cap, or astar per hovered tile for the path preview).
  2. Attack range + lineOfSight (pathfinding) for ranged units; cover reduces hit chance.
  3. Forecast: before confirming, show hit %, damage, and the counterattack. Use a seeded rng (procedural-generation rng) so reloading doesn’t reroll (no save-scumming, if you want that).
  4. Enemy AI: for each unit, score candidate (move, action) pairs: damage dealt, kills, danger at the destination, objective progress; pick the best with a little randomness (enemy-ai chooseAction idea).
  5. Undo last move (until an action with randomness is taken).

Design

UI

Tap / click a unit → highlighted move tiles (blue) and attack tiles (red) → tap a tile → confirm. Big tiles on phones (≥ 44 px), an End turn button, and a turn indicator. Keyboard: arrows to move a cursor, Enter confirm, Esc cancel, Tab next unit.

Pitfalls

Rules tangled with animations (bugs with undo and saves), hidden math, AI that’s slow on big maps (limit search, stagger), and long enemy turns (speed up animations, allow skipping).