Archived

This topic is now archived and is closed to further replies.

burgc002

Side Scrolling question....

Recommended Posts

burgc002    122
I was wondering about the implementation of a side-scrolling game. Ok, for the background should I just make a big bmp say like 4000x480 and then scroll it, and if I do should I then use tiles to make like the ground or platforms? I guess I just need a push in the right direction, if anyone fells like pushing me then I would appreciate it. Thanks in advance.

Share this post


Link to post
Share on other sites
Blaster    124
I would definitely go for the tiles.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Guardian_Light    122
You should probably have a background image the size of your display buffer, and then everything else should be tiled. (Objects, platforms, ground, buildings etc...)

Tiles save video memory as opposed to large offscreen buffers. Also, it''s a heck of a lot easier to make levels with tiles, then to draw every 4000*480 scene (unless you are an artist with alot of free time =)



If all that matters is what you get in the end, why go through life?
~Michael Sikora

Share this post


Link to post
Share on other sites
burgc002    122
So have like 1 background image that repeats? ok. Then would I store the tiles in a large array or something, and track the player's position to know when to plot the correct tiles?
hehe I know that answer may take alot of time to answer, but I appreciate all help. I will also be searching for an article here, which I should have done first, sorry I will try to remember that hehe.

Edited by - burgc002 on January 28, 2002 9:49:47 PM

Share this post


Link to post
Share on other sites
Guardian_Light    122
Well covering how to make a side scroller isn''t exactly a topic that can be covered in 3 easy steps, and you seem to be anwsering your own questions (a very good thing), but I''ll try and help you avoid some pitfalls.

Your background being the size of the screen, never moves. It''s a ''distant'' background. Maybe a horizon with some clouds. Everything else is stored in an array of tiles.

You could store your tile levels in a text file as numbers (for example:

0 = nothing, 1 = grass (platform) 2 = rock etc

00000000000000000000000
00000000000000000000000
00011111100011100000022
00000000000000001111111

You have two (basic) choices when scrolling:
1) Keep the player centered in the screen at all times.
2) Let the player move nearly to the edge before moving the screen in that direction.

Tracking the player (One possibility of many):
If the player''s pixel position on screen is 400(pixels from left - start of leve) and your tiles are 50 pixels wide, 400/50 is 8, leaving the player at tile 8.




If all that matters is what you get in the end, why go through life?
~Michael Sikora

Share this post


Link to post
Share on other sites
giant    205
http://www.2dgame-tutorial.com/index.html is a tutorial that explains how to make a 2d side scroller shoot em up. I haven''t really looked at it so I cant say how good it is, but from my first glance it looks to be pretty complete.

Hope it helps.
Giant

"Only two things are infinite, the universe and human stupidity, and I''m not sure about the former." --Albert Einstein

Share this post


Link to post
Share on other sites