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

Add isometric cell shape mode to AStarGrid2D. #81267

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Sep 3, 2023

I know some users are requesting this. This will ease up to set up this class to work with isometric TileMap's.

image

So I've added a new property cell_shape (just like the property in the TileSet) and enum for this CellShape which has 3 values: CELL_SHAPE_SQUARE (default) and CELL_SHAPE_ISOMETRIC_RIGHT/CELL_SHAPE_ISOMETRIC_DOWN (corresponds to TILE_LAYOUT_DIAMOND_RIGHT and TILE_LAYOUT_DIAMOND_DOWN enum of the TileSet respectively).

This will simply modify the resulted world coordinates and do not affect the id layout of the grid (the update method call still required if changed).

You can check the small demo project which demonstrates this change:
IsometricAStarGrid2D.zip

@Chaosus Chaosus force-pushed the astargrid_isometric_mode branch 4 times, most recently from 8fcf674 to 317e230 Compare September 3, 2023 12:01
@Chaosus Chaosus changed the title Add isometric tile shape mode to AStarGrid2D. Add isometric cell shape mode to AStarGrid2D. Sep 3, 2023
@Chaosus Chaosus added this to the 4.2 milestone Sep 3, 2023
Copy link
Contributor

@smix8 smix8 left a comment

Choose a reason for hiding this comment

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

Not that involved with AStar2D or Grid uses but from what I could test works fine.

@akien-mga akien-mga modified the milestones: 4.2, 4.3 Oct 13, 2023
@akien-mga akien-mga merged commit bbfcfe5 into godotengine:master Jan 4, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@Chaosus Chaosus deleted the astargrid_isometric_mode branch January 4, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants