W
whalekid
Guest
hi, i'm making a 2d platformer and my current code for jumping is such:
if !place_meeting (x, y+1, o_solid)
{
vspeed_ += gravity_;
} else{
if keyboard_check_pressed(vk_space)
vspeed_= -16; }
this works fine for the one object, but now i have another collision object (o_wall), and i can't jump while standing on it, and i can't find a way to include it in this code without making jumping impossible on both objects. if this isn't clear enough let me know, i'm pretty new to this stuff. thank you!
if !place_meeting (x, y+1, o_solid)
{
vspeed_ += gravity_;
} else{
if keyboard_check_pressed(vk_space)
vspeed_= -16; }
this works fine for the one object, but now i have another collision object (o_wall), and i can't jump while standing on it, and i can't find a way to include it in this code without making jumping impossible on both objects. if this isn't clear enough let me know, i'm pretty new to this stuff. thank you!