SDL first project
Moderator: Coders of Rage
SDL first project
Hey, I'm fairly new and I have just created my first SDL 'experiment'
because I'm fairly new, and you guys are awesome, I wanted to see if you guys like it, and if the code is good or bad
http://rapidshare.com/files/444341187/rain_arrow.zip
I'm proud of it, but I have no idea if what I'm doing is right or efficient, so...
left and right click to move the stuff around
because I'm fairly new, and you guys are awesome, I wanted to see if you guys like it, and if the code is good or bad
http://rapidshare.com/files/444341187/rain_arrow.zip
I'm proud of it, but I have no idea if what I'm doing is right or efficient, so...
left and right click to move the stuff around
- adikid89
- Chaos Rift Cool Newbie
- Posts: 94
- Joined: Tue Apr 27, 2010 6:59 am
- Current Project: small tiny-mini projects
- Favorite Gaming Platforms: PC I guess...
- Programming Language of Choice: c++
Re: SDL first project
I like it! Not only is it interesting, but the code is also clean. Good job! :D
My first game C++/SDL Yoshi Combat! = http://www.youtube.com/watch?v=HQ9mMBEWSZg
==============================================================
==============================================================
Re: SDL first project
Looks nice and clean, however, you should comment or rename such variables as "int i = 0;"
I remember when I used to be into nostalgia.
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: SDL first project
I don't think i really needs much explanation but.D-e-X wrote:Looks nice and clean, however, you should comment or rename such variables as "int i = 0;"
Squares, squares everywhere...
Last edited by LeonBlade on Tue Jan 25, 2011 11:49 am, edited 1 time in total.
There's no place like ~/
Re: SDL first project
First of all, "but" what?LeonBlade wrote:I don't think i really needs much explanation but.D-e-X wrote:Looks nice and clean, however, you should comment or rename such variables as "int i = 0;"
Second of all, it's his first project, and I'm just pointing out that even though "i" might be obvious here, having i, j, k, or x everywhere (in a bigger project) without a name related to its usage, (like by convention it should have) makes it unnecessarily hard to grasp the point of its existence.
Of course, people would understand those used in for loops or as counters by general, you don't have to write:
Code: Select all
int counter = 0;
int someVar = 3;
for(;counter < someVar; ++counter) {
std::cout << "HAI!" << "\n";
}
I remember when I used to be into nostalgia.
Re: SDL first project
Thanks for the replies I'll keep in mind to name everything appropriately
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: SDL first project
Make sure you free your SDL Surfaces
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Re: SDL first project
the only surface I had was the screen, I was under the impression that SDL_Quit freed the screen only. If not then oops :/
Re: SDL first project
^ This is true, SDL_Quit() takes care of the buffer for you , so don't worry about it.sk1v3r wrote:the only surface I had was the screen, I was under the impression that SDL_Quit freed the screen only. If not then oops :/
I remember when I used to be into nostalgia.
- xiphirx
- Chaos Rift Junior
- Posts: 324
- Joined: Mon Mar 22, 2010 3:15 pm
- Current Project: ******** (Unkown for the time being)
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Contact:
Re: SDL first project
I have learned something thenD-e-X wrote:^ This is true, SDL_Quit() takes care of the buffer for you , so don't worry about it.sk1v3r wrote:the only surface I had was the screen, I was under the impression that SDL_Quit freed the screen only. If not then oops :/
StarCraft II Zerg Strategy, open to all levels of players!
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of
Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of