I tried to make a collision between two rectangles for a platformer and tried to create gravity
But whenever he lands on the ground, the person starts to vibrate rapidly
Minimum Code:
gravity += 2;
Main.Move(0, gravity*App.GetFrameTime());
while (Collision::BoundingBoxTest(Main, Ground) == true){
Main.Move(0, -2);
gravity = 0;
if (App.GetInput().IsKeyDown(sf::Key::Up)){
gravity = -400;
}
}
Also, is there a much simpler way to jump without using insane numbers?
EDIT: I just fixed it