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

Fix jittery playlab movement #18147

Merged
merged 1 commit into from Oct 5, 2017
Merged

Fix jittery playlab movement #18147

merged 1 commit into from Oct 5, 2017

Conversation

balderdash
Copy link
Contributor

The move actor <x> up <y> pixels blocks generate a moveDistance command that stays in the queue for however many ticks it takes to move y pixels. However, they currently stay in the queue until the first tick for which they had 0 queued distance remaining, rather than being removed in the tick on which they completed. Since no new commands are enqueued unless the current queue is empty, the sprite will stop moving for 1 tick even if you're holding down the arrow button/key the whole time.

This removes the moveDistance command from the queue as soon as the queued distance reaches zero, getting rid of the jitter.

In normal playlab this is usually masked by the ticksBeforeFaceSouth property, but it's very visible in starwars or if you hold down two arrow keys to move diagonally.

Before:
movement-broken

After:
movement-fixed

@balderdash balderdash merged commit ba566fb into staging Oct 5, 2017
@balderdash balderdash deleted the starwars-move-animate branch October 5, 2017 22:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants