2D Sidescroller design questions

Hello!

I have a couple questions regarding the programming/design side of building a 2D sidescroller. They are as follows (these questions are assuming a game-style similar to that of Mario for Nintendo):

  • Threads: Typically, how many threads would, say, a level have? What should these threads be used for? To clarify a bit more, would I need a separate thread for jumping, firing projectiles, walk/run, each sprite on screen, ect?
  • Background: Should I have 1 long image for the background that scrolls as the player moves or have multiple backgrounds that get stitched together on the fly when the character reaches the edge of the current image?
  • Books: Can anyone reccomend any good books? I feel overwhelmed with the choices and would prefer to spend a lot of time in one good book than skin through many books. Also, don’t go to much effort researching (I’ve already been doing that). Just if there’s one in particular that you’ve worked with and enjoyed.

And I suppose that’s it. Thanks so much for any feedback!! It’s much appreciated!

Threads:

  1. Almost always 1. You rarely need more, and when you do they’re certainly not for jumping or anything like that. Everything should be run within the same game loop (and thread). Examples of the few places I multithread - multiplayer games (server / clients need different threads), stuff loading in the background,

Background:
Always tile if possible. Huge textures take up a lot of memory and a long time to load. Even if you want the whole level to look unique (like one long image), you should break up that image into screen-sized pieces so at most you are drawing two at once (if the player is on between two screens).

Books:
I’ll let others answer this one. I know a lot of people have good opinions here, and I don’t.

One of the first games I ever made was a clone of Mario (it was called Jario, LOLOLOLOL). One thing I did (that is very noob) was adding threads all over the place. For example, when the player lands on an enemy, I created a new thread to bounce them back up (that little pop-up effect), instead of maybe, I dunno, applying an impulse to the player’s velocity ::). If you do want something to happen over a certain period of time, making another thread is not at all the right approach. Instead, make a list of “Effects” or something, and just tell them to update every timestep. If you want elaboration just ask.

“it was called Jario, LOLOLOLOL”

Hahaha! Amazing!

Your answers were very helpful – I was actually watching a tutorial on YouTube where the guy was making a thread just for jumping and it had a little confused. I also figured that tiling would be more efficient and memory-friendly but it was still a grey area, so thanks.

i coincidentally only read the ones which are stated in the Java Gaming Resources here:
Killer Game Programming in Java - Andrew Davison
Developing Games in Java - David Brackeen
and I liked them, they helped. Actually Brackeens was better for me.

The rest, Eli already answered very nicely.
1 Thread - If you dont have levels, but very big open areas, you would need a background loading thread. but other than that…
And yeah Tiles. EVEN if you want one giant piece of artwork, in code, still splice it. Which is the same as tilesheets code-wise.

the project in this book is to create a mario like sidescroller. http://www.brackeen.com/javagamebook/#get

I really like the book but it’s a little over my head.

Thank you all so much!

Regarding the books, I’ve actually heard of those, which is great because it makes me feel better about investing the money.

As for my other questions, I have no more doubts. Wonderful!