The collision system was very bad, so I finally decided to fix it, why? Because it woudn't allow you to progress past the sixth level of the game!

The initial system relied entirely on stopping objects before a collision, but sometimes the player or enemies while turning could remain stuck in a wall and because of code that was something like this
while (place_meeting(x + hsp, y, COLLIDERS))
{
x += sign(hsp);
}
hsp = 0;
you would be yeeted to the other side of the room.
So for version 1.1.0 I made an unstuck system so that the object that was stuck in the wall would get out of the wall before the collision code was run (and the player noticed).
Then I realised that because of how the tile system works in gamemaker the tile the player was supposed to get pushed out of wasn't always the right one!
So I had to use TRIGONOMETRY (scary sound effect here)
Basically now the unstuck system checks all around the player with a for loop and trigonometric functions to find the tile that actually collides witn it, then pushes the player out of it. It seems to be working!!

Here is a list of fixes:
Fixed collision system
Player should no longer randomly teleport around
Changed a few rooms to fit in with the updated collision system
End
Thank you for reading
0 comments