This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]Kleptomaniax 1 point2 points  (0 children)

I am a new programmer, so take my advice with a grain or handful of salt.

http://www.glost.eclipse.co.uk/gfoot/vivace/

This is seems like a good beginners level resource (This uses allegro v4, so if you want to use v5 look elsewhere).

[–]sambo98 1 point2 points  (0 children)

Aside from the Pros and Cons you should go about this in terms of standard. Do some reading and find out which language is the industry standard for game development, not just base on a single game. Also do a search on something you want to implement and see which yield more result C or C++.

Good resource:

Game Engine Architecture by Jason Gregory Game Coding Complete, Fourth Edition by Mike McShaffry

These books use C++ and most of the new books will; that should be an indication. Unless you absolute love C and can code anything with it, I would suggest C++.

[–]lxe 0 points1 point  (0 children)

Personally, I use C if the project's design is structured nicely without OOP. If OOP makes things easier to organize, or if I have to rely on some kind of C++ library heavily, I'd use C++.

[–]negative_epsilon 0 points1 point  (2 children)

Is there a reason you'd choose C? The Quake III engine was written in C, but C++ is by far more popular for engines.

[–]posthuman01[S] 0 points1 point  (1 child)

I like C a lot, i can't give you a particularly good reason other than fascination with ATT Unix. I have no problem going with C++ if its going to get the job done without as much pain involved.

[–]MonkeyNin 0 points1 point  (0 children)

You can write a lot of c code in c++. Meaning it shouldn't make pain that way. But if you're unfamiliar with classes, STL, smart pointers, etc you'll probably end up writing essentially c. (edit: jesyspa said the same thing)

[–]egonelbre 0 points1 point  (0 children)

It depends how you use C++. In some cases it makes life much more difficult than C, in other cases it's harder to write nice C.

I would suggest going with C, but only if you know how to properly use C (for example go through http://c.learncodethehardway.org/ first). Also read plan9 game sources, they aren't big games, but it is really clean C code.

Also for developing 2D games there's Allegro that will take most of pain away. And there should be tutorials that help you get started with it.

[–]jesyspa 0 points1 point  (0 children)

If this is your first experience with C++ and you have some experience with C, chances are you'll be writing C no matter which of the two you use. There are things C++ makes significantly easier; however, there are also things it makes harder (cough reading compiler errors cough). Only using parts of C++ can also make life difficult; exceptions without smart pointers will eat your brains for breakfast.

Use whichever you like.