Looked at the issue with the tiles that have normals pointing to the top right. It’s still not clear what goes wrong apart from there being a collision. Then the velocity gets changed, otherwise the entity moves again to the wall or inside the wall. So when the velocity is changed that somehow makes it that the next frame there is no collision. However it will move very slowly and would take forever to hit any collision. Therefore velocity getting increased but never being set to 0 again since the algorithm says there is no collision. I think it’s something with the normal flipping that I do that is wrong. We’ll have to see what can fix it.

Trying to figure out what is going wrong with some of the tiles. I think the normals get flipped when the entity has passed the tiles center. That causes a weird division in the diagonal and stops the entity. Though having tried several things now, I can’t seem to fix the issue. Right now I have it so that all tiles work except the problematic ones. Half of the problematic ones are working sometimes, but not always. The other half seem to just not exist. I can’t wrap my head around it, though I think I should check if the points are correct. Though basically I already did that without realizing at first and they all seem fine…

Last modified: November 10, 2022