5 Replies - 923 Views - Last Post: 29 November 2009 - 01:44 AM Rate Topic: -----

#1 athlon32  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 116
  • View blog
  • Posts: 363
  • Joined: 20-August 08

Just some questions....

Posted 27 November 2009 - 03:02 PM

G'day,

So, I'm a pretty decent C++ programmer, and I like the idea of getting into game development (like a hobby :P). Basically the only experience i have in the subject is a pong game I made using Windows GDI functions (don't ask :unsure: ). Anyways, I've decided to try and make a 'clone' of the ever popular 'N' by metanet. Obviously this is more difficult than pong, so I have a couple of questions. Here goes:

1. I know I'll need a real graphics library and GDI won't cut it.....so which is more recommended: SDL? or allegro?
2. What is the basic idea/process behind loading levels? (pong don't got levels now does it :P)
3. How are these kinds of games organized? Examples of similar game engines might help :)

Hope I make sense. Thanks in advance :D

Is This A Good Question/Topic? 0
  • +

Replies To: Just some questions....

#2 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 726
  • View blog
  • Posts: 8,638
  • Joined: 14-September 07

Re: Just some questions....

Posted 27 November 2009 - 03:11 PM

I have been dabbling around with Allegro. I have been reading a book called Game Programming All in one by Jonathon Harbour and he uses the Allegro library. It also integrated nicely for me in Code::Blocks. I recommend at least looking into Allegro, however SDL is also very popular.
Was This Post Helpful? 0
  • +
  • -

#3 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Just some questions....

Posted 27 November 2009 - 03:15 PM

You actually could do it with GDI but I wouldn't recommend it. The main reason is that GDI can be slow and it will bottle neck your game in the rendering process. Everything else would move at a pretty good rate.

I would choose SDL or SFML for a 2D game like N. Either of them would be good for this. There are a few tutorials here on DIC, by staycrisp, on using SDL with C++. I would recommend reading them if you decide to go the SDL route. SFML is another graphics library similar to SDL. It was made for object-oriented programming while I believe SDL was originally designed for use with plain C.

Basically for loading levels you could create a CSV file to hold the different objects in your game. In the CSV file you would have the objects in your game and there position and other information about them.

On organization, if you didn't read them already ;), I would suggest reading staycrisp's SDL tutorials in the Game Programming tutorial section here. He is a great author and a great programmer. :^: He will go over the basics in the 4 tutorials on getting started with SDL.
Was This Post Helpful? 1
  • +
  • -

#4 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Just some questions....

Posted 28 November 2009 - 07:18 AM

I was gonna recommend my tutorials as well ;) Thanks Six.
Was This Post Helpful? 0
  • +
  • -

#5 athlon32  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 116
  • View blog
  • Posts: 363
  • Joined: 20-August 08

Re: Just some questions....

Posted 28 November 2009 - 11:13 PM

First off, thanks @ staycrisp for your tutorials. They're awesome :^:

I just had a few other questions, hope you can help:
1. I realized the the AI is gonna need to be more serious than pong. In N, the drones should be easy enough, but how would i program things like the missiles and the lasers????

2. In my pong game, I implemented collision detection basically like this:
// check is ball hit a side of window
if(ball.getX() <= 0)
	ball.invertDirectionX();
// .......

// check if player paddle hit ball 
if(ball.getX() <= paddleX+15)
	ball.invertDirectionX




stuff like that. I hard coded an if statement for every thing it could collide with. In a more complex game, how do you handle collision detections? If I have multiple enemies, and objects/terrain that would be one hell of a nightmare to hard code it. I'm guess it's pretty straightforward; can anyone enlighten me???

Thanks in advance :D
Was This Post Helpful? 0
  • +
  • -

#6 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 783
  • View blog
  • Posts: 7,610
  • Joined: 05-May 05

Re: Just some questions....

Posted 29 November 2009 - 01:44 AM

I wrote a series of tutorials too, but I strongly recommend the SDL/OpenGL combo as it seems to work well with writing multi-platform games. I really don't like C++ at all, I typically use C.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1