Page 1 of 1

Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 3:26 pm
by TLcipher
I've played around with SDL and OpenGL for a while, but never actually committed to any kind of project using them before. After following tutorials for the past few weeks, I decided to create a clone of Asteroids to test my skills....



Download:
Windows: http://www.mediafire.com/?3lf3u3h4dfdwjmo
Linux: http://www.mediafire.com/?twuf4jlgdkdx4tw


Cool Stuff:
-Multiplatform, runs on linux (though only tested in Ubuntu!) and windows.
-I used OpenGL for graphics, SDL for everything (window management, sound etc)
-Collisions between asteroids
-Scores are saved and shown on the high scores screen
-Options screen (you can only change the fullscreen mode, but hey...)
-Menu system, buttons react to mouse over and mouse click


Compared to the wonderful things that are created by some of you guys, it's really not much.... but I think it turned out okay (:


Now some questions for you geniuses.

1. For text, I just drew some textured quads (using SDL_ttf to generate the surfaces from a font file, and then converted to OpenGL textures). Is this the usual/right way to do it? I know there's a few other ways to display text in OpenGL like raster etc... Would you recommend any of these for my kind of situation over textured fonts? I mean as long as everything is cleaned up okay, that's fine right?

2. You can see I have a few different 'screens' (menu, main game, options, scores..). Everytime the user goes from one screen to the other, I would cleanup everything for the previous screen and then load everything for the next. Would it be any better to load everything when the application first starts, and cleanup when it ends? Stuff like SDL and subsystems are initialised when the program first opens of course...

3. Any improvements you can suggest for it? XD

4. What should I do next? :)

Thanks guys! :cheers:

Re: Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 3:57 pm
by cypher1554R
First of all welcome to our boards :cheers:
and great job on building your game. Looks tasty.

1. If it doesn't create any bugs, memory leaks or lags and you don't have anything against the way it looks, I say it's a go.
2. I think that theoretically, you're doing it right. Menu, options, scores are separated from actual game. But in this case it's not really that important :)
3. You seem to be able to handle yourself fine :]
4. Maybe adding powerups and a constant increase of difficulty (asteroid speed, quantity),.. ?

Re: Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 4:04 pm
by Ginto8
I've just gotta say... great job. It looks really cool, and I like the way you presented the different steps in the process. I wouldn't say it's the best there is, but you're definitely well on your way to doing some impressive stuff, if I do say so myself ;)

Re: Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 4:12 pm
by EdBoon
Hey great job! Looks like you have the basics down. for a weeks worth of work thats damn good.
If you are looking for things you could do add to the gameplay, maybe powerups like was mentioned before and also maybe have the bigger asteroids break into smaller pieces when you hit them first. Other things just for learning purposes you could add UFOs that seek the player or a dynamic background with stars and stuff. It really depends on how far you want it to go. Also could add sound fx (not sure if you have already done that).

Or you could close the project and leave as is, looks fine

Anyways, welcome, good stuff, also sub'd

Re: Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 4:24 pm
by TLcipher
Thanks for all the feedback!

I think I'll just play around with the code for a bit... Backgrounds would be good (tried to do them before but couldn't quite get the OpenGL blending right) and maybe some physics like transfer of angular momentum in collisions....

Thanks again for the suggestions guys :)

Re: Asteroids - My First Proper Game!

Posted: Mon Jan 31, 2011 5:16 pm
by GroundUpEngine
Great stuff! Props on multiplatform aswell ;)

Re: Asteroids - My First Proper Game!

Posted: Sat Feb 05, 2011 2:16 pm
by THe Floating Brain
Very Nice Work!!!
btw beat your high score :-D

Re: Asteroids - My First Proper Game!

Posted: Sat Feb 05, 2011 3:30 pm
by N64vSNES
Good work. I think other than having rocks multiply, It's just as good as the original and better ;)

Re: Asteroids - My First Proper Game!

Posted: Wed Feb 09, 2011 1:12 pm
by TLcipher
Thanks for the feedback :D

Just ran it on my other machine and all the textures showed up white (meaning they were invalid). After a bit of Googling and editing in paint, I realised the problem was OpenGL couldn't handle the non power of 2 textures...

Updated the ATI drivers and everything works fine. That's strange, since I thought OpenGL "outgrew" that a while ago. I blame ATI.

I suppose I should've used power-of-2 textures from the start. That way it could run on really ancient cards as well....

I'll keep it mind for future projects ;)

Re: Asteroids - My First Proper Game!

Posted: Wed Feb 09, 2011 5:12 pm
by eatcomics
TLcipher wrote:Thanks for the feedback :D

Just ran it on my other machine and all the textures showed up white (meaning they were invalid). After a bit of Googling and editing in paint, I realised the problem was OpenGL couldn't handle the non power of 2 textures...

Updated the ATI drivers and everything works fine. That's strange, since I thought OpenGL "outgrew" that a while ago. I blame ATI.

I suppose I should've used power-of-2 textures from the start. That way it could run on really ancient cards as well....

I'll keep it mind for future projects ;)
Yeah I think someone had this problem and posted here about that recently.

Re: Asteroids - My First Proper Game!

Posted: Thu Feb 10, 2011 7:39 am
by GroundUpEngine
eatcomics wrote:
TLcipher wrote:Thanks for the feedback :D

Just ran it on my other machine and all the textures showed up white (meaning they were invalid). After a bit of Googling and editing in paint, I realised the problem was OpenGL couldn't handle the non power of 2 textures...

Updated the ATI drivers and everything works fine. That's strange, since I thought OpenGL "outgrew" that a while ago. I blame ATI.

I suppose I should've used power-of-2 textures from the start. That way it could run on really ancient cards as well....

I'll keep it mind for future projects ;)
Yeah I think someone had this problem and posted here about that recently.
+1