vue-phaserjs

Integrate Vue with Phaser using markRaw and Pick-based configuration patterns.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill vue-phaserjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-phaserjs
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/vue-phaserjs
Command: npx skills add https://github.com/Esposter/Esposter --skill vue-phaserjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Esposter vue-phaserjs integration patterns — component inventory, markRaw for Phaser objects in Pinia stores, configuration Pick pattern. Apply when writing Phaser game objects, stores, or vue-phaserjs components.

Core Features & Use Cases

  • Component inventory and conventions for organizing Phaser-related Vue components, stores, and assets.
  • markRaw guidance for safely storing Phaser objects in Pinia reactive state to avoid Vue's reactivity overhead.
  • Pick-based configuration patterns to derive typed interfaces from Phaser game object types to ensure strong typing and reuse.
  • Use Case: Standardize how you create and configure game objects, integrate with Pinia, and compose vue-phaserjs components across a Vue app.

Quick Start

Begin by creating each game object as a 4-file component (Configuration.ts, EventEmitsOptions.ts, SetterMap.ts, <Name>.vue) and wire Phaser objects into Pinia stores using markRaw.

Frequently Asked Questions about vue-phaserjs

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

FAQPage Schema
How do I integrate Phaser game objects with Vue 3 and Pinia without performance issues?

To integrate Phaser with Vue 3 and Pinia without performance issues, wrap Phaser game objects in Pinia stores using markRaw. This prevents Vue's reactivity system from deeply tracking complex Phaser instances, ensuring consistent typing and smooth game performance.

What is the 4-file component pattern for building Vue-PhaserJS components?

The 4-file component pattern for Vue-PhaserJS organizes each game object into Configuration.ts, EventEmitsOptions.ts, SetterMap.ts, and a Vue component file. This structure standardizes configuration, event handling, and setter mapping for strongly typed Phaser integration.

How do I create strongly typed configuration interfaces derived from Phaser game objects?

You create strongly typed configuration interfaces for Phaser game objects by applying a Pick-based configuration pattern. This approach derives typed interfaces directly from existing Phaser types, ensuring strong typing and reuse across your Vue application.

Do I need to know TypeScript and Pinia to use Vue-PhaserJS integration patterns?

Yes, you need familiarity with Vue 3, Pinia, TypeScript, and Phaser object patterns to implement Vue-PhaserJS integration. These prerequisites are required to effectively apply the 4-file component pattern and safely wrap Phaser objects using markRaw.

Why does Vue reactivity break or slow down when storing Phaser objects in Pinia?

Vue reactivity slows down when storing Phaser objects in Pinia because Vue attempts to deeply track complex Phaser class properties. Using markRaw on Phaser objects bypasses this reactive overhead, allowing safe storage in Pinia state without performance degradation.