Scroller game mechanics

I just released my first game with an actual objective and would like to start another project along with it. I have never really made any type of sidescroller game. Only in Slick2D witth thenewboston’s tutorial. Anyways, How would a simple sidescroller work like Mario.

https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR396HTkFSabZMXWmOmKLemShF_bPA3LnsPylrYcYsUvD5nVym9tQ

Once I get the hang of that, I want to move on to a multidirectional scroller like The Legends Of Zelda(Big fan).

http://t0.gstatic.com/images?q=tbn:ANd9GcQN5ClXOKGdufr-ayHLI9CmQeed_D9f0QYo-dPtwGCotkCWQ5oM

I have an idea of how to make one with different rooms that don’t scroll. Here’s an example of what I mean.

This would just be a screen size level and each room(yellow rectangle) would take you to another room. Maybe some kind of array of strings for each level?

Okay, besides the scrolling aspect of the game, how would gravity work? I made some kind of gravity simulator for testing, but I think every time you jump your velocity y increases until you hit the floor(or collision platform).

Finally, I’d like to ask, what is the best book you guys have used as a game development resource. Something that explains more on game mechanics.

Thanks, and happy coding :stuck_out_tongue: