Side-Scrolling - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Side-Scrolling (/thread-8424.html)
Side-Scrolling - pchukwura - Dec 14, 2010 03:31 PM
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.
RE: Side-Scrolling - OneSadCookie - Dec 14, 2010 04:20 PM
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".
RE: Side-Scrolling - pchukwura - Dec 14, 2010 05:22 PM
(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.
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.
RE: Side-Scrolling - OneSadCookie - Dec 14, 2010 11:10 PM
Mario is tile-based.
RE: Side-Scrolling - AndyKorth - Dec 15, 2010 09:53 AM
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.
RE: Side-Scrolling - pchukwura - Dec 15, 2010 11:28 AM
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?
RE: Side-Scrolling - Skorche - Dec 15, 2010 11:46 AM
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.
RE: Side-Scrolling - pchukwura - Dec 27, 2010 10:14 AM
(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.
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: