My game is progressing along, but I seem to have run into a strange issue when using
Flip horizontal OBJECT: yes
or
Flip vertical OBJECT: yes
If the flip causes the shape to overlap another shape, the collision detection test fails - even though the objects are very obviously overlapping. It is important to note that the Rotate function and the drag function work properly, so it isn’t the logic used in the collision test.
I found a workaround, but I wanted to know if this is normal behavior for GDevelop?
(workaround is to move the selected object +1 px on the X and Y axis, then move it -1 px on both axis - this causes the collision detection to register positive if the shapes are overlapping).
I have uploaded a .zip of the partial game (Google Drive - flip shape collision issue.zip) if anyone wants to test the behavior (the workaround is disabled in the example).
For everyone else, I have included the following extensions (some of which are needed for testing:
- selecting a shape.
- dragging the shape (without using behavior due to abnormal behavior) while keeping it inside the scene boundaries.
- snapping the shape to a grid, but only when the shape is within the boundaries of the ‘tray’.
- rotating the shape (90 degree increments)
- flipping the shape (horizontal and vertical)
- detecting collision between the selected shape and the borders of the ‘tray’
- detecting collision with another shape
When I finish the project (actually part 1 of 12), I hope to make the extensions available to the community at large. In the mean time, feel free to examine and borrow the logic (please provide credit in comments for borrowed code).
Thanks to all for helping me get to this point!
Art.