A
AlexsGame
Guest
I ran into a problem regarding my jumping animation, and I can't seem to figure out what is wrong or how to fix it.
All the other animations I have work great, and the Jumping animations also works great..... however, the jumping animation only plays when I jump while holding left or right
When I jump straight up by just pressing "UP", my jumping animation is stuck on frame 1, however if I press "UP+Right" or "Up+Left" the animation plays perfect.
If I jump straight up, then press right or left while still in the air, the animation plays through until I let go, then it snaps back to frame 1.
Can't seem to figure it out, tried re-coding my jumping/gravity code, but still it gets stuck on frame 1.
Here is the code - object32 being the floor
The jumping works great, and I have sprite_index set for when the player is not touch the floor, jumping, but it only plays the animation when I move left or right while jumping.....
If some can help me out, I'd really appreciate it, Thanks.
All the other animations I have work great, and the Jumping animations also works great..... however, the jumping animation only plays when I jump while holding left or right
When I jump straight up by just pressing "UP", my jumping animation is stuck on frame 1, however if I press "UP+Right" or "Up+Left" the animation plays perfect.
If I jump straight up, then press right or left while still in the air, the animation plays through until I let go, then it snaps back to frame 1.
Can't seem to figure it out, tried re-coding my jumping/gravity code, but still it gets stuck on frame 1.
Here is the code - object32 being the floor
Code:
if !place_meeting(x, y+1, object32)
{
sprite_index = spr_JumpMain;
image_speed = 1;
vspeed_ += gravity_;
} else {
if keyboard_check_pressed(vk_up)
{
vspeed_ = -15;
}
}
if place_meeting(x, y+vspeed_, object32)
{
while !place_meeting(x, y+sign(vspeed_), object32) {
y += sign(vspeed_);
}
vspeed_ = 0;
}
y += vspeed_;
If some can help me out, I'd really appreciate it, Thanks.