C
crayon_wizard
Guest
Ok, so I've been working on the movement for my character in a platform style game and I added the ability to jump. However, whenever my character is about to land the game freezes. My code for y axis collisions is:
if(place_meeting(x,y+vsp,obj_bound))
{
while(!place_meeting(x,y+sign(vsp),obj_bound))
{
y -= sign(vsp)
}
vsp = 0;
}
I think it must just be I am going into the obj_bound (my boundary/platform) so I tried multiplying sign(vsp) by 0.1 along with a few other things but they didn't seem to help. Ideas?
if(place_meeting(x,y+vsp,obj_bound))
{
while(!place_meeting(x,y+sign(vsp),obj_bound))
{
y -= sign(vsp)
}
vsp = 0;
}
I think it must just be I am going into the obj_bound (my boundary/platform) so I tried multiplying sign(vsp) by 0.1 along with a few other things but they didn't seem to help. Ideas?