-
Notifications
You must be signed in to change notification settings - Fork 485
Major change to FlxTilemap/FlxTiles Improve collision, debug drawing, add various features #3158
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
Merged
Conversation
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
|
this seems ready, still nervous as it's pretty huge (that's what she said) gonna look over it tomorrow with fresh eyes |
Merged
|
This introduced a bug with jumping, details to come |
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
orientAtmethod in FlxTile, used to position and resize the tile based on the grid location it is meant to represent in world space.overlapsObjectmethod in FlxTile, can be extended or set to allow custom overlap detection for tiles whose hit shape is smaller than the tileGridonCollidesignal, dispatched when overlaps are checked for collision reasonsTilemaps
forEachOverlappingTilemethod in FlxTilemap, to retrieve every tile that is overlapping the given objectforEachOverlappingTileinoverlapsWithCallbackscreateTilemethod (also added in 5.9.0 and therefore not released) to remove theallowCollisionsandvisibleargs, it is recommended to simply reference the map'sdrawIndexandcollideIndexin your override if you need these to your tile instancesisOverlappingTilemethod, allows you to check all tiles overlapping an objectobjectOverlapsTilesto replace the now deprecatedoverlapsWithCallbacksflipCallbackParamsarg, allowing better typing of both callback paramsisCollisionflag to control whether the Tiles' collision callbacks are fired and allows for processing non-solid tilesgetMapIndex,getRow,getColumn,getTileIndex,getTileData,tileExists,setTileIndex,getColumnAt,getRowAt,columnExistsandrowExistsObjects
processCheckTilemapfor calling overlap checking utils between some combination of objects and tilemapsseparateandupdateTouchingFlagsDebug Drawing
tile.ignoreDrawDebugwhen debug drawing tilestile.debugBoundingBoxColorin debug drawing, if null, the map's debug drawing properties is used, as usualgetDebugBoundingBoxColorin 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