time-and-timers

Implements timers, delayed calls, and event timelines using the Phaser 4 Clock plugin.

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/AmirOssanloo/helix-game --skill time-and-timers-amirossanloo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: time-and-timers
Source: https://github.com/AmirOssanloo/helix-game/tree/main/.claude/skills/time-and-timers
Command: npx skills add https://github.com/AmirOssanloo/helix-game --skill time-and-timers-amirossanloo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4 game developers often struggle with scheduling time-based events correctly, hitting off-by-one errors with repeat counts, forgetting that Timelines start paused, or misusing timeScale and callbackScope. This Skill provides accurate, source-grounded guidance for the Clock plugin, TimerEvent, and Timeline APIs so time-based gameplay logic works as intended. ## Core Features & Use Cases - TimerEvent Patterns: Covers delayedCall, finite repeats, infinite loops, startAt shortcuts, pausing, removing, and resetting timers with correct callbackScope handling. - Timeline Sequencing: Explains absolute (at) and relative (from, in) scheduling, conditional events, looping, and full cutscene choreography with tweens, sounds, and custom events. - Time Control: Documents timeScale for slow motion, pausing the Clock versus individual timers, and reading timer progress and remaining time. - Use Case: When building a wave spawner that fires every 3 seconds, a slow-motion effect on player death, or a scripted intro cutscene, consult this Skill to write correct Phaser 4 timer code and avoid the 12 documented gotchas. ## Quick Start Ask the AI to create a Phaser 4 scene timer that spawns an enemy every two seconds and a timeline that plays a short intro cutscene.

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 repeating timer in Phaser 4?▼

Use this.time.addEvent with a delay, callback, callbackScope, and either repeat for a finite count or loop: true for infinite repetition. Note that repeat: 4 produces 5 total callback fires, and repeat: -1 is equivalent to loop: true.

How to schedule a sequence of events in Phaser 4?▼

Use this.add.timeline with an array of events keyed by at (absolute ms), from (offset from previous event), or in (offset from current elapsed). Timelines start paused, so you must call timeline.play() to begin the sequence.

Does Phaser 4 Timeline timeScale affect spawned tweens?▼

No, Timeline timeScale only scales the timeline's own elapsed counter. Tweens created by the timeline run at their own speed, so set the tween timeScale separately or control it through the TweenManager.

Why does my Phaser timer callback have the wrong this context?▼

If callbackScope is omitted, the TimerEvent itself becomes this inside the callback, not the scene. Pass callbackScope: this explicitly or use an arrow function to bind the scene context.

Why does a Phaser TimerEvent throw an infinite loop error?▼

A TimerEvent with delay: 0 combined with any repeat or loop setting throws 'TimerEvent infinite loop created via zero delay'. Always use a positive delay when the timer repeats.

What is the difference between pausing the Clock and setting timeScale to 0?▼

Both freeze timers, but paused = true skips the Clock update loop entirely, while timeScale = 0 still runs the loop with zero delta. Prefer paused for a full freeze of all scene timers.