• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

player can only jump once

Y

Yvalson

Guest
so i'm using phyics in my game but for some reason my player can only jump once (and not even coming close to as high as it should) and after that it looks like my player just wont jump at all. here is the code that should provide the necessary information

movement code:

///Movement
if (keyboard_check(vk_right)){
phy_position_x += Speed
sprite_index = Spr_Player_Run
image_xscale = 1
last_sprite = 0
}
if (keyboard_check(vk_left)){
phy_position_x -= Speed
sprite_index = Spr_Player_Run
image_xscale = -1
last_sprite = 1
}

if (keyboard_check(vk_up) && Jumping == false){
physics_apply_impulse(self.x, self.y, 0, -500)
Jumping = true
}

if (place_meeting(x,y+1, Obj_Stone) && !place_meeting(x+1,y, Obj_Stone)){
Jumping = false
}

if (place_meeting(x,y+1, Obj_Moving_Stone) && !place_meeting(x+1,y, Obj_Moving_Stone)){
Jumping = false
}
 
Top