I am working on a simple game that contains two objects the player and the ground, and I used place_meeting to make the player walk on the ground object and it works fine but when I try to add another object to make the player walk on it, it didn't work and the game freeze, here is my code:
// vertical collision
if place_meeting(x,y+vsp,ground1) or place_meeting(x,y+vsp,ground2)
{
while ((!place_meeting(x,y+sign(vsp),ground1 )) or (!place_meeting(x,y+sign(vsp),oground1=2 )))
y+=sign(vsp);
if (sign(vsp) ==1)
{
grounded = 1;
}
vsp =0;
}
else
{
grounded = 0;
}
y+= vsp;