This seems to be a simple but smart way to organize the source code of larger implementation files. Ideally, coming from a Python background I’d love to keep a source file low, but I feel as this application is built out, a single file
Just type
#pragma mark (label name)
Or simply
#pragma mark
#pragma mark
For a horizontal line in your files function menu (located to the right of the file name above the editing window.)

Oh, the act of diving into a completely new framework. It’s a mix of excitement, inspiration, and absolute loss.
Having a slightly complex game to build makes me think of the grand picture, and then how to take that and put it into code. Of course, when there’s no real guide for standards, apart from a 5 paragraph “Best Practices” wiki page, then there’s a lot of experimenting
Currently I’m trying to figure out the best way to spawn objects onto the screen. I found an open source iOS game named Gorillas, which seems to be written well but uses the concept of layers to handle everything
The layer handles any sprites that may be required for that specific object, storing the CCSprite instance that would be required. I’m currently trying to understand the purpose of this over simply using a CCSprite instance that you spawn on your game/level/world layer.
Anyways, just some thoughts after another night of mostly tinkering rather than hacking.
Update:
I found this post in the cocos2d forums, which seems to outline some benefits for using a CCLayer (although the issue at hand is a bit different, the concepts are the same.)
So my friend Corey and I decided a few weeks ago that we should stop talking and actually make something cool. That cool thing is currently a mess of code and mechanic outlines that is an iOS game.
Having no knowledge of Objective-C, it is definitely a challenge, but also quite fun. Objective-C so far, feels like a very elegant and clean language.
cocos2d feels like it’s very fleshed out, and the API flows well, but everything written about it seems to be a year old, while anything new is just answers on Stackoverflow.com. Thus, there’s bit more of a learning curve here. The API documentation is pretty solid though.
Having not developed a game in many years, I’m forcing myself to work with best practices, but it feels like pre-mature optimization. I figure I’ll get over this and just write code that works, and optimize later as I understand both the language and framework more.
Working in a new environment and language is a nice change from my usual web hacking and Python scripting. Although that is enjoyable, the mind feels so refreshed after simply spending some time in XCode, despite its flaws as a code editor :-)
Tags:
cocos2d
ios
3 notes