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
Actions repeat forever if not cleared #1891
Comments
@herobank110 Thanks for the issue, I have a theory where the bug is coming from in excalibur. My guess based on your workaround, is that
|
One thought I had was to change up the What do you think of something like? a.actions
.easeTo(10, 100, 1000, EasingFunctions.EaseInCubic)
.delay(250)
.repeat(reContext => {
// Specific actions to repeat
reContext
.easeTo(100, 100, 1000, EasingFunctions.EaseInCubic)
.delay(250)
.easeTo(10, 100, 1000, EasingFunctions.EaseInCubic)
.delay(250)
}, 2); |
I think it's better like that, it looks more like a loop from most programming languages. |
Also that way you can define all the actions in one go |
Closes #1891 Bonus Closes #635 ## Changes: - Changes the repeat/repeatForever api to be more clear (breaking change, no longer introspects the current action queue) ```typescript a.actions .easeTo(10, 100, 1000, EasingFunctions.EaseInCubic) .delay(250) .repeat(repeatBuilder => { // Specific actions to repeat repeatBuilder .easeTo(100, 100, 1000, EasingFunctions.EaseInCubic) .delay(250) .easeTo(10, 100, 1000, EasingFunctions.EaseInCubic) .delay(250) }, 2); // Repeats twice ``` - Light refactoring to actions - Separate action types into separate files - Change ActionContext to only support 1 actor at a time (multi actor unused after groups was deprecated long ago)
Steps to Reproduce
Expected Result
Expected down movement followed by movement right and left twice before stopping.
Actual Result
Down movement, then right and left movement forever.
Environment
Current Workaround
Schedule function calls with setTimeout using pre set delays instead of repeating actions.
The text was updated successfully, but these errors were encountered: