Skip to content

Timer add event with loop and no delay #6225

@JernejHabjan

Description

@JernejHabjan

Version

  • Phaser Version: 3.6.0.beta.1-beta.10
  • Operating system: Windows 11
  • Browser: Chrome 105

Steps to reproduce

this.time.addEvent({ loop: true });

This will create timer and trigger it constantly, as there is no delay defined

solved with:

this.time.addEvent({ loop: true, delay: 1000  }); // update every second

Maybe it'd be wise to add some assert if loop is true, to make sure that some delay is provided as well. Otherwise all resources are consumed as event is looping constantly.

This issue occured after updating from 3.55.2 to 3.60.beta.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions