game__building-combat-damage

Implement data-driven combat and damage systems for 2D JavaScript games.

1|1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/erikhazzard/vasir --skill game-building-combat-damage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game__building-combat-damage
Source: https://github.com/erikhazzard/vasir/tree/main/.agents/skills/game__building-combat-damage
Command: npx skills add https://github.com/erikhazzard/vasir --skill game-building-combat-damage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Architects and implements combat and damage systems for 2D games (Canvas, WebGL, Phaser, or custom engines). Provides a modular, data-driven blueprint to ensure correct timing, extensible definitions, and consistent game feel across weapons and effects.

Core Features & Use Cases

  • Data-driven attack definitions with startup/active/recovery phases for precise timing.
  • End-to-end damage pipeline including crit, resistances, shields, DoT, projectiles, and AOE.
  • Separate collision layers for hitboxes and hurtboxes with multi-hit prevention and swept- collision options.
  • Integration hooks for UI, AI, and gameplay systems, plus extensible projectile and DoT patterns.

Quick Start

Define a basic attack with startup, active, and recovery phases and hook it into the main game loop to observe timing feedback.

Frequently Asked Questions about game__building-combat-damage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a 2D combat damage system in JavaScript?

A 2D combat damage system in JavaScript requires a modular pipeline handling attack phases, hitboxes, and damage application. This Skill provides a data-driven blueprint mapping startup, active, and recovery frames to consistent game feel.

What is the best way to structure hitboxes and hurtboxes for a 2D game?

Hitboxes and hurtboxes should use separate collision layers with multi-hit prevention and swept-collision options. This Skill separates these layers to accurately detect projectile impacts and melee overlaps without registering false repeated hits.

Does this combat system architecture work with Phaser or custom WebGL engines?

This combat system architecture works with Phaser, Canvas, WebGL, and custom JavaScript runtimes. It provides integration hooks for UI and AI systems, ensuring the damage pipeline functions correctly across different 2D engine environments.

How do I handle timing and attack phases in a 2D game damage pipeline?

Timing in a 2D game damage pipeline is handled through data-driven attack definitions using startup, active, and recovery phases. This timing-aware approach ensures precise state machine transitions and consistent weapon feedback.

Can I add damage over time and resistances to a JavaScript combat system?

You can add damage over time, crits, resistances, and shields to a JavaScript combat system. This Skill defines an extensible damage flow with events, supporting modular patterns for DoT and area-of-effect projectile damage.