time-and-timers

Implements timers, delayed calls, and event timelines in Phaser 4 scenes.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/onemanking/the-operator --skill time-and-timers-onemanking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: time-and-timers
Source: https://github.com/onemanking/the-operator/tree/main/.github/skills/time-and-timers
Command: npx skills add https://github.com/onemanking/the-operator --skill time-and-timers-onemanking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scheduling time-based behavior in Phaser 4 games—delayed actions, repeating spawners, cooldowns, and choreographed cutscenes—requires correct use of the Clock plugin, TimerEvent, and Timeline APIs, where mistakes like off-by-one repeat counts or forgotten play() calls cause subtle bugs. ## Core Features & Use Cases - Timer Management: Create one-shot delayed calls, finite repeating timers, and infinite loops via this.time.addEvent and delayedCall, with pause, resume, removal, and per-timer time scaling. - Timeline Sequencing: Choreograph cutscenes mixing callbacks, tweens, sounds, property sets, and custom events using absolute (at) or relative (from, in) timing, with looping and conditional guards. - Time Control: Apply slow motion or fast forward through Clock and per-event timeScale, and read progress with getElapsed, getRemaining, and getOverallProgress. - Use Case: Build an enemy wave spawner that fires every 3 seconds, then sequence a level-intro cutscene with tweens and sound effects that transitions to gameplay on a custom event. ## Quick Start Ask the AI to create a Phaser 4 scene timer that spawns an enemy every two seconds and a timeline that plays an intro cutscene before gameplay starts.

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 in Phaser?

Use this.time.delayedCall(delay, callback, args, scope) inside a scene to fire a one-shot callback after the given milliseconds. For repeating behavior, use this.time.addEvent with a delay and repeat or loop option instead.

How to make a repeating timer in Phaser 4?

Call this.time.addEvent with a delay in ms and set repeat for a finite count or loop: true for infinite firing. Note that repeat: 4 produces 5 total callback invocations, since the initial fire is separate from repeats.

What is the difference between Phaser TimerEvent and Timeline?

TimerEvent is an independent timer managed by the scene Clock that fires a callback after delays. A Timeline is a sequencer that schedules multiple actions—callbacks, tweens, sounds, property sets—at absolute or relative timestamps, and must be started with play().

Why is my Phaser timeline not playing?

Timelines always start paused, so you must call timeline.play() after creation. Also verify the scene is not paused, since Timeline updates are driven by the scene's update step and stop when the scene pauses.

How do I pause or slow down all timers in a Phaser scene?

Set this.time.paused = true to freeze all timers completely, or set this.time.timeScale to a value like 0.5 for slow motion. Individual timers can be paused via timer.paused or scaled via timer.timeScale independently.

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 in the config or use an arrow function to bind the scene context correctly.