actions-and-utilities

Batch applies Phaser.Actions and utility functions to arrays of Game Objects.

Updated Jun 21, 2021
One-click install
npx skills add https://github.com/mahirocoko/mahirocoko --skill actions-and-utilities-mahirocoko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: actions-and-utilities
Source: https://github.com/mahirocoko/mahirocoko/tree/main/plugins/phaser/skills/actions-and-utilities
Command: npx skills add https://github.com/mahirocoko/mahirocoko --skill actions-and-utilities-mahirocoko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers batch-apply Phaser 4 utility functions and actions to arrays of Game Objects, enabling efficient grid layouts, alignment, and mass property updates without repetitive code.

Core Features & Use Cases

  • Batch apply Phaser.Actions to groups of Game Objects (e.g., GridAlign, Spread, IncX) to quickly arrange and mutate properties.
  • Use Phaser.Utils helpers in tandem (Array, Objects, and String utilities) for complex workflows like batching, filtering, and coordinate transformations.
  • Use Case: Create a 5x4 grid of sprites, stagger their alpha, and offset positions in a single pass.

Quick Start

Batch-apply actions and utilities to a group of game objects in a Phaser scene.

Frequently Asked Questions about actions-and-utilities

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

FAQPage Schema
How do I arrange Phaser game objects in a grid layout?

You can batch apply Phaser.Actions.GridAlign to an array of objects to arrange Phaser game objects in a grid layout. This automatically positions sprites into specified rows and columns, organizing many objects efficiently without repetitive code.

What is the best way to batch update properties across multiple Phaser sprites?

The best way to batch update properties across multiple Phaser sprites is applying Phaser.Actions and Phaser.Utils helpers to an array of game objects. This stateless approach applies incremental changes like alpha staggering or position offsets in a single pass.

Does Phaser 4 support batch array manipulation for game object alignment?

Phaser 4 supports batch array manipulation for game object alignment. You can use Phaser.Actions to spread, align, and offset properties across arrays of game objects, relying on stateless one-shot functions to mutate collections efficiently.

How do I apply coordinate transformations to a group of Phaser game objects?

You apply coordinate transformations to a group of Phaser game objects by using Phaser.Utils helpers in tandem with batch actions. These utilities enable complex workflows like batching, filtering, and coordinate transformations across an entire array of objects.

Can I stagger alpha and offset positions for sprites in a single pass in Phaser?

You can stagger alpha and offset positions for sprites in a single pass in Phaser. By batch applying actions like IncX and utility functions to an array, you mutate multiple properties across a collection of game objects simultaneously.

When should I use batch operations instead of individual updates for Phaser arrays?

Use batch operations instead of individual updates for Phaser arrays whenever you need to position, mutate, or organize many objects efficiently. Batch operations prevent repetitive code when arranging sprites or applying mass property updates.