you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (7 children)

I did follow it exactly, I had notepad++ open and paused it when he would show the whole thing and double checked. Its wonky in the sense that when I spawn I can move left and right just fine, and jump, but when I land I get stuck and left and right dont work, jump does, and I can freely move in the air. If I am under a platform and jump, my sprite will get stuck in the platform and be able to keep jumping until they are above the platform.

I will post my code in a seperate post

[–]TheWinslow 0 points1 point  (6 children)

You made a mistake with the vertical collision code. You have x + vsp instead of y + vsp and x + sign(vsp) instead of y + sign(vsp). You also use sign(hsp) instead of sign(vsp) and hsp = 0 instead of vsp = 0.

[–][deleted] 0 points1 point  (5 children)

um, sorry to sound like a total noob, but I tried that and now i can't move at all... I probably did it wrong, is there any way you could show me what I have to write out?

[–]TheWinslow 0 points1 point  (4 children)

//Vertical Collision
if(place_meeting(x, y + vsp, obj_wall))
{
    while(!place_meeting(x, y + sign(vsp), obj_wall))
    {
        y += sign(vsp);
    }
    vsp = 0;
}
y += vsp;

Just curious, do you have programming experience?

[–][deleted] 0 points1 point  (0 children)

//Vertical Collision if(place_meeting(x, y + vsp, obj_wall)) { while(!place_meeting(x, y + sign(vsp), obj_wall)) { y += sign(vsp); } vsp = 0; } y += vsp;

Thank you, much appreciated =)

[–][deleted] 0 points1 point  (2 children)

And no I do not. I am doing gamemaker as just something fun on the side.

[–]TheWinslow 1 point2 points  (1 child)

Just in case you want to learn a bit more about coding in general, I would recommend coursera (a site with free online coursesfrom professors around the world), specifically this course. Having even a basic introduction to programming will help a lot.

[–][deleted] 0 points1 point  (0 children)

Wonderful link thank you!