yvodlyn
Member
Hi everyone,
Can someone help me with this issue? I want to create a perfect collision for a bouncing player. However the collision do not reach the floor before bouncing. The player bounce 14px before it reach the floor.
Create Event object player
Step event object player
Thank you!!!!
Can someone help me with this issue? I want to create a perfect collision for a bouncing player. However the collision do not reach the floor before bouncing. The player bounce 14px before it reach the floor.
Create Event object player
Code:
vspd = 0; //vertical speed
vspd_jump = -14; //vertical speed for jumping
vspd_max = 14; //max vertical speed
grv = 0.4; //gravity
Code:
vspd += grv;
GML:
//vertical collision
if (place_meeting(x,y+vspd,o_solid)){
while (!place_meeting(x,y+sign(vspd),o_solid)){
y += sign(vspd);
}
vspd = vspd_jump;
}
y += vspd;