time-and-timers

Manage Phaser 4 clocks, timers, and timelines for time-based actions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating time-based actions in Phaser 4 scenes can be verbose and error-prone without a centralized API for clocks, timers, and timelines.

Core Features & Use Cases

  • Clock and TimerEvent management for delays, repeats, loops, and time scaling.
  • Timeline sequencing to orchestrate callbacks, tweens, sounds, and events with absolute or relative timing.
  • Pause/resume and time-scaling controls to implement features like slow motion or synchronized gameplay.

Quick Start

Create a timer in a Scene using this.time.addEvent with a delay and a callback to trigger actions when the time elapses.

Frequently Asked Questions about time-and-timers

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

FAQPage Schema
How do I create a delayed call timer in Phaser 4?▼

To create a delayed call timer in Phaser 4, use this.time.addEvent with a delay and a callback to trigger actions when the specified time elapses. This manages time-based events centrally.

What is the best way to sequence callbacks and tweens in a Phaser 4 scene?▼

The best way to sequence callbacks and tweens in a Phaser 4 scene is using Timeline sequencing to orchestrate events with absolute or relative timing, preventing verbose and error-prone code.

Can I implement slow motion and pause features using Phaser 4 clock management?▼

Yes, you can implement slow motion and pause features using Phaser 4 clock management by utilizing the pause/resume and time-scaling controls to adjust the timeScale property.

How do I configure repeating and looping timer events in Phaser 4?▼

To configure repeating and looping timer events in Phaser 4, use TimerEvent management with properties like delay, repeat, loop, and startAt to precisely control execution intervals.

Why does coordinating time-based actions in Phaser 4 require a centralized API?▼

Coordinating time-based actions in Phaser 4 requires a centralized API because manual management of Clock and TimerEvent configurations is verbose and error-prone without a unified structure.

Does Phaser 4 timeline management support inspecting and removing active timers?▼

Yes, Phaser 4 timeline management supports inspecting and removing active timers through dedicated methods to add, remove, and check the status of running TimerEvent instances.