Heres a problem i've been having. I have a platformer, and whenever my player hits the ground he keeps bounding. Here's the falling code
iceBoy.moveY++;
iceBoy.position.Y += moveY;
Now heres the collision code
if (HitGround())
{
iceBoy.moveY = -4;
if (gamepadState.IsButtonDown(Buttons.A))
{
iceBoy.moveY = -25;
}
touchGround = false;
}
i tried lowering the iceBoy.moveY = -4, or iceBoy.moveY -= 1, but then ice boy just falls through the ground never to be seen again. How to i make it so he stops bouncing and without him falling staright through a block?
UPDATE 1: At just -4, he bounces little enough too make it look kind of good, but he sinks through the ground first then floats back up and it looks really bad. How can i fix this easily, with just a few lines of code
moveY
2 times, then subtract one? \$\endgroup\$ – MichaelHouse♦ Feb 26 '13 at 23:25