Hello Guys ,
I am developing a running game in which player jump overs the obstacles . I am confused how to make conditions for jumping . So , that if player did anything wrong , player collides with the obstacles . in starting , first i get the horizontal distance which is to be covered and using this and current speed calculate the time required and using this time calculates the jump required . But , in this situation. Player covers all the obstacles without any difficulty . So , i change my approach and instead of time i use height required to jump over obstacle . In the later approach there is no speed involve and player is doing mistakes if player jump after certain point .
But , i want to know how mechanics work in these running and jumping game ? Some tutorial or advice . I will be very thankful to you .