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: Animated tile support! #1930

Merged
merged 13 commits into from
Sep 23, 2022
Merged

feat: Animated tile support! #1930

merged 13 commits into from
Sep 23, 2022

Conversation

jtmcdole
Copy link
Contributor

@jtmcdole jtmcdole commented Sep 21, 2022

Description

Tiled supports animated tiles, and now Flame does as well...

more_animation

Checklist

  • The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs: etc).
  • I have followed the [Contributor Guide] when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #1914
Fixes #1932

@jtmcdole
Copy link
Contributor Author

converting to draft: more tests!

@jtmcdole jtmcdole marked this pull request as draft September 21, 2022 14:36
@jtmcdole jtmcdole marked this pull request as ready for review September 22, 2022 05:19
@jtmcdole
Copy link
Contributor Author

Possible further optimization from discord chat:

  1. add frameTime and frame to TileFrames
  2. update(dt): 1: walk over all TileFrames (very small group), calculatate new frame.
  3. Walk over all TileAnimation (larger group) and update batchedSource if frame value changed

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Would be good to have an example for the examples directory too.

Comment on lines 6 to 7
MutableRect.fromLTRB(this.left, this.top, this.right, this.bottom)
: super.fromLTRB(left, top, right, bottom); // must call?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment?

packages/flame_tiled/lib/src/tiled_component.dart Outdated Show resolved Hide resolved
@spydon spydon requested a review from a team September 23, 2022 11:10
@jtmcdole
Copy link
Contributor Author

Would be good to have an example for the examples directory too.

Need to remember to update it to the newest version of Flame_tiled when it's available.

@spydon
Copy link
Member

spydon commented Sep 23, 2022

Need to remember to update it to the newest version of Flame_tiled when it's available.

The examples are managed by Melos, so Melos should be updating it automatically once we release a new version.

Tiled supports animated tiles, so should Flame.

Fixes flame-engine#1914
- markdownlint.yaml was invalid yaml(???!!) - but now works in vscode!
- fixed my markdown
I'm rendering 4x1 isometrics wrong - need to fix that before finishing
- isometric maps needed better shifting logic.
- rstransform anchors - "fun".
- Update animationFrames first, memoizing the frame tracking work
- Then update the batch tiles if they were updated.
@jtmcdole
Copy link
Contributor Author

Need to remember to update it to the newest version of Flame_tiled when it's available.

The examples are managed by Melos, so Melos should be updating it automatically once we release a new version.

done!

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@spydon spydon requested a review from a team September 23, 2022 14:40
@@ -38,6 +39,7 @@ void main() {
addInputStories(dashbook);
addParallaxStories(dashbook);
addRenderingStories(dashbook);
addTiledStories(dashbook);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@spydon spydon merged commit 6410dc7 into flame-engine:main Sep 23, 2022
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.

TiledComponent.size Y size wrong Support animated tiles
3 participants