Phaser 4 examples

Time

  • 26 examples
  • 2 folders

Folders 2

Examples 11

Draw ClocksLearn how to use the progress value of multiple Timer Events to drive custom visual animations using Graphics objects.Looped EventUse the Time Manager to create a repeating timer event that triggers a callback function at a fixed interval indefinitely.Multiple TimersLearn how to manage multiple simultaneous timer events. This example demonstrates how to create several looped timers with varying delays and visualize their individual progress using text and graphics.Pause and Resume Timer EventsDemonstrates how to toggle the paused state of a Timer Event. This example uses a pointer click to stop and start a repeating timer that modifies an image's scale and rotation.Remove Timer EventDemonstrates how to stop and remove a looping timer event programmatically once a specific condition has been met.Repeat CountDemonstrates how to use the repeat property in a Timed Event to execute a callback multiple times and monitor the remaining repeat count and event progress.Reuse a Timer EventDemonstrates how to manually create a Timer Event instance and restart it by re-adding it to the Scene's Clock.Timer EventDemonstrates how to create a single-use timer event using delayedCall and monitor its completion progress in the update loop.Timer Event Start AtDemonstrates how to use the 'startAt' property to offset the initial start time of a repeating timer event, effectively starting the first iteration partway through the delay.Timer Event Time ScaleDemonstrates how to use the timeScale property to speed up or slow down individual Timer Events relative to the scene clock.Visualizing Timer ProgressDemonstrates how to use a Timer Event's getProgress and getOverallProgress methods to visually represent current iteration time and total sequence progress.