Sign in to follow this  
OzzoNation

Building A 2D Engine In SDL

Recommended Posts

How would I go about this? I have a very basic picture of what I need to accomplish, and the classes I would make and how they would interact. I have a reference, the engine from "Focus On SDL", but I'm seeking to change it around and add my own flavor to the whole thing. I'm not asking you to make and engine for me, I know it kind of sounds that way, but more or less your own opinions and experiences on constructing these things. Articles would also be nice. I really just want it to be expandable and as simple as possible but more importantly expandable. I hope I'm not asking to much. Any help or ideas you could provide would be great. Thank you. -Scott [Edited by - OzzoNation on September 8, 2006 11:32:29 AM]

Share this post


Link to post
Share on other sites
You can expand of anything. The easiest things to expand off of is the cleanest code. If you make your code clean and comment the crap out of it, it'll be easy to expand. Basicly, if you can look at what you wrote, and figure out what it does fairly easily, then you can expand or alter it, fairly easily.

You ask for some sort of article and, well, I'm not really sure what you want. Do you want a SDL article, or a article telling how to make engines?

Lazy foo's is a SDL tutorial, and it's pretty good. (It helped me alot)
Game Engine Not SDL but it'll help you I think.

Share this post


Link to post
Share on other sites
An Example of a 2D Engine using SDL & OpenGL

I used this example as a reference myself. As has been already noted clean code makes your engine expandable. Using that reference as a basis for how an engine is built I built my own engine with as you put it my own flavor added. i.e. I didn't want to use the statemanager as the example had so I derived my own. I have since added tilemap capabilites as well as simple file I/O, and have future plans of adding scripting, error logging, and sound. I assume thats what you mean by "expandable".

My advice to you:

Stick with simple. When you want to add new capabilities make that simple too. The harder you try to get it perfect the first time the more likely you're going to get frustrated and give up.

Don't copy/paste code you see in an example just to be done with something. Be sure you understand what is going on and how it works. Even if you really like how someone else did something, use the idea but code it your way.

Take it one step at a time. Get something working then move on, don't start on sound if you can't display any video.

Draw out the picture of what you want to accomplish. Use the example in the Enginuity series posted above as a guideline.

Set small, realistic goals. You won't go from benching 150 to 400 overnight :P Remember, each small step is one step closer to the end.

Good Luck with your project :D We're here to help if you get stuck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this