DestinationSol icon indicating copy to clipboard operation
DestinationSol copied to clipboard

fix(mazes): fix incorrect box2d fixtures for maze tiles

Open BenjaminAmos opened this issue 3 years ago • 2 comments
trafficstars

Description

This pull request fixes incorrect maze collisions by partially-reverting the maze tile changes in https://github.com/MovingBlocks/DestinationSol/commit/e5f6c68524ef8867d06c80c504bb127ccdde643a. This causes the sprite tile textures to be correctly flipped, although it prevent mazes from using animated sprites.

Before

image

After

image

Testing

  • In the engine/src/main/resources/debugOptions.ini file, set drawPhysicBorders to true and spawnPlace to maze.
  • Start a new game.
  • Fly left towards the nearest maze.
  • Verify that all of the maze colliders are roughly the right shape and in the right place.
  • Try flying through the maze passages.

Notes

  • This fixes #576.

BenjaminAmos avatar Jan 30 '22 13:01 BenjaminAmos

I wonder if this also fixes #552 or #59 ? Different meshes tho.

Cervator avatar Feb 20 '22 21:02 Cervator

Looking at this again, it seems like the maze collision issue was introduced in https://github.com/MovingBlocks/DestinationSol/commit/e5f6c68524ef8867d06c80c504bb127ccdde643a. The animated sprite code was never used after being implemented, so I've changed this PR to revert the changes made to MazeTileObject in that commit instead, which should be a better approach.

The approach previously in this PR 'fixed' the problem by never rotating the sprites. I only realised recently that this was incorrect. The new changes should actually fix the issue.

BenjaminAmos avatar Jul 12 '22 19:07 BenjaminAmos

This pull request reverts the code to a known state where it previously worked, so there shouldn't be much risk in merging it without further delay.

BenjaminAmos avatar Sep 03 '22 15:09 BenjaminAmos