 |
 |
Game Programming in Cocoa
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Calgary, Alberta, Canada
Status:
Offline
|
|
Any resources??
Help would be greatly appreciated.
|
|
"The pool on the roof must have a leak"
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2001
Location: San Jose, CA USA
Status:
Offline
|
|
Well, you can check out the BlastApp demo that should be on the developer CD; it's a simple '80s-style arcade game with a helicopter.
I guess it really depends what kind of game you want to write. If you want to do a 3D game, the really important API for you is OpenGL. You'll need to use Cocoa or Carbon to host the application and manage menus/windows/files, but that's not the majority of your code.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Calgary, Alberta, Canada
Status:
Offline
|
|
Well the game I had in mind is 2D,
But I haven't any idea where to begin
with Mac OS X.
|
|
"The pool on the roof must have a leak"
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
Well, if the game that you wish to do is something like a card game, ie you just click on something, no complex controls or anything, then you could do that with a subclass of NSView. Take a look at one of apple's included App Kit samples, I think it's called compositor or something like that, it was included with the PB Developer CD. It shows how you can break up an NSView subclass into smaller regions and draw in those and do some effects. I know that you can put an NSImage into an NSView, but I have never tried. In the NSView documentation it goes over how to recieve and track events, like mouseclicks and stuff. If all you want to do is something like chess all that should be sufficient. If you want to do something more complex, like Pacman or something, then I don't really know what you can do.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status:
Offline
|
|
This is also of some interest to me as well. I need to know how to write to an NSView subclass with NSImage (I am trying to write a 2D game). I will keep looking for the documentation I need and will post a reply here if I can answer my question before anyone else. I was also wondering if NSImage can draw a bitmap with some degree of transarency. If anyone has any idea how to receive mouse click events in the view, that would also be very greatly appreciated.
Thanks,
Jeff.
PS: exrae, ICQ (or, Fire, more accurately) me some time (#7027184). It sounds like we may be able to halp each other.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Jan 2001
Location: Seattle, WA
Status:
Offline
|
|
Why not just use OpenGL? It already supports translucency, it makes rotation, scaling and smoothing of sprites completely painless, and it is accelerated in hardware. You wouldn't need a z-buffer either, which would increase the number of sprites that could be stored in VRAM.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status:
Offline
|
|
I would be all for OpenGL because I think that in a few years 2D games will almost cease to exist but I don't know how to program OpenGL and all of the examples that came with the develooper tools are more complicated. If anyone knows of any straight-forward OS X cocoa OpenGL examples or tutorials, E-Mail me because I really do want to learn that. Or if someone can write a simple example and post a link to it here. Just something simple like a cube on a black background with the code documented to the point where we know how it does what it does. I just need the very basics like this outlined and then I will be able to figure out the more complicated stuff from the examples that Apple distributed.
Can anyone help with this?
Jeff.
|
|
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
Yeah, I wrote a simple NSOpenGLView example that is here (if my computer is in OS X)
http://gilgalad.dyndns.org/
You should be able to get it from there, the file is OpenGL.tar
or for right now, 24.48.124.9 is my IP.
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
It doesn't have any comments now, but I'll add a README file and source comments some time this week.
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|