DeadSigilGames
Member
Hello, i've been trying to use this method for checking the collisions on my game (Basically a 2D plataformer), but for some reason it's not working.
The code reaches the while condition normally when in range with the wall, but does nothing.
When i try it this way:
It works but when the !place_meeting becomes true, it freezes the game and i have to force close it.
Any ideas?
Also any suggestions of other methods that can work better? I'm looking forward for something more like "Castlevania SOTN" collision where you can keep running against the wall and the character slides nicely on everything without stopping or getting stuck.
GML:
movingh = hspeed;
movingv = vspeed;
if (place_meeting(x+movingh, y, obj_Floor)) {
while (!place_meeting(x+sign(movingh), y, obj_Floor)) {
hspeed += sign(movingh); // tried x += as well //
}
movingh = 0;
}
When i try it this way:
GML:
movingh = hspeed;
movingv = vspeed;
if (place_meeting(x+movingh, y, obj_Floor)) {
while (!place_meeting(x+sign(movingh), y, obj_Floor)) {
hspeed += sign(movingh); // tried x += as well //
movingh = 0;
}
}
Any ideas?
Also any suggestions of other methods that can work better? I'm looking forward for something more like "Castlevania SOTN" collision where you can keep running against the wall and the character slides nicely on everything without stopping or getting stuck.