Jump to content
  • Advertisement

Archived

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

joshuad53

Side Scrollers

This topic is 6176 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had a quick question. Are side scrollers a good start for game programming, I have been programming for a few years but haven’t done any games. I am good at c/c++, with some directx 7/8, but don’t have any real game experience. If so does anyone know of any good material on the Internet about side scroller programming? If so thanks in advance. Joshua Davis

Share this post


Link to post
Share on other sites
Advertisement
I am sorry to say that I can''t think of any particular site. I can tell you a few basics though. By the way, you are very lucky to be using directx because it has hardware clipping. You will get plenty of bad bugs without it. I can tell you that you are going to have to make a bunch of bitmaps of pictures, give them a number representation in the game and make a file that has a bunch of numbers of where to put those pictures. For tile 0, you might want to have transparent so that you can see a slower moving 2d paralax view in the background to represent something far away that you do not go to. When starting to make the game first try making it without the player itself.

To draw tiles on the screen you should first have the necessary constants for the width and height of the tiles. Use the position of the left and top of the screen as a the screens origin. Find its position in the universe (This could be 0,0 at the beginning and would change with key presses.) Remember that you should use hardware clipping. Start with -(worldPosx % tileWidth) to draw going towards the right using the coresponding tile at worldPosx / tileWidth until reaching worldPos + screenWidth or greater then go to the next row. The first and last tiles will be clipped in most cases unless you are worldPosx % tileWidth = 0, but this should not be a concern.
When doing all this in the y direction it is basically the same.

When you get that working, you can worry about the player. In a lot of these games, the player must be near the edge of the screen and moving in the direction of that edge before it moves. Keep the player''s position and the screens position separate as well as enemies(obviously). Have your own clipping type function for characters themselves that takes the character''s position and clips it to a wake to a wakeup rectangle. This could be the size of the screen more or less.

Collision detection should between characters or missiles or whatever should be done by world positions, BUT should only be done with AWAKE enemies(flag variable). Missiles or whatever you shoot would normally be gone after they leave the screen to make it fair to the enemies but that is up to you. I would do it so that you don''t have to keep track of it and increase speed.

I could tell you a lot more and it bugs me to have to leave things out but I am tired of blabing. I hope my poor communication skills haven''t made me too confusing. If anything, buy books from Andre LaMothe. He gets a lot of praise for his ability to teach and actually show how to incorporate work into some sort of game. He gets some criticism for mistakes and typos but most of his actual sourse code is easy to get running. Warning, visual c++ is not ansi standard but is trying to make optimizations in compile time. If you get a bunch of warnings on programs it won''t compile without typecasts or #pragmas.

Share this post


Link to post
Share on other sites
Thank you very much Rudy2, your communication skills were just fine. Thank you very much for the advice and programming knowledge.

Thanks much Joshua Davis

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!