Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  2D Sidescroller design questions  (Read 2487 times)
0 Members and 1 Guest are viewing this topic.
Offline 0026sd

Junior Newbie





« Posted 2011-09-26 17:48:20 »

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!
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #1 - Posted 2011-09-26 18:10:52 »

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  Roll Eyes. 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.

See my work:
OTC Software
Offline 0026sd

Junior Newbie





« Reply #2 - Posted 2011-09-26 18:20:40 »

"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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2011-09-26 22:08:04 »

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

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.

Offline Sinuath

Junior Member


Medals: 2



« Reply #4 - Posted 2011-09-26 23:57:32 »

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.

Hey [you][/you], you should totally check out my boring Site ~ http://davediel.com/chris
Offline 0026sd

Junior Newbie





« Reply #5 - Posted 2011-09-27 12:43:52 »

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!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (35 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (32 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!