Side-Scrolling

Apprentice
Posts: 9
Joined: 2010.11
Post: #1
So i'm trying to understand how most side scrolling 2d games are accomplished (C++ and OpenGL ES). (Monster Dash for example)

My thought is that for say the ground the character is walking on, this is could either be a very large image for the stage (doubt it) or a texture for the ground that is simply a large animated sprite that loops to give the appearance of moving.

I could be wrong with both, so I'm wanting to know what is the recommended and usual method for accomplishing this?

My assumption fails when the ground has a gap or break where the character jumps over the cliff... as it would be unlikely to swap out the entire sprite animation sequence of the ground with a different one that successfully replaces itself with the original ground texture when the gap/cliff is off the screen.

I think i'm over-thinking something that is probably simple, but any thoughts would help.

Thanks!!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You have images, which you load into textures, and draw on quads. That's really all there is to it. How you design your images is up to you, though "tiles" is a common technique.

"Advanced" here involves packing multiple things into a single image, and only drawing a part of the texture on the quad, AKA "sprite sheets".
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2010.11
Post: #3
(Dec 14, 2010 04:20 PM)OneSadCookie Wrote:  You have images, which you load into textures, and draw on quads. That's really all there is to it. How you design your images is up to you, though "tiles" is a common technique.

"Advanced" here involves packing multiple things into a single image, and only drawing a part of the texture on the quad, AKA "sprite sheets".

Hey, thanks for the quick response. I am actually familiar with textured quads and sprite sheets (as that's what I'm using). My question is really trying to understand how side-scrolling stages are created in games. Is the ground a sprite that is the size of the screen and simply loops? If so how do you take gaps in the ground(ie Mario) into account?

Is the normal sprite swapped with another that has a gap in it? Maybe an example sprite sheet of a side-scrolling game would clear things up for me if you could point me to one.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Mario is tile-based.
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #5
In mario, the ground is made up of repeating tiles. The blocks are pretty small and the grid that they repeat on is pretty clear.

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2010.11
Post: #6
I think i understand how it's accomplished now. I read up on tiling, and it's pretty simple concept, and not much work from what i'm doing now with using textured quads.

I'm sure it really depends on the quality of the artwork, but would a game like Monster Dash be tile based, as it appears less "blocky" than traditional tile-based games?

Screenshot:

[Image: 370070561_screen1.jpg]
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #7
A popular alternative to tile based games in the age of hardware accelerated graphics is to just use images and place/rotate them in some sort of an editor.

Several 2D engines that I've seen work like this: http://www.youtube.com/watch?v=bsT6otdcTv0

It can be easier to implement and work with compared to tile based editors.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2010.11
Post: #8
(Dec 15, 2010 11:46 AM)Skorche Wrote:  A popular alternative to tile based games in the age of hardware accelerated graphics is to just use images and place/rotate them in some sort of an editor.

Several 2D engines that I've seen work like this: http://www.youtube.com/watch?v=bsT6otdcTv0

It can be easier to implement and work with compared to tile based editors.

I think that's the route I'm going to take (using image and translate(move) them from right to left.

I imagine a game like Monster Dash which i posted a screenshot of earlier, could have been done this way:

perhaps one say... 100x150 image that represents the repeating ground, which can be loaded from a textured map

Another that represents the end/cliff of the ground, another that represents the beginning of the ground from a cliff, and perhaps one that is a slope or steps or something, all loaded from a textured map and reused as it sees fit.

I could then just place objects such as windows, water puddles, lamps and such every so often like the Monster Dash example.

Seems like this would be a similar method as using tiles, i just think perhaps it would be a bit simpler and maybe smoother graphics from the designer to go this route. And if a specific stage only utilizes around 5-6 images that represent the ground, and another 30 or so smaller textures that represent character, enemies and such, memory should not be an issue.

here is another game that appears (at least to my novice eyes) to not use tiles:
[Image: super-turbo-action-pig-screenshot-8.jpg]
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Slopes in Side-Scrollers Bachus 8 7,136 Jun 5, 2002 08:06 PM
Last Post: Unregistered
  Beginner, 2D side scroller Why37 2 5,729 Apr 26, 2002 10:40 PM
Last Post: Why37