• 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!

Precision mask not working. Rectangle Does.

T

TaylorBramble

Guest
So I decided to finally not be lazy and work on slopes.
I realized a problem when for a slope, i needed to use precise collision checking, so its not just a big rectangle, and on colliding, my character seems to not notice the mask at all.
I then made it more basic for debugging, using my rectangle collision floors.
See picture one. Character is standing on the floor like normal. That's with rectangle collision use.
In picture two, I'm using precise collisions, and he just falls right through, even though the mask is exactly the same.
What is going on?
My head is sore from banging it against the table.Capture.PNG Capture2.PNG
 
T

TaylorBramble

Guest
Sure, but I'm not changing code between the two, just ticking precise or rectangle in the sprite.

xsp_final = (xsp + ssp)
ysp_final = (ysp+vsp)
if (place_meeting(x+xsp_final, y, obj_parcollision))
{
yplus = 0
while(place_meeting(x+xsp_final, y-yplus, obj_parcollision) && yplus <= abs(1*xsp_final))
{
yplus += 1
}
if (place_meeting(x+xsp_final, y-yplus, obj_parcollision))
{
while(!place_meeting(x+sign(xsp), y, obj_parcollision))
{
x += sign(xsp_final)
}
xsp = 0
ssp = 0
xsp_final = 0


}
else
{
y -= yplus
}
}
if (place_meeting(x, y+ysp_final, obj_parcollision))
{
while(!place_meeting(x, y+sign(ysp_final), obj_parcollision))
{
y += sign(ysp_final)
}
ysp = 0
vsp = 0
ysp_final = 0
}

y += (ysp + vsp)
x += (xsp + ssp)
 
Top