-
Notifications
You must be signed in to change notification settings - Fork 460
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
Major change to FlxTilemap/FlxTiles Improve collision, debug drawing, add various features #3158
Merged
Conversation
This file contains 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
this seems ready, still nervous as it's pretty huge (that's what she said) gonna look over it tomorrow with fresh eyes |
Merged
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.
New features
Tiles
orientAt
method in FlxTile, used to position and resize the tile based on the grid location it is meant to represent in world space.overlapsObject
method in FlxTile, can be extended or set to allow custom overlap detection for tiles whose hit shape is smaller than the tileGridonCollide
signal, dispatched when overlaps are checked for collision reasonsTilemaps
forEachOverlappingTile
method in FlxTilemap, to retrieve every tile that is overlapping the given objectforEachOverlappingTile
inoverlapsWithCallbacks
createTile
method (also added in 5.9.0 and therefore not released) to remove theallowCollisions
andvisible
args, it is recommended to simply reference the map'sdrawIndex
andcollideIndex
in your override if you need these to your tile instancesisOverlappingTile
method, allows you to check all tiles overlapping an objectobjectOverlapsTiles
to replace the now deprecatedoverlapsWithCallbacks
flipCallbackParams
arg, allowing better typing of both callback paramsisCollision
flag to control whether the Tiles' collision callbacks are fired and allows for processing non-solid tilesgetMapIndex
,getRow
,getColumn
,getTileIndex
,getTileData
,tileExists
,setTileIndex
,getColumnAt
,getRowAt
,columnExists
androwExists
Objects
processCheckTilemap
for calling overlap checking utils between some combination of objects and tilemapsseparate
andupdateTouchingFlags
Debug Drawing
tile.ignoreDrawDebug
when debug drawing tilestile.debugBoundingBoxColor
in debug drawing, if null, the map's debug drawing properties is used, as usualgetDebugBoundingBoxColor
in FlxObject. Meant to replacedrawDebugBoundingBox
, will deprecate later(semi) Breaking changes
Previously, overlaps with callback would call the callback regardless of whether the tile overlapped the object. This change only effects objects placed exactly on the edge of a tile, and typically it was used to call separate, which would not do any separation in this case. this is technically a breaking change, but the case is so rare I'm going to add this on a minor release.
TODO
New unit tests