NikoPalad67140
Member
Hey guys!
I'm currently working on solid wall collision for my game. Here's my code
When the character's right side touches the wall, it works just fine. For their left side, however, they phase right through the wall.
I'm currently working on solid wall collision for my game. Here's my code
GML:
var mySolid;
///Walls
mySolid = instance_place(x+xspeed, y, objSolid);
if place_meeting(x+xspeed+1, y, mySolid)
{
xspeed = 0;
while place_meeting(x+xspeed+1, y, mySolid)
x -= 1;
}
else if place_meeting(x+xspeed-1, y, mySolid)
{
xspeed = 0;
while place_meeting(x+xspeed-1, y, mySolid)
x += 1;
}