time-and-timers

Manage timers and time-based events in Phaser 4 games.

Updated Jun 23, 2026
One-click install
npx skills add https://github.com/Joshua-Allen/stake-engine-game-dev --skill time-and-timers-joshua-allen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: time-and-timers
Source: https://github.com/Joshua-Allen/stake-engine-game-dev/tree/main/skills/time-and-timers
Command: npx skills add https://github.com/Joshua-Allen/stake-engine-game-dev --skill time-and-timers-joshua-allen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires phaser, phaser-plugin-clock-plugin, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill streamlines the management of timers and time-based events in Phaser 4, simplifying the development of game mechanics involving timing.

Core Features & Use Cases

  • TimerEvent Management: Handles single-shot, repeating, and looping timers.
  • Clock Plugin: Integrates the Clock plugin for advanced time manipulation.
  • Time Scaling: Supports time dilation and freezing for unique gameplay scenarios.
  • Use Case: Utilize this skill to implement countdown timers, in-game events, and time-sensitive challenges in Phaser 4 games.

Quick Start

Create a timer to trigger after 5 seconds in your scene's create() method.

this.time.addEvent({ delay: 5000, callback: this.onTimerComplete });

Frequently Asked Questions about time-and-timers

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

FAQPage Schema
How do I schedule a timer in Phaser 4?

To schedule a timer in Phaser 4, use the TimerEvent class via the Clock plugin to trigger callbacks at specified delays. You can configure single-shot, repeating, or looping timers directly within your game scene.

Can I manipulate time scaling for gameplay effects in Phaser 4?

Yes, time scaling is supported in Phaser 4 through the Clock plugin. You can apply time dilation or freeze time entirely to create unique gameplay scenarios and control the execution speed of time-based events.

What's the best way to create a looping time event in Phaser 4?

The best way to create a looping time event in Phaser 4 is using the TimerEvent class integrated with the Clock plugin. This approach handles repeating callbacks efficiently, simplifying the development of complex timing mechanics.

Do I need the Clock plugin to manage time-based events in Phaser 4?

Yes, you need the Clock plugin to manage time-based events in Phaser 4 using this approach. It integrates directly with the TimerEvent class to provide advanced time manipulation features like event scheduling and time scaling.

How does the TimerEvent class handle countdown timers in game development?

The TimerEvent class handles countdown timers by scheduling specific callbacks after a defined delay. In Phaser 4 game development, it manages single-shot timers to execute time-sensitive challenges and in-game events accurately.

Why are my Phaser 4 time events not triggering correctly?

Phaser 4 time events may not trigger correctly if the Clock plugin is not properly configured or if the TimerEvent delay parameters are incorrectly set. Ensure your scene integrates the Clock plugin for accurate event scheduling.