Posted by Tim Jones on June 9th, 2008
The following user tutorial was created by Arseniy B., for the purpose of expanding upon the SDLTutorials.com series, and expounding upon the use of SDL. This tutorial, though not purposely a part of the SDLTutorials.com or created for the series, may be a branch or addition to the series. Please read notes by the author for any additional code and/or framework used by the author. If you wish to submit your own tutorial to this site, please visit the “User Tutorials” page.
IMPORTANT NOTE: I DON’T NAME SURFACES LIKE TIM DOES. WHEN HE CALLS IT Surf_Display, MINE IS SIMPLY SurfDisplay, WITHOUT THE UNDERSCORE. MAKE SURE YOU KNOW THIS, AND ADAPT TO THE TUTORIAL ACCORDINGLY. ALSO, WHEN I MAKE PROTOTYPES IN CLASS DEFINITIONS, THE ONLY STUFF I WRITE IN THE PARAMETERS AREA (I.E. THE PARENTHESES) IS THE TYPE OF DATA TAKEN, NOT THE NAME OF THE DATA TAKEN. THAT NAME IS ONLY IN THE ACTUAL FUNCTION DEFINITION, AT LEAST FOR ME.
This tutorial is based on everything you’ve learned by now, if you’ve been following the tutorials in order and have just finished the Maps tutorial. Get ready to get a glimpse of creating your first real game! (Not counting that fabulous tic-tac-toe.) Similarly, the code this comes from is from all the code you’ve written up to the Maps tutorial, and including it. It would be wise to make a new Code::Blocks project (or a new DevC++ project, or whatever), because this tutorial will delve a different way for a bit, and you don’t want to mess up your existing code for the upcoming Collision Detection tutorial. Speaking of that, this tutorial will introduce you to very simple collision detection, on a tile-based board.
Read the rest of this entry »
Posted by Tim Jones on June 4th, 2008
Sorry guys, still no new tutorial yet, but I will have it ASAP. I did want to say though that I started a sort of User Project Wiki, to house projects that I have going on, or that many of you people might have going on. You can reach it here:
http://wiki.sdltutorials.com/
It will help me keep things organized, and prioritized; and hopefully that will help me push out tutorials faster.
Posted by Tim Jones on May 2nd, 2008
Sorry guys, been busy in life again. The wife and I have been looking into buying some land, and building a house. So some good news in the real world. I have started the next tutorial, hopefully I can get that out to everyone as soon as possible; I feel a little bad for not putting it out sooner, I know that everyone is eagerly awaiting it. For now I encourage everyone to look at a new game I am working on called Charlie and the Banana in the SDL Games section. It has Entity to Map collision, as well as Entity to Entity collision already in place (though it uses OpenGL + SDL). That may provide a bit more help than the current Kizare release.
I also have a few side tutorials in the works (SDL_ttf), but they won’t be released until the collision tutorial. Sorry to keep everyone waiting (this is a hobby you know
).
Posted by Tim Jones on April 11th, 2008
In this side tutorial we are going to be adding a soundbank that will load all of our sounds, and then we call play them via an ID whenever we want. This tutorial will only deal with sounds, not music, and mind you it’s a very basic tutorial that gets the job done. There is much that can be added to this class, for channels, groups and such, but we’re dealing with basics here. We’ll base this tutorial off of my SDL Events tutorial. So use those project files if you need something to work off of.
The first thing you need to do is download SDL mixer from the SDL website. It’s also included in the SDL library I provide on my website. Be sure to put the include files in the same directory as your SDL include files, and your lib files in the same directory as your SDL lib files to make things easier.
Read the rest of this entry »
Posted by Tim Jones on March 15th, 2008
As I stated in the last lesson, we’re going to be looking at making a Map class that will be tile based. In addition to the maps, we’ll be creating Areas that enhouse many Maps. While we could create one giant map, it’s far easier to manage many smaller maps, and also opens the possibility of tiling maps as well. By the way, head on over to the SDL Image tutorial if you haven’t already done so, we will be making the switch over to SDL Image and stop using SDL_LoadBMP. No more chatter, lets get started.
Read the rest of this entry »
Posted by Tim Jones on March 14th, 2008
This side tutorial is rather simple, short, and sweet. I am going to show you how to stop using those pesky bitmap (BMP) files that are too big and don’t support alpha transparency, and to start using other file formats for you surfaces (I personally like PNG). If you have not read my SDL Coordinates and Bliting tutorial, I encourage you to do so now. We will be building off of that tutorial, modifying the OnLoad function of the CSurface class.
The first thing you need to do is download SDL_image, the latest version, from the main SDL website. You can also download this library from the “Libraries” section of this website, under SDL. If you don’t want to worry about finding all these libraries, the SDL package I provide is good for most SDL beginners, as it provides SDL_image, and some other useful libraries. Be sure to put the include files in the same directory as your SDL include files, and your lib files in the same directory as your SDL lib files to make things easier.
Read the rest of this entry »
Posted by Tim Jones on March 13th, 2008
It’s been a while since my last post, but you can notice by my comments that I am still very much alive. I’ve been working on the next tutorial, which I hope to get on here soon. A few things have taken priority, such as my wife working as a Nurse now and my having to take care of the baby in my spare time. Also, spending time with the family when I can is a must. So I use the spare moments when I am at work to add to tutorials (or make new ones), and check comments on here. Traffic has been steadily increasing lately, and it’s a little exciting, I am just wondering why there are only a handful of people posting comments? All comments are welcome, and ports are also welcome as well! I am sure there are a few people out that use pygame and such, that would love these tutorials.
Also, I am very much open to suggestions on direction to this site. Though I am following a framework in an incremental manner, I may start having side-tutorials that explain specific subjects (such as using SDL_image, SDL_mixer, and other additional libraries).
Posted by Tim Jones on February 22nd, 2008
I know, this is kind of a weird thing and never heard of on tutorial sites. But hey, why not? I’ve decided to use a free live chat program to help any of you readers with whatever help you may need. Please keep the questions within the context and scope of this website, for example, don’t ask me a Java question, as I probably won’t be of much help. I will, however, take questions regarding the following languages and libraries: SDL, C/C++, OpenGL, Lua, PHP, mySQL, JavaScript, AJAX, or programming questions in general. I hope this is a useful feature to all of you out there.
Posted by Tim Jones on February 22nd, 2008
In this new tutorial, as I had promised before, we are going to take our hand at creating entities. Entities, for all gaming purposes, are anything that can be interacted with in any way, shape, or form. Some examples might be a monster or a treasure chest that you can open. In this sense, practically everything within the game that moves is an Entity. A rock that is part of a map, which never moves, is not an entity. But if you wanted that rock to move for whatever reason, then we’d make it an Entity. This tutorial will be split into 3 different tutorials. The first, this one you are reading, will deal with a basic Entity class structure. The next tutorial will veer off slightly to build a Map class via a tileset. Then, the last tutorial, which is what a lot of people have trouble with, will deal with Entity to Map collision, and Entity to Entity Collision.
Read the rest of this entry »
Posted by Tim Jones on February 18th, 2008
I decided to buy a domain for DevHub, as I am getting no Pagerank because of the subdomain I am using. You can still get to this site through devhub.lostfish.org, but the direct URL is now http://www.sdltutorials.com. I hope this will bring in a lot more traffic and help people find more relevant information about developing games. I don’t want people to think I am specializing in SDL only, but rather everything we do here will be built upon SDL. So expect in the future OpenGL, Lua, and other libraries being used upon SDL.