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: Hexagonal maps #1892

Merged
merged 5 commits into from
Sep 6, 2022
Merged

feat: Hexagonal maps #1892

merged 5 commits into from
Sep 6, 2022

Conversation

jtmcdole
Copy link
Contributor

@jtmcdole jtmcdole commented Sep 6, 2022

Description

Adds support for Tiled's Hexagonal maps.

Checklist

  • The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs: etc).
  • I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
  • 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.

Breaking Change

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

Related Issues

Fixes #1887
Similar to #1882

* Fixes flame-engine#1887
* Also adjusts offsets to match mental "bounding box" with the top-left
  at (0,0)
Function was getting too long and had too many if/else tracks
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.

Nice, good job! What angle are the hexagonal tiles in when they are angled? Looks like less than for the isometric view?

@spydon spydon requested a review from a team September 6, 2022 06:56
@jtmcdole
Copy link
Contributor Author

jtmcdole commented Sep 6, 2022

What angle are the hexagonal tiles in when they are angled

I don't know for these specific tiles, but they are not top-down. This is OK since Tiled doesn't ask you to define "length of one side" and force you into top-down mode - it asks you for tile width and height. I think this will work for trimetric hexagons (where width = 2 *h of the tile). I can experiment later today or tomorrow.

@spydon spydon merged commit 29bda33 into flame-engine:main Sep 6, 2022
@kurtome
Copy link
Contributor

kurtome commented Sep 7, 2022

@jtmcdole It looks like this PR inadvertently removed taking layer.offsetX and layer.offsetY into account when calculating the tile positions for renderable tile layers. I'm just going to add the offset as a canvas.translate(offsetX, offsetY) in the render function for that layer as part of #1886, does that sound right to you?

@jtmcdole jtmcdole deleted the hexagonalMaps branch September 7, 2022 15:36
@jtmcdole
Copy link
Contributor Author

jtmcdole commented Sep 7, 2022

@kurtome - it was in the previous PR. Sorry about that oversite!

When you do, can we add some golden tests to make sure this doesn't happen again? I added several goldens already, so it should be easy to add more.

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.

Hexagonal Support in flame_tiled
4 participants