Therefore I decided to enable ARC in all twelve standard cocos2d Xcode project templates for both cocos2d versions (v1.1 and v2.0), both platforms (iOS and Mac OS), both physics engines (Box2D and Chipmunk) and publish them on github.
Another live report from the front…
LearnCocosTV – Episode 2: Fixing Bad
• Simple Multiplayer Data Sharing Project
• iDevBlogADay: Fast Pixel-Perfect Collision Detection
• Kobold2D 1.0.1 Released:
o KKPixelMaskSprite, KKScreenshot, Ad Banner rotation
o Solutions for “failed with exit code 1” linker errors
• Xcode Trips & Ticks
What do you do if your app doesn’t behave as it should, or even crashes?
Answer A: Post your problem in just about every programming forum.
Answer B: Use the Xcode Debugger to analyze what’s going wrong.
Since most of you already know how to do A I’ll focus on B in this Xcode 4 Debugging Crash-Course. It’s kind of aimed at beginning Xcode developers but that’s just because I hope – against better knowledge – that experienced developers already know that … thing … that debugger stuff. Ya know?
Scheduled for release on November 7th, 2011. Continue reading »
Continue reading »
A couple months ago I wrote a tutorial explaining how to upgrade Cocos2D in an existing project.
I was able to cut the description down to only five concrete steps, but there’s still a lot of text to follow and caveats to consider. I designed Kobold2D exactly to make it easy to solve the issue of upgrading projects to newer versions of the game engine.
Kobold2D users should never have to run a bash script, ever. Any project or asset management task most users will want to perform should be done with a visual tool.
I mentioned before that I had problems turning the Kobold2D project templates into the Xcode 4 Project Template format. In fact, it turned out to be impossible due to the nature of Kobold2D’s workspace setup.
Since I want to have a wide variety of project templates in Kobold2D, and definitely more than the three rudimentary templates that cocos2d-iphone offers, I needed some way to allow users to start new projects based on a template.
What I came up with is the Kobold2D Project Starter Tool:
Simple and elegant. This tool scans the projects in Kobold2D templates folder, which are regular Xcode projects with a common naming scheme (eg. _Hello-Kobold2D-Template_), and presents them to the user including a description.
Select a project template, give it a name and click Create. The tool will copy the template project to the Kobold2D folder next to all the other projects. All occurrences of _XXXX-Template_ are renamed to the user supplied project name (which is cleaned to remove illegal characters). Then the project is added to the Kobold2D.xcworkspace which the tool will open right away.
I think the biggest benefit by far is that anyone can turn his or her Xcode project into a template, simply by following the naming scheme. Anyone can create and distribute their own Kobold2D project templates.
Note: in the screenshot there are only 7 templates listed. I’ll definitely add more for the Kobold2D v1.0 release, most will be based on projects discussed in my Learn Cocos2D book. The first preview version (v0.9x) of Kobold2D will be available in about two weeks.
Today I completed the first draft of the Kobold2D chapter which will be in the second edition of the Learn Cocos2D book. In that chapter I’m also giving you an introduction to cocos3d, the official 3D add-on library for cocos2d. I ported cocos3d’s Xcode project template to Kobold2D and spiced it up a little with some cocos2d nodes in the back- and foreground:
Notice the “incoming network connection” warning. This is caused by the iSimulate library which is distributed with Kobold2D and activated by default for Simulator builds. You still need to buy the iSimulate App to benefit from it though. If you don’t you can also choose to ignore the dialog or simply disable iSimulate by commenting out a line in the project’s BuildSettings-iOS.xcconfig file.
I’ve also had great fun with the augmented reality option that the cocos3d CCNodeController class provides. And setting it up is one line of code. Here’s the “camera as live background” demo in action:
Since a picture doesn’t really do it justice, here’s a video:
Admittedly it could run a little faster on my iPhone 3G. It’s pretty taxed and averages around 20 fps with the camera background view and rendering a 3D model. My iPod Touch 4 averages at around 40 fps and it feels a lot smoother.
Kobold2D Todo List
One of the biggest items on my todo list for Kobold2D is to design the website and get rid of the “coming soon” page. This includes setting up the wiki and filling it with content, documentation for the most part. And, well, paying $150 each month because I don’t see any alternative to using Confluence. I want to enjoy working on documentation, and I want you to enjoy browsing and reading it.
I also want to create more template projects. Currently, as you can see in the first screenshot, there’s Hello Kobold2D (iOS & Mac), Hello Cocos3D (iOS) and Hello Cocos2D-X (iOS). I want to add two more templates, one for Chipmunk with SpaceManager (iOS & Mac) and one for Box2D (iOS & Mac). I also want to add the projects from my book as project templates, namely Doodle Drop, the Shoot ‘em Up game, the Orthogonal and the Isometric Tilemap projects, and the Cocos2D With UIKit project (all iOS).
Even though Kobold2D won’t have Xcode 4 Project Templates I still want to give you a quick and easy way start a new project based on one of the template projects. Notice the distinction between “project template” (those in Xcode’s New Project dialog) and “template project” (a regular, already existing project). I started writing a tool that allows you to create a copy of an existing Kobold2D template project and rename it, so that the workflow is just as convenient as doing it within Xcode. It works for the specific template I tested it with, but I still have to design the user interface and make the code fail-safe.
In case you wonder why Kobold2D won’t have Xcode Project Templates: they are not nearly as powerful as they would have to be. And they’re a pain in the rear to create and maintain without some tool support. But worst of all, you have no way of including files in an Xcode 4 project template that must not be added to the Project Navigator. Like, for example, .xcodeproj files.
Since you’re looking to install Cocos2D, you may be interested to hear about the Kobold2D game engine. Kobold2D is designed to make Cocos2D developers more productive. Of course it comes with an installer, and includes Cocos2D.
With the release of the unstable cocos2d-iphone v1.0.0 rc3 version today I’ve updated the Cocos2D Installer to include this new version, as well as an updated version of Cocos3D (v0.5.4). The installer will install the Xcode templates for you for both cocos2d and cocos3d in both Xcode 3 and Xcode 4 versions.
The Cocos2D installer includes cocos2d-iphone v0.99.5 (stable) & v1.0.0 rc3 (unstable) and cocos3d v0.5.4.
Cocos2D/Cocos3D will be installed to the user’s Documents folder in appropriately named subfolders. You can move these folders after installation to another folder without breaking anything.