-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
investigate parallel actions #242
Comments
This issue hasn't had any recent activity lately and is being marked as stale automatically. |
github-actions
bot
added
the
stale
This issue or PR has not had any activity recently
label
Jul 4, 2021
5 tasks
eonarheim
added a commit
that referenced
this issue
May 27, 2022
Closes #242 This PR implements 2 new `Action` types to enable running parallel actions. `ActionSequence` which allows developers to specify a sequence of actions to run in order, and `ParallelActions` to run multiple actions at the same time. ![parallel-actions3](https://user-images.githubusercontent.com/612071/169728361-3356cdbf-3d78-481a-9a1d-b6ed706cd04b.gif) Example, moves the actor in a box while rotating it at the same time ```typescript var sequence1 = new ex.ActionSequence(actor, ctx => { ctx.easeBy(ex.vec(200, 0), 1000, ex.EasingFunctions.EaseInOutCubic); ctx.delay(500); ctx.easeBy(ex.vec(0, 200), 1000, ex.EasingFunctions.EaseInOutCubic); ctx.delay(500); ctx.easeBy(ex.vec(-200, 0), 1000, ex.EasingFunctions.EaseInOutCubic); ctx.delay(500); ctx.easeBy(ex.vec(0, -200), 1000, ex.EasingFunctions.EaseInOutCubic); ctx.delay(500); }); var sequence2 = new ex.ActionSequence(actor, ctx => { ctx.rotateBy(Math.PI, Math.PI, ex.RotationType.Clockwise); ctx.delay(500); ctx.rotateBy(Math.PI, Math.PI, ex.RotationType.CounterClockwise); ctx.delay(500); ctx.rotateBy(Math.PI, Math.PI, ex.RotationType.Clockwise); ctx.delay(500); ctx.rotateBy(Math.PI, Math.PI, ex.RotationType.CounterClockwise); ctx.delay(500); }); var parallel = new ex.ParallelActions([sequence1, sequence2]); actor.actions.repeatForever(ctx => ctx.runAction(parallel)); ``` ## Changes: - Fix some bugs in existing action types - Add the missing `EaseBy` action type - Add new `ActionSequence` action type - Add new `ParallelActions` action type
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
executing actions simultaneously
will execute moveTo() and scaleTo() at the same time
The text was updated successfully, but these errors were encountered: