B
Bicaro
Guest
So I'm creating some sort of puzzle game, and my physics should work properly. But somehow the characters can jump even tho it's no speicified in the code to do so, is the hitbox range some sort of a circle or how does it work? Take a closer look at the video clip i made. Anyways the colision is off.
https://gyazo.com/4b339c569d61173953542f257ff4ac24
Thus this being the code:
https://gyazo.com/4b339c569d61173953542f257ff4ac24
Thus this being the code:
Code:
if(Player == 2) {
key_left = keyboard_check(vk_left) || keyboard_check(ord('A'));
key_right = keyboard_check(vk_right) || keyboard_check(ord('D'));
key_jump = keyboard_check_pressed(vk_up) || keyboard_check_pressed(ord('W'));
move = -key_left + key_right;
if(move != 0) {
physics_apply_force(x,y,force*move,0);
}
if(key_jump != 0 and (place_meeting(x,y+1,o_Solid) or place_meeting(x,y+1,o_Square) or place_meeting(x,y+1,o_Circle))) {
physics_apply_impulse(x,y,0,jump_force);
}
}