Open
Conversation
- Declaration of tempVec was missing - Added rotation for staggerAxis = x
changed this.HexagonalTileToWorldXY (left over from labs.phaser.io test) to HexagonalTileToWorldXY
photonstorm
reviewed
May 25, 2024
| angle += rotation; | ||
|
|
||
| corners.push(new Vector2(center.x + (hexWidth * Math.cos(angle)), center.y + (hexHeight * Math.sin(angle)))); | ||
| corners.push(new Phaser.Math.Vector2(center.x + (hexWidth * Math.cos(angle)), center.y + (hexHeight * Math.sin(angle)))); |
Collaborator
There was a problem hiding this comment.
Please don't do this. Require the Vector2 and use it as per the original code. You cannot guarantee Phaser will exist in the global scope.
|
|
||
| var corners = []; | ||
|
|
||
| // Hard-coded orientation values for Pointy-Top Hexagons only |
Collaborator
There was a problem hiding this comment.
Why remove a useful comment?
Author
There was a problem hiding this comment.
The comment is contradictory, the value is not only used for Pointy-Top Hexagons, but an aid to calculating the long diagonals. Better comment: We assume a pointy-top orientation.
| } | ||
|
|
||
| // Sets the center of the tile into tempVec | ||
| var tempVec = new Phaser.Math.Vector2; |
Collaborator
There was a problem hiding this comment.
This needs to be a Vector2 and required.
Collaborator
There was a problem hiding this comment.
PR Summary
- Added missing declaration for
tempVecin/src/tilemaps/components/HexagonalGetTileCorners.js - Introduced rotation adjustment for
staggerAxis = 'x'in hexagonal tile corner calculations
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
Describe the changes below: