Making a side-scroller, give me a point in the right direction?

Started by
3 comments, last by mothmonsterman 18 years, 7 months ago
Hello, my name is Alex, and I so far been making command line games. My most recent one was a Snake clone: http://www.cplusplus.com/doc/tutorial/tut3-3.html (I don't know any html tags) and I want to step it up a bit, only I don't have any clue as to where I should begin with 2d graphics, I know I might use directX, or maybe SDL. Where to begin for a side-scroller?
Advertisement
I suggest SDL before DirectX. SDL is simple and you can get a basic window going with just a few lines of code.

Let me see here, I think I have some SDL tutorials that I use to learn SDL.:


heres one

heres another!


Have fun!


Chad.
I suggest SDL, as it is the most reasonable thing to do for a beginner. You'll have to first learn the basics of it, essentially creating a window, loading images from files, and drawing these images to the screen each frame.

Short spoiler:

You will then, as usual, create a game loop where the game logic (movement) is performed in a device-independent way (using SDL_GetTicks to measure time, for instance) and rendering is performed whenever possible.

Rendering is no different than what you did before, except that you will draw entire images at screen locations instead of characters. So is game logic. The main difference will be that:

- The character will probably be moving between map tiles, making collision detection a little bit harder.
- The screen will move around the map, forcing you to keep at all times the X (and Y) offsets at which to draw the tiles on the screen (they change based on your movement).
A side scroller is not a good first graphical project. Its a lot harder than you think.

I recommend starting out with SDL(its much easier than DX), then you should get your feet wet with a black jack or tic tac toe game. Then make something more advanced like tetris or galaga.

Then you should move on to OpenGL with SDL, and then a side scroller is up your alley.

Lazy Foo's SDL tutorials.

My aim with the tutorials was to help people starting out with SDL and graphical game programming. They're not finished yet, but most of the important content is there.

[Edited by - Lazy Foo on August 9, 2007 7:01:32 PM]

Learn to make games with my SDL 2 Tutorials

Thank you.

This topic is closed to new replies.

Advertisement