Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] Small Collision problem  (Read 1725 times)

0 Members and 1 Guest are viewing this topic.

David

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
[SOLVED] Small Collision problem
« on: June 10, 2011, 03:04:29 am »
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:

Code: [Select]
     

        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