Skip to main content
GameDev.net gamedev.net
🔒 Locked

Asteroids 3D Game

Started by XiGency Jun 8, 2006 at 1:09 AM 7 replies 1k views
Original Post
XiGency
XiGency
This is my first ever 3D game. I programmed it over the weekend in C++ and it uses OpenGl and GLFW. It uses simple 3D shapes and particles. In the future I plan to add Sound, Music, Online High Score, Online Multiplayer, and I ultimately plan to port it to PSP with the PSPSDK from ps2dev.org. Screenshots: Photobucket - Video and Image HostingPhotobucket - Video and Image Hosting Download: Old Asteroids.zip New Download [Edited by - XiGency on June 12, 2006 5:05:08 PM]
Boder
Boder
Nice job dude! I had fun with it.

How are you doing collision detection? Are you thinking about releasing the source?
XiGency
XiGency
Thanks :). I just used the distance formula in math, so: sqrt( (x1-x2)^2 + (y1-y2)^2 ). Sure I'll release the source, it's actually really simple, only about 1,000 lines. I might have to clean it up a little bit, but I'll include it in the next release.
Boder
Boder
Thanks, I'm looking through it.

Suggestions:
1) not use glaux, I can't compile on code::blocks with mingw
2) usually functions aren't defined in header files, this works because you have one cpp file
3) use true/false over TRUE/FALSE
4) maybe not use messagebox's to make the code more cross platform
5) your code reminds me of LaMothe's asteroid game, have you seen that code?

Cheers
XiGency
XiGency
No I haven't seen LaMothe's Asteroids code. I don't think it actually requires glaux, but this is my first OpenGL app, and I don't really know what glaux does :). The reason the code is in header files instead of cpp files is because I'm using vc++ 05 and it compiles any cpp files externally, so I thought it would be easier to call them headers. The only capitalized trues and falses are in code that I've taken from other examples.

[Edited by - XiGency on June 9, 2006 10:14:19 PM]
Boder
Boder
Ok, got it to compile.

* comment out
* include
* change TRUE to true
* make sure to link with glfwdll and not the static version

Wow, did you say VC++ 5. Retro dude! Never heard about the header thing.
XiGency
XiGency
VC++ Express 2005 :).

For the game, I wanted to organize it by keeping the source in multiple files. But I had to call them headers because VC++ doesn't use makefiles, so you don't actually specify what to build, it just builds all the C and CPP files in your project. I've been trying to find a way around it, because I don't want to have to make headers for them to specify extern functions, since that seems a bit overcomplicated for a little game.

And I fixed all of the other problems, I'll upload it with the source once I add something new.
XiGency
XiGency
All right, I did a lot of work on the graphics, and added stars, Earth, the moon, and venus to the background. I also added [fake] shadows and outlines around the asteroids to make them easy to see against the background. I put the download link in the first post, along with a screenshot.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.