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

8-Directional Player Animation doesn't work #234

Closed
TaylorHo opened this issue Mar 18, 2022 · 1 comment
Closed

8-Directional Player Animation doesn't work #234

TaylorHo opened this issue Mar 18, 2022 · 1 comment

Comments

@TaylorHo
Copy link
Contributor

When a class extends SimplePlayer, there's options for animations for idle and run in four directions (Up, Down, Left, Right), but there's also four Diagonal animations that can be passed (UpLeft, UpRight, DownLeft, DownRight), also for idle and run.

The problem is that the Diagonal Animations doesn't play. The player just go for the four main directions (Up, Down, Left and Right).

Here's an example of an implementation of the 8 directions that doesn't work (but should do):

class ExamplePlayer extends SimplePlayer {
  ExamplePlayer(Vector2 position)
      : super(
          position: position,
          size: Vector2(68, 112),
          animation: SimpleDirectionAnimation(
            idleUp: SpriteSheetIdle.up,
            idleUpLeft: SpriteSheetIdle.upLeft,
            idleUpRight: SpriteSheetIdle.upRight,
            idleDown: SpriteSheetIdle.down,
            idleDownRight: SpriteSheetIdle.downRight,
            idleDownLeft: SpriteSheetIdle.downLeft,
            idleRight: SpriteSheetIdle.right,
            idleLeft: SpriteSheetIdle.left,
            runUp: SpriteSheetRun.up,
            runUpRight: SpriteSheetRun.upRight,
            runUpLeft: SpriteSheetRun.upLeft,
            runDown: SpriteSheetRun.down,
            runDownRight: SpriteSheetRun.downRight,
            runDownLeft: SpriteSheetRun.downLeft,
            runRight: SpriteSheetRun.right,
            runLeft: SpriteSheetRun.left,
          ),
        );
}

It would be awesome if the +4 diagonal directions work properly.

Thanks a lot!!

@TaylorHo
Copy link
Contributor Author

Fixed in Pull Request #235

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

1 participant