Page 1 of 1
Basic must haves for SDL game programming
Posted: Thu Jun 07, 2012 3:16 pm
by azaron08
hello,
I was wondering if there might be some must have info,when using SDL, that everyone should know befor starting to create a game in SDL by them selves. maybe stuff like steps to follow when setting a project up,certain code, tutorials to watch, "must know" kinda of info.If you have any or multiple things please leave me a list. Im trying to get what i need to know to start a simple game like snake or tetris as a starting platform for desighning some games. I have some great ideas for some RPG or MMOs but i need to get to a level where i can start desighning those.Any help is very appreciated!
Thanks,
Azaron08
Re: Basic must haves for SDL game programming
Posted: Thu Jun 07, 2012 4:09 pm
by superLED
Before starting programming any game at all, make sure you have all your functionality in your head or on paper. Otherwise, you may ending up with "Hey, if I am going to implement this into the game, I must change the whole process of loading up images, or handling the input"
And if you are going to make an MMO with a hounded team members, keep in mind it will take you ~5 years. If you are making it on your own, pray to God that your son will pick up the project after you die, and make him pass the game over to your grandson when your son dies. It would be a great way to make sure your grandchildren is working on a really outdated game.
Re: Basic must haves for SDL game programming
Posted: Fri Jun 08, 2012 1:04 am
by azaron08
Lol k thanks!! I like that last part
Re: Basic must haves for SDL game programming
Posted: Thu Jun 21, 2012 10:59 am
by azaron08
any other help is welcome!! if you have anything else that might be helpful please add a comment
Re: Basic must haves for SDL game programming
Posted: Sat Jun 23, 2012 9:01 pm
by DistortedLance
http://www.lazyfoo.net
Lazyfoo was a pretty awesome resource for me (and I'm pretty sure many others). It doesn't get into the hardcore details about creating a game, but it gets you started with SDL, including the setup (which is often the most frustrating part). I would absolutely start with Pong if I were you; it'll introduce you to input handling, collision, basic rendering and whatnot.
Re: Basic must haves for SDL game programming
Posted: Sun Jul 08, 2012 4:47 pm
by Light-Dark
This might be a little late but anyways, my tips would be know your language, im assuming you are using C++? if so take some time to learn all about the std library and all its various containers and such some of them are pretty useful, for handling input i use something called a map, basically you can do something like this:
Code: Select all
std::map<const char*,bool> keys;
if(What ever key is down)
{
keys["Key"] = true;
}
else
{
keys["Key"] = false;
}
just a rough example, but yes as people have mentioned have a plan in your head of how you are going to do it, like are you going to use 2D arrays for storing maps or have a class or struct for tiles or just maybe just a value storing their type and have them contained in a vector or something, example:
Code: Select all
std::vector<unsigned char> tiles;
or
class Tile
{
SDL_Rect box;
unsigned char type;
}
std::vector<Tile*> Map;
I don't know if this is exactly the best method, but it's up to you to figure that out, hope this helps in someway or another!