gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Side-scrolling demo

#12182 - dagamer34 - Mon Nov 03, 2003 12:52 am

Does anybody have a side-scrolling demo i can look at? I am trying to see how the Super Mario Advance Series was made so i can make my own side scroller.

If anyone has comments, common pitfalls, or just helpful advice please tell me. Just so you know, i have finished(or will have finished in about 2 weeks) my first GBA game (actually, my first game too) so there is no need to baby me. If you have to get technical, do so.

Thanks a lot for helping me!
_________________
Little kids and Playstation 2's don't mix. :(

#12183 - yaustar - Mon Nov 03, 2003 2:28 am

One problem I have had with bgs is the way text backgrounds are loaded into memory (256x256 sections left to right then the next row down) and the way some map editors output the data. I had to write my own simple data convertor to save me some trouble. Make sure you know if your map editor does this or not. It will save you a lot of trouble in the long run.
_________________
[Blog] [Portfolio]

#12204 - dagamer34 - Mon Nov 03, 2003 9:10 pm

what is a map editor? and what does it do? I have heard of it but never used one (never done a side scroller before). Please don't sound astonished if you are. I just started programming the GBA 3 weeks ago.
_________________
Little kids and Playstation 2's don't mix. :(

#12218 - zazery - Tue Nov 04, 2003 6:53 am

Ever played Starcraft or Unreal Tournament 2003? If you notice there is a level editor tha comes with it. You can create your own levels or maps as yaustar said. Basically for GBA you need to create maps (where you put objects)

You could simply create something like this:

00000000
00000000
0000BB0
00000000
GGGGGG

When you want to draw that map you would just use if statements or case statements to display tiles. In the example I gave you you would replace the "G" with ground tiles (tiles you drew up), "B" for blocks like in Mario with the question mark on them, and finally 0 for nothing to draw.

Imagine if you needed to stare at Gs, Bs and 0s and of course every other letter you would use for drawing a map. It would get really scary and you would eventually make mistakes.

People make map editors/level editors to simplify the process. For example my map editor I was working on for a visual basic game of mine is like a point and click to change the tiles. First you select the tile (graphically, not letters) then you click where you want it. When you got to save it exports it in the Gs Bs and 0s and whatever else. If you want to view your map and edit again you can load it up in your editor and then modify it graphically.

If you want to read more about level editors and platform games here is a neat website I found while searching for some interesting things to program for my computer teacher who is only teaching Java.
http://www.javacooperation.gmxhome.de/indexEng.html
(it's under tutorials and Platform game basics.)

I personally haven't done a side scroller before but am working on one. The concepts come easy to me but it take a lot of work to actually get a side scroller working. There are a few editors and open source projects floating around the forums, learn from them and believe me start small and work your way big.

I do hope you got some use out of this post and I hope I cleared up your problems you dont understand.

#12393 - dagamer34 - Tue Nov 11, 2003 12:10 am

Okay, now i get what a map editor is for (won't be using it for a while i guess). Now could someone make a small (and i mean small, don't kill yourself over it) GBA Mario-type demo for me to look at and see what you did? I mean, if someone could just show me the basics i could expand on what they did and make my own. Kinda focus on the loading of the background maps and collision detection(yes, i said collision detection).

If you decide to help me out and make a demo, it doesn't have to be today. I still need to finish up my first GBA game (Tic-Tac-Toe Advance) before i start on this.
_________________
Little kids and Playstation 2's don't mix. :(

#12394 - sajiimori - Tue Nov 11, 2003 12:21 am

Quote:

don't kill yourself over it

Hahah -- that's a relief. I was planning on killing myself over it.

#12396 - yaustar - Tue Nov 11, 2003 1:23 am

for collision detection I would reccomend Lord Graga's programs but I cant find his site so try here http://downtou.cjb.net/

for the actual realtime wrapping/scrolling I would reccommend Dovoto's advanced examples at htt://www.thepernproject.com.

Map editor try mapEd from nessie http://nessie.gbadev.org/
_________________
[Blog] [Portfolio]

#12655 - dagamer34 - Fri Nov 21, 2003 1:13 am

I cannot access the site. Is there some kind of problem?
_________________
Little kids and Playstation 2's don't mix. :(

#12658 - yaustar - Fri Nov 21, 2003 2:05 am

yep, I cant spell http

http://www.thepernproject.com
_________________
[Blog] [Portfolio]

#12660 - dagamer34 - Fri Nov 21, 2003 2:45 am

Sorry, i meant Lord Graga's site. It seems only the title bar changes, the screen is just white.
_________________
Little kids and Playstation 2's don't mix. :(

#12662 - sgeos - Fri Nov 21, 2003 8:06 am

zazery wrote:
You could simply create something like this:

00000000
00000000
0000BB0
00000000
GGGGGG


If I were to code maps as opposed to using an editor, I'd do something like this:

Code:
struct stage {
   char *data;
   int w;
   int h;
};

char stage1_data =
   "                      ? !              E"
   "    ?XX?                               E"
   "                                       E"
   " S                    ?X?              E"
   "#########                              E"
   " .......                               E"
   " .......           ########            E"
   " .......      ###   ......###       ####"
   " .......       .    ...... .###      .. "
   " .......       .    ...... ...       .. ";

struct stage stage1 = {stage1_data, 40, 10};


One would need to write a function that converts ascii to game and display data.

-Brendan

#12663 - yaustar - Fri Nov 21, 2003 1:19 pm

Down to you is down so here is Lord's site
http://www.geocities.com/lordgraga1/
_________________
[Blog] [Portfolio]