Objective-C Game development

Member
Posts: 43
Joined: 2009.02
Post: #1
I know a good deal of Ruby, and some Lisp, but recently have been wanting to get into game development. Ruby is slow. So, I want to work with Objective-C. I've started learning, but I love to learn by doing and experimenting (Why Ruby was so great for me, love the 'IRB'). Does anyone know of a good game development library to be used in junction or in place of Cocoa? Preferably something that already has methods for collision detection... >_>

Also, something like Unity, Torque, etc. but with scripting in Objective-C would be nice! (Btw, want to work on a 2d game, but 3d is fine...)

Thanks in advance,
Timothy.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
You can use RubyCocoa or MacRuby to mix ObjC and Ruby with Cocoa.
Quote this message in a reply
Member
Posts: 254
Joined: 2005.10
Post: #3
I don't think what you are looking for exists, although you may want to check out OSC's game shell.
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #4
Well, I as thinking of using SDL bindings for Objective-C, but I am having trouble compiling it (libtoolize issues?). I have another thread for that, tho. ^_^
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #5
Quote:Well, I as thinking of using SDL bindings for Objective-C, but I am having trouble compiling it (libtoolize issues?). I have another thread for that, tho. ^_^

You shouldn't need bindings as SDL is C, and objective-C is a C superset. Why not use the pre-built framework?

I don't really have an opinion on objective-c as the language to use for the game itself. It doesn't seem a popular choice.

So far I've seen objective-c as the way to interface with cocoa-write applications, more than a language I would write the game itself.

If speed isn't critical and you like the language go for it, if you are making a processor heavy game (physics etc.) C and C++ are faster, and possibly easier to port (though theoretically gcc compiles objective c also in windows, you don't get the cocoa classes).

Anyone here write all their game classes in objective C?

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #6
Well, this is more-or-less a project to learn Objective-C. I want to eventually land a job in the Mac industry, but right now programming is just a hobby. If you can suggest a way of using Ruby for the gamelogic and then Obj-C to interface with Cocoa, that would be pretty nice too (Not to keen on MacRuby, I still want to learn basic obj-c synstax, might as well do the cocoa bits in obj-c.). Also, if I do it this way, how would I implement Ruby/SDL or RUDL with it?
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #7
Y'know what, I would rather just write it all in Objective-C. Anyone know a place to find information on using C/C++ APIs in Obj-C?
Quote this message in a reply
⌘-R in Chief
Posts: 1,258
Joined: 2002.05
Post: #8
There is no information to be found. Just use them. If you're using C++ code intermixed with Objective-C, then use the extension .mm, otherwise use .m. That's it.
Quote this message in a reply
Member
Posts: 43
Joined: 2009.02
Post: #9
So, I could still follow 'http://sol.gfxile.net/gp/ch02.html' but just replace things like:
void render()
{
...
}
with
- (void)render()
{
...
} // if its an instance method or w/e, or
(void)render() ? Same with method calls?
SDL_UnlockSurface(screen);

What does that turn into in Objective-C?
[SDL_UnlockSurface:screen] ?
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #10
Objective C is a superset of C means that everything you can write in C you can write in objective C

SDL_UnlockSurface(screen); stays like that.

[SDL_UnlockSurface:screen] won't work.

btw obj-c is syntax [object method: parameter] (or [Class method: parameter] ), so you would need something like

[MySDLClass UnlockSurface:screen]

of course you need to define and implement your own MySDLClass for this to work, might be an exercise.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Switching developers mid-game development fauxdev 4 1,244 Feb 17, 2014 05:46 PM
Last Post: funkboy
  How to get started in game development! Taxxodium 18 46,804 Jun 5, 2012 03:55 PM
Last Post: AnotherJake
  [Book] Cocos2d for iPhone 1 Game Development Cookbook NathanBurba 1 5,359 Jan 8, 2012 05:40 PM
Last Post: mmztech
  iphone game development on Windows? Briksins 22 22,283 Dec 19, 2010 01:43 PM
Last Post: sefiroths
  Learning Cocoa game development Miglu 17 16,583 Aug 8, 2010 02:25 PM
Last Post: Miglu