- If I keep pressing the up key, the player keeps floating up into the air even when there's no ladder.

- Sometimes the player won't hit the ground entirely when floating down off a platform (gravity)

- If I let go of the up key when I get to the top of a ladder, sometimes gravity will then pull the player back down.
Thanks.
Here's the information from my events:
Step Event:
COMMENT: Run code to check and set gravity.
execute code:
// Check if there's no solid collision 1 pixel under the player
if place_free(x, y + 32)
{
// Check if the object is a collision with the ladder (not solid)
if place_meeting(x, y, objLadder)
// Another check if there's a ladder under the player
|| place_meeting(x, y + 32, objLadder)
{
// Do nothing
}
// If there is no collisions...
else
{
// Set gravity direction to down...
gravity_direction = 270
// ... and speed to 1
gravity = 1.0
}
}
// If there is a collision...
else
{
// Set the gravity direction...
gravity_direction = 270
// ... and speed to 0 (no gravity)
gravity = 0
}
COMMENT: Set the sprite speed to 0.3.
execute code:
// Set the image speed to 0.3
image_speed = 0.3
COMMENT: Run code to check if the player is on a ladder or not.
execute code:
if place_meeting(x, y, objLadder) {
on_ladder = true;
} else {
on_ladder = false;
}
Collision Event with object objLadder:
COMMENT: Change sprite to back.
set the sprite to spriteBack with subimage 0 and speed 1
COMMENT: Is the up key pressed?
if expression keyboard_check_pressed(vk_up) is true
COMMENT: Move up the ladder
start moving in directions 000000010 with speed set to 4
Key Press Event for Key: (up)
COMMENT: Do ladder checking and jump
execute code:
// Checks if theres a ladder under the character
if (position_meeting(x, y, objLadder)) {
// If so, add a behavior that tells the player that he is climbing a ladder
on_ladder = true;
}
// If not, jump
else {
if !place_free(x, y + 1) { // If you're on the ground
vspeed = -6 // Do the jump
}
}











