Skip to main content
GameDev.net gamedev.net
🔒 Locked

Layers of a Scroller/Platform game

Started by LJR Oct 23, 2004 at 1:37 PM 2 replies 2.8k views
Original Post
LJR
LJR
I'm planning out a 2D side scroller/platform game. Something I'd like to know is how many graphical layers should I setup in the game engine? So far I've come up with 4: - Background layer - Non-Action layer - Action layer (player is here) - Foreground layer
LJRlordjonray@gmail.comhttp://www.lordjonray.com/gamedev
Endurion
Endurion
Why not make it configurable. Maybe you want some levels with extra background layers.

Just force at least the action (player) layer to be there.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
Steven
Steven
Minimum is:

Background
Action
Forground

And from there you can add multiple layers, I know a few old DOS games had from 3 layers to about 7 on one level :D

As the last poster said, just make it configurable in your level data, that way you could also make a setting in your game pref's for complexity low - high, with low having the minimum levels on to high with alpha belded layers etc.

Loow at Tyrian (or Tyrian 2000) for idea's on what the old DOS game developers did. On Tyrian you could set your processor type from 286 (with 3 layers IIRC) to Pentium ( 5 layers with Alphablended clouds)
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
DAN200
DAN200
My OpenGL engine is currently working to have (from back to front):

* The Sky
A background image (or several background images overlayed) that tile and scroll at different rates to the main world to create parralax.

* The tiles behind the player
The images for most of the ground/walls and so-on in the world. These will be able to be animated.

* The invisible collision layer
Just a simple enum for each tile storing whether a tile is solid, passable, or a platform that can be jumped up onto, as well as the slope. Will also store a "group" ID for each tile so that certain areas of collision can be turned on and off at will, this may not seem significant, but play a game like sonic and it REGUALLY becomes apparent that some tiles are solid one second and passable the next (think when you're going down ramps or around loops).

* That where all the objects and the player is drawn
All the objects in the game are drawn in front of the background and behind the foreground, kinda obvious when you think about it.

* The tiles in front of the player
Occasionally you will have pillars, grass, or whatever, in front of the player, this is the images for that. These will also be able to be animated.

* Part of the sky in front of the world
Occasionally a sky will have images that should be drawn in FRONT of the world, for example a scrolling image of rain or snow, or parralaxing foilage, this will be done here.

* The lightmap
An offscreen buffer is created as the world objects are drawn storeing all the on-screen light objects, this is blended with the world rather cleverly to make the lighting system.

* The hud/menus/whatever
Fairly self explanatory

So far I have about half of these fully implemented and editable, it's going to be so cool

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.