In Alto's Adventure, the terrain is dynamically generated over time, by concatenating prefabricated patterns (for example the super steep slope where you can perform a triple backflip, or any other soft slopes) in a randomic way to keep the game various from play to play.
A possible implementation can be treating these "pieces" of terrain as vertices, from which it is possible to compute normal vectors and set the facing direction of your snowboarder accordingly.
About distinguishing between sliding and jumping, you can perform some checking during each game step:
- If the user pressed/tapped for jump, perform the jump action. This applies if there's a collision underneath the player and only when key is pressed, not while it's being pressed;
- If there's a collision under the player model:
- Change speed and direction of the player according to the direction of normal vector of the terrain - to draw the player standing upright;
- Else, if the player is mid-air:
- If input key is being pressed, increase the drawing angle; if not, do nothing or change it to reach the right value to draw the player upstanding.
While the terrain is generated dynamically by jointing pre-made pieces of terraing, interacting objects - such as rocks, fireplaces, roofs, coins - are placed randomly so that they don't intersect each other (exception for coins, they can be both below or above a grind wire, for example).