R
Raptor_Guy
Guest
This seems rather simple, but I can't figure it out. When my player is in the move state, it checks every step whether there's place_meeting(x, y-1, oSolid) && place_meeting(x, y+1, oSolid), in other words, when the player is crushed between the ground and a falling block (oSolid is a parent of the ground object), correct? If it returns true, it enters into the gameover state. But when I was playtesting, this came up:
I don't know why it's detecting that the player is directly on top of the solid (presumably the one to the left of it), because I have (what I believe is) pixel-perfect collision:
I don't know why it's detecting that the player is directly on top of the solid (presumably the one to the left of it), because I have (what I believe is) pixel-perfect collision:
Any help is appreciated!if (hspd != 0) {
if (place_meeting(x+hspd, y, oSolid)) {
while (!place_meeting(x+sign(hspd), y, oSolid)) {
x += sign(hspd);
}
hspd = 0;
}
}
if (vspd != 0) {
if (place_meeting(x, y+vspd, oSolid)) {
while (!place_meeting(x, y+sign(vspd), oSolid)) {
y += sign(vspd);
}
vspd = 0;
}
}