(Aug 1, 2010 08:21 AM)Miglu Wrote: How did you learn Cocoa game development?

I learned how to program C many many years ago. Then I learned a little about OpenGL. Then OS X came around. Then later I learned how to do some Cocoa programming.

(Aug 1, 2010 08:21 AM)Miglu Wrote: What tutorial or book should I use? Or could someone in this forum make one, or just give the source code of a simple game, like Asteroids, that is made with Cocoa and OpenGL.

That's a tall request! I can't make any promises, but if I get some spare time in the next week or two, I'll see if I can whip something together for you.

[edit] I changed the title of this thread to something a little more descriptive [/edit]

Not sure how you would do it with your technique, but if you look in my processKeys method I am equating the character to NSLeftArrowFunctionKey, NSRightArrowFunctionKey, NSUpArrowFunctionKey, or NSDownArrowFunctionKey, which works for me.

There are two problems with this code. One is that whatever the values in NSMakeSize(1.0f, 1.0f) are, the window starts as a square and when it is resized, it instantly turns into a rectangle that has the ratio of those numbers. The second is that the view is not resized. Could you correct this?

To get the view to resize automatically, you need to go into the nib and select the view. Then in the inspector, click on the little ruler tab. There you will see Size & Position, and below that will be Autosizing. In the autosizing section there is a little box on the left. Click in the center of the little box until you have red arrows pointing both up and down and left and right. That will set the view to follow the size of the window.