I
izark
Guest
Hello! How are you doing?
I am creating a platformer (how original!) and I have come with this problem. Here is the code for vertical collisions
I want to create a platform on which you can stand.
If you jump and that platform is over you, you don´t collide with it.
But if you are falling and that platform is beneath you, I want to have a collision to stand on it.
I want that for the rest of the characters too.
Any approach I can take ? Don´t pay much attention to those variables after //landing.
I am creating a platformer (how original!) and I have come with this problem. Here is the code for vertical collisions
I want to create a platform on which you can stand.
If you jump and that platform is over you, you don´t collide with it.
But if you are falling and that platform is beneath you, I want to have a collision to stand on it.
I want that for the rest of the characters too.
Any approach I can take ? Don´t pay much attention to those variables after //landing.
Code:
if (!place_meeting(x, y + yspeed, o_block)) {
y += yspeed;
}
else {
// Landing.
if (yspeed > 0) {
isClimbing = false;
isJumping = false;
isDismounting = false;
landing = landing_max;
dismount = dismount_max;
y = floor(y);
}
move_contact_solid(point_direction(x, y, x, y + yspeed), yspeed);
yspeed = 0;