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

feat: Reverse opt for Sprite.play() #257

Open
candycarmel opened this issue Jul 14, 2024 · 1 comment
Open

feat: Reverse opt for Sprite.play() #257

candycarmel opened this issue Jul 14, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@candycarmel
Copy link

Pingpong makes it so the animation plays back and forth, (forwards and then backwards), but theres no way to just reverse an animation quickly

You should be able to reverse an animation

An additional option for the Sprite.play() function (reverse: maybe?) that just reverses the animation

Not sure theres any other way this would be possible without making another animation

@lajbel lajbel added the enhancement New feature or request label Jul 14, 2024
@lajbel lajbel self-assigned this Jul 14, 2024
@lajbel lajbel added this to KAPLAY.js Jul 14, 2024
@lajbel lajbel moved this to TODO in KAPLAY.js Jul 14, 2024
@lajbel lajbel added this to the 3001 milestone Jul 14, 2024
@dragoncoder047
Copy link
Contributor

Another possible interface for backwards-playing of animations: setting theSprite.animSpeed to a negative number.

Currently I have this code in my game:

player.onStateUpdate("climbing", () => {
    if (shouldMoveUp()) {
        player.animSpeed = 1;
    } else if (shouldMoveDown()) {
        player.animSpeed = /* -1 */ 1;
    } else {
        player.animSpeed = 0;
    }
});

I would love to be able to set the animSpeed to -1 so that the animation runs backwards when the player is moving backwards, but the value is currently clamped to 0 and the animation doesn't run (which looks wrong) or I have to set it to +1 which looks even worse.

@lajbel lajbel moved this from TODO to WIP in KAPLAY.js Aug 3, 2024
@lajbel lajbel modified the milestones: 3001, 4000 Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: TODO
Development

No branches or pull requests

3 participants