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

Coding a Scroller

Started by Worthless_Knowledge Feb 3, 2004 at 5:52 PM 0 replies 450+ views
Original Post
Worthless_Knowledge
Worthless_Knowledge
Whats the secret to making a long background. Is is multiple rectangles and is it one rectangle with a big texture ? btw: i havent been programming for awhile so im a little rusty.
JTippetts
JTippetts
Usually multiple rectangles, or tiles, in the foreground. Many games will have one or more scrolling background layers, which are generally either one big image, or one smaller image repeated over and over. Just look at a game like Super Mario Bros. There was one background, with clouds and mountains, then the foreground layer comprised of blocks and bricks of different types.

More sophisticated side-scrollers make use of multiple background layers which scroll at different speeds. This is a technique called parallax. The layer representing the very furthest background objects (clouds, mountains, whatever) scrolls the most slowly, while the nearest layer scrolls rapidly, as rapidly as the main character can move.

For the top layer that the character actually interacts with--ie, the bricks, rocks, pipes, etc.-- the composition is usually tile-based rather than as larger images scrolled in parallax, the level being constructed of a large array of small rectangles, where each rectangle or grid location can be empty space, a brick, a breakable brick, or whatever.

Google for parallax scrolling to learn more.


Golem



Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller

Topic Locked

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

Sign in to reply to this topic.