CryptidProductions
Member
I'm at a solid brick wall here and not sure what to do
NOTHING in this code is working right with the debugger showing that the while loop is never actually triggering. This results in tons of intended behavior that ranges from the objecting it using stuck in the sky or half way into the floor, as you can see in this screenshot of a test room I've been playing around in.
I've been sitting here like two hours staring at the debugger and checking various numbers while changing small things but I can find no cause for or solution to the problem. I'm tapped out.
GML:
//set variables for math
var B_Y = (sprite_height)+vspd;
var T_Y = y+vspd;
var R_X = sprite_width-5;
//find floor and land on it
if collision_line(x+2, y+B_Y, x+R_X, y+B_Y, Solid_Floor_Obj, false, true){
while !collision_line(x+5, y+B_Y, x+R_X, y+sprite_height, Solid_Floor_Obj, false, true){
y += sign(vspd);
}
vspd = 0;
}
NOTHING in this code is working right with the debugger showing that the while loop is never actually triggering. This results in tons of intended behavior that ranges from the objecting it using stuck in the sky or half way into the floor, as you can see in this screenshot of a test room I've been playing around in.
I've been sitting here like two hours staring at the debugger and checking various numbers while changing small things but I can find no cause for or solution to the problem. I'm tapped out.
Attachments
-
54 KB Views: 5