Original Post
Hello, i am trying to write a simple 2D Platform Game but having trouble implementing simple platform physics.
Unfortunatly i dont have any experience in game programming or game math and i dont understand complex formulas.
What i have so far, is a player with a position rectangle a velocity vector and a list of platform objects.
I can freely move the player by controls and i have done some simple collision detection.
This is achieved by increasing the position by the velocity * (speed * frametime) and works for non platform games.
In case of a collision, the velocity is set to zero, but this has a bad side effect for platform physics which does not allow any movement on a platform where the player already collides.
I think the the player should always be pushed down by gravity until he hits a platform (falling), but should be able to move in X axis and can collide with other objects or platforms as well.
It would be really great if you can give me some advice how i can do this.
Thanks,
Final
Unfortunatly i dont have any experience in game programming or game math and i dont understand complex formulas.
What i have so far, is a player with a position rectangle a velocity vector and a list of platform objects.
I can freely move the player by controls and i have done some simple collision detection.
This is achieved by increasing the position by the velocity * (speed * frametime) and works for non platform games.
In case of a collision, the velocity is set to zero, but this has a bad side effect for platform physics which does not allow any movement on a platform where the player already collides.
I think the the player should always be pushed down by gravity until he hits a platform (falling), but should be able to move in X axis and can collide with other objects or platforms as well.
It would be really great if you can give me some advice how i can do this.
Thanks,
Final