• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Collision Issue

T

The Green Dev

Guest
So since my game uses decimals for movement, it's possible to clip into corners by about a single pixel if you're both frame and pixel perfect. I made something to avoid it but it doesn't seem to work.
Code:
while place_meeting(x,y,objSolid)
{
    if ysp != 0
    {
        y -= sign(ysp)
    }
    else
    {
        y -= 1
    }
}
So instead of actually moving by sign(ysp) it seems to only move by -1, which causes it to just teleport you up whenever you collide with a corner from under. It's VERY annoying, is there a way to fix this or at least have a different way to avoid corner clipping?
 
A

Aura

Guest
Code:
if (place_meeting(x, y + ysp, objSolid)) {
   while (!place_meeting(x, y + sign(ysp), objSolid)) {
      y += sign(ysp);
   }
   ysp = 0;
}
Does that not do what you want?
 
Top