I've created several Cocoa applications now, but I'm unsure of basic concepts of game development. I've written apps using very few custom interface elements and only very simple graphics work, and I'm looking to write a pretty basic 2D game to get started (but in realtime, not checkers or something (which I think I could handle already myself)).)
Here are some examples of the sorts of questions I'm encountering:
- I'm putting drawing code in my game view, but I suppose I'll need some sort of loop telling the entities to update?
- Should I then tell my view to update within that same loop, or should that be a separate thread?
- How should I gather mouse and keyboard information?
- Should each entity know how to draw itself, passed a context dictionary from the game view, or should the game view read each entity's properties and know how to draw everything?
Ideally, I'm looking for a tutorial with sample code that assumes basic knowledge of Cocoa, but absolutely no knowledge of game development. I'm not looking for a game library that handles these questions for me; I want to learn the answers and code something simple myself.