If in a game, the actor was jumping if he was to hit a platform. What would i need to set the velocity/position/gravity in order to make him stop on the platform? Any pointers on game physics would be great. I think it's something like this?
Vector2 position ? ;
Vector2 gravity ? ;
final int Jump velocity = 11;
Vector2 Gravity(0, -12);
public void hitPlatform () {
velocity.y = ?
state = IDLE;
stateTime = 0;
}
This is the way i'm trying with velocity.y = 0;
in the hitPlatform()
and velocity adds gravity and position adds velocity in the update method but he just falls through the platform.