conman06
Member
Ok, so I know that when the Player collides with oWall, it works. But, when I try to collide with oBlock, it does not work. My game just freezes up and I have to end task. very disappointing
Here is the code for oPlayer (player) in Step: (btw vsp stands for vertical speed)
Here's a video for clarification: https://gyazo.com/68e5add3d7a815f9d53d92a78685b3f0 also I'm pretty new, just a heads up,
Here is the code for oPlayer (player) in Step: (btw vsp stands for vertical speed)
Code:
//Vertical Collision
if (place_meeting(x,y+vsp,oWall)) || (place_meeting(x,y+vsp,oBlock))
{
while (!place_meeting(x,y+sign(vsp),oWall)) || (!place_meeting(x,y+sign(vsp),oBlock))
{
y = y + sign(vsp) * 2;
}
vsp = 0;
}
y = y + vsp;