Skip to main content
WEB
SkillFreeBy GameSkillGameSkill original

Tower Defense Power Grid (relays, light beam, night)

/mechanic-tower-defense-power-grid

A GameSkill original: towers fire only while linked to the power source through relays, a fixed capacity is shared in a stable order so new towers never black out old ones, selling recomputes and reports a brownout, a movable light beam adds damage and slow, and at night towers need light to see far.

License
MIT
By
By GameSkill
Download ZIP

Tested by GameSkill

39/39 checks passed on Canvas 2D in Chrome 156 headless (2026-10-28): trigger, a runnable example, a screenshot and self-check, one job per skill, and English + Chinese docs. Trigger checks match prompts against skill descriptions; they are not a live agent run.

Test report

GameSkill's tested copy

Written and tested by GameSkill for gameskill.dev. The ZIP holds the whole skill: SKILL.md and its Chinese version, scripts, a runnable example, tests, the self-check list and our test report.

Download tested ZIP (612 KB)Roadmap: Gameplay mechanics

A GameSkill original, released under MIT. The ZIP keeps LICENSE and CREDITS.md, which lists the workflow inspiration, the CC0 test assets and the third-party libraries with their licenses.

Tower Defense Power Grid (relays, light beam, night)

Self-check

  • 卖掉中继后,下游的塔立刻停火,并提示断电 / Selling a relay stops the towers behind it at once and shows a brownout
  • 新建的塔不会让已有的塔断电 / Building a new tower never switches off an existing one
  • 塔不会把电转发给别的塔 / Towers never pass power on
  • 光束的增伤和减速用同一个范围判断 / The beam's damage bonus and slow use the same in-spot test
  • 夜里画面上看不见的敌人,塔也打不到 / At night, enemies you cannot see are enemies no tower can shoot
  • npm test 和 npm run test:browser 都通过 / npm test and npm run test:browser pass

Install

Tell your AI

Install the skill from https://gameskill.dev/skills/mechanic-tower-defense-power-grid/install.md

GameSkill's tested copy

Tested copy into .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/mechanic-tower-defense-power-grid.zip -o /tmp/gameskill-mechanic-tower-defense-power-grid.zip
unzip -oq /tmp/gameskill-mechanic-tower-defense-power-grid.zip -d .claude/skills
rm /tmp/gameskill-mechanic-tower-defense-power-grid.zip

What you get

  • Harbor Lamp: a 16x9 Canvas 2D board with a lighthouse, relays, three tower types, tap and keyboard controls
  • src/logic.js: link ranges, BFS from the source, stable capacity allocation, recompute with lost and gained lists
  • A light beam that moves at a capped speed and gives +25% damage and 15% slow inside its spot
  • Night sight: 70% of tower range unless the enemy is lit by the beam, the source or a powered relay
  • 14 Node tests (including whole-wave fights) and an 11-check headless Chrome test

Good fit

  • Tower defense games with power, energy, pylons or relays
  • Night waves, lighting and spotlight mechanics
  • Fixing towers that switch on and off when unrelated things are built

Not for

  • Paths, wave design and targeting modes on their own (see tower-defense)
  • Electrical simulation with voltage, losses or flow

Try this prompt

Prompt
Add a power grid to my tower defense: towers need to be connected to the generator through pylons, power is limited, and selling a pylon should cut the towers behind it.

About this skill

A GameSkill original, written and tested for gameskill.dev under MIT. The demo, Harbor Lamp: a lighthouse powers towers through relays on a 16×9 board, with a steerable beam for night waves. All rules are in src/logic.js (no DOM).

Agent steps

  1. Nodes, not towers: one list; connected, hops, powered are rewritten only by recompute(grid).
  2. Recompute on every change and return lost / gained for a brownout pop-up.
  3. Towers never relay; only the source and relays transmit.
  4. Stable allocation: priority, then build order, then hops. A new tower never blacks out an old one.
  5. Show the cause: live and dead cables, link-range rings, ⚡! (over capacity) vs ⚡✕ (no link).
  6. Beam as a moving spot with a capped speed; damage bonus and slow use the same inBeam test.
  7. Night sight in one function shared by targeting and rendering; powered relays are lamps too.
  8. Prove it with fights: the same wave with and without the relay, at night with and without the beam.

Common errors it fixes

  • Towers flickering because allocation depends on distance or array order.
  • Towers still firing after their relay was sold.
  • Night rules that hide enemies on screen but not from targeting.

Credits

Design ideas from Last Beacon by stackloomdev (MIT). Code, layout and text are ours.

Requirements

  • Any engine: the rules are plain JavaScript and port line by line
  • Node.js 20+ to run the tests; Chrome for the browser check

Topics

FAQ

Based on Last Beacon by stackloomdev (MIT). Ideas only: GameSkill wrote the code and text; CREDITS.md in the ZIP lists every source.

Works well with

Skills the author points to as related or as the better fit for neighbouring tasks.

Similar skills

open-game-skills
GDT
Starter kit
6

open-game-skills

An MIT pack of about 190 SKILL.md agent skills for game design: combat feel, camera, traversal, world, validation, 2D/Spine and art pipeline, with a dispatcher and adapters for Three.js, PixiJS, Phaser, Cocos, Godot, Unity and Unreal.

Engine-agnosticGodotUnityClaude Code · Codex +1
Kart Drift Boost
WEB
Skill
By GameSkill

Kart Drift Boost (tiers, windows, ramps)

A GameSkill original: arcade kart drift-boost rules that reward skill. Drifts charge three tiers, release opens a 0.85 s window you must press in, counter-steer adds a CUT bonus, ramps give one air and one landing boost, boosts take the maximum instead of stacking, and walls cancel everything pending.

Web (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2
One-button Flight
WEB
Skill
By GameSkill

One-button Flight (fair tap-to-flap)

A GameSkill original: the rules of a one-button flight game that is never unfair. Flaps set speed instead of adding it, a fixed-step simulation plays the same at 30 and 144 fps, the hitbox forgives grazes, and a seeded gap generator stays inside the reachable band, checked by an autopilot.

Web (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2
Procedural Low-Poly Buildings
WEB
Skill
By GameSkill

Procedural Low-Poly Buildings (kit, validator, views)

A GameSkill original: build stylised low-poly buildings in code from a small spec, then prove them: plot and height limits, a triangle budget per tier, closed outward meshes, supported parts, level roofs and side-only taper measured from silhouettes, plus front, side, top and 3/4 renders checked against the geometry.

Web (Phaser / Three.js)Engine-agnosticClaude Code · Codex +2