ALT: Programs for making 2D games

PS2gamrfreak
Unregistered
 
Post: #16
Thanks a lot everyone...Now what program should i use to make a 2D game in C, or C++? i have tied TNT basic but it has its own language, not C...And i got Xcode and downloaded silver creator, but it dosnt look so good...Well thanks
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #17
I'd recommend you learn the SDL API as it's crossplatform and is quite easy to understand. I have some experience with SDL and I find it good enough for creating game.
Now, programming in QuickDraw (Apple's graphics system prior to OS X) is a bit more complicated, but has some advantages. The QuickDraw API is used in Carbon applications so you shouldn't have trouble using it.

I have no experience with Quartz, which is a third possibility.

A fourth possibility is using Open GL, but I find that overkill for creating a 2D game.

If you want a freeware application to create your 2D graphics, I recommend GIMP
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #18
Don't worry about learning how to program games just yet. Get a good book (I'm sure someone here could recommend one) on C, or find an online tutorial and learn the ins and outs of the language. Then, and only then, will you need to worry about things like SDL vs. OpenGL vs. QuickDraw vs. Quartz. Feel free to ask questions as needed. Good luck! Smile
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #19
SimReality/Nick Wrote:Just for my information, there are no classes in C, correct?

To a degree. There's no feature in the language specifically designed for creating a class, but I can still use object-oriented design in my C code, and create "pseudo-classes". They look something like this:

Code:
typedef struct Object Object;

struct Object {
  /* Instance variables */
  int foo;
  int bar;
};

/* Class methods */

Object * ObjectAllocate(void);
Object * ObjectLoadFromFile(char * fileName);

/* Instance methods */

void ObjectInit(Object * object);
void ObjectDispose(Object * object);
Object * ObjectCreateCopy(Object * object);
void ObjectSaveToFile(Object * object, char * fileName);
void ObjectSetFoo(Object * object, int newFoo);
void ObjectSetBar(Object * object, int newBar);
int ObjectGetFoo(Object * object);
int ObjectGetBar(Object * object);

So, I have a struct that defines the object's instance variables, a couple of functions that serve as class methods, and instance methods that all take an Object * as their first parameter. This is pretty much the same as the this pointer in C++ or the self pointer in Objective-C; for the most part, the only real difference is the syntax used to pass it to the function, and the syntax inside the function used to access instance variables.

Hope that all made sense. To everyone else, sorry for the off-topic post.

Alex Diener
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  I have been thinking of how layers of programs in a device like an android Smartphone febinmathew 2 551 Sep 15, 2014 07:18 PM
Last Post: febinmathew
  I just want to get down to making games. Any tips? TimMcD 9 12,825 Dec 1, 2011 05:19 PM
Last Post: johncmurphy