Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer add event with loop and no delay #6225

Closed
JernejHabjan opened this issue Sep 22, 2022 · 2 comments
Closed

Timer add event with loop and no delay #6225

JernejHabjan opened this issue Sep 22, 2022 · 2 comments

Comments

@JernejHabjan
Copy link

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

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@JernejHabjan
Copy link
Author

works great. Thanks
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants