There are many Cocos2D + Storyboard tutorials, it’s about time to do another one that’s done right. Also, this one’s backwards: we’ll start with a Cocos2D template and then add Storyboards to it. The tutorial will work for existing Cocos2D projects to which you wish to add Storyboards, too!
I’ll show you how to add Storyboards to a Cocos2D v2.1 project, with ARC enabled of course. This approach will take a little more work, but the solution will be complete and you gain a fair understanding of how things work together. Plus two custom but reusable View and Navigation controller classes, and I’ll show you what changes you need to make to the AppDelegate.
The resulting project will work with iOS 5 and iOS 6 and autorotation. The navigation and cocos view controllers are separated, and you will be able to subclass them for code customizations as is customary in Cocoa. Cool? Cool, cool, cool!
As usual you can grab the example project (Cocos2D + Box2D + Storyboards with ARC enabled) from github. I’ll also be adding a Storyboards template project to KoboldTouch in the next update, and document what’s special about the KoboldTouch solution.
Oh, only one thing … this tutorial is part of Essential Cocos2D. Head on over and enjoy!
The Cocos2D Installer has been superseded by Kobold2D!
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.
Original Post
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.
Download the Cocos2D Installer (66 MB)
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.
As promised a while ago my Xcode 4 Template Documentation efforts have finally produced a result. Please refer to the product page for more information.
I’ve put in roughly 70 hours. Might have been even more, I didn’t keep track. I would appreciate your support by purchasing the documentation!
I also checked again if any new source of information on Xcode 4 Templates has come up, but couldn’t find any new sources. As of today and roughly 4 weeks after I started with my Xcode 4 documentation endeavour, there’s still very little documentation about Xcode 4 templates on the net. The following are the only external sources I referred to:
- Minimal Project Template with example
- List of replacement placeholder strings
- Solution on how to place files in subgroups
The marketing dude in my mind tells me I should probably mention that the information you get from the above links is just a fraction of what you’ll find in my Xcode 4 Template documentation. 😉
Happy Easter!
Or to be politically correct: Happy Holidays!
What you’ll get in bulletpoints:
- Five tutorials on how to create File and Project templates
- Extensive reference for all known TemplateInfo.plist items (keys) and settings
- Explanation of the placeholders (eg ___FILENAME___) and variables (eg ___*___)
- Frequently Asked Questions answered
- Many tips and tricks
- Total of 70 pages of documentation (PDF) from 70+ hours of experimentation
- File and Project Template example files
Synopsis
This unofficial but comprehensive Xcode 4 Template documentation explains how to create File and Project Templates for Xcode 4. Xcode 4 uses a template format significantly different from the one used in Xcode 3, which renders all previous information on Template creation useless. The new format is also much more complex and allows for greater flexibility, for example a template can now consist of multiple inherited templates.
This Xcode 4 Template documentation first gives you a quick overview what File and Project templates are. Step-by-step tutorials show you how to create your own File and Project Templates. In the reference section the format of the TemplateInfo.plist and related files are meticulously documented. Finally there’s the Frequently Asked Questions (FAQ) section with answers to common questions. The documentation is fully hyperlinked so that you can quickly look up keywords in the reference section. Several example files for File and Project Templates help you get started and can be used as the basis for your own templates.
Available for free
The documentation is now available for free:
Download Xcode 4 Template Documentation (ZIP, 6 MB)
Disclaimers
This is not official documentation. I can not guarantee that the documentation is 100% correct, much of the information was found out through lots of trial and error. Nevertheless this documentation contains a lot more information than what is currently available on the Internet.
THE DOCUMENTATION IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DOCUMENTATION OR THE USE OR OTHER DEALINGS IN THE DOCUMENTATION.
Line-Drawing Game Starterkit
Site License! Unlimited Apps!Royalty Free! No Attribution!60 day money-back guarantee!Made with the popular cocos2d-iphone game engine.Compatible with cocos2d-iphone v1.1 and v2.0, Xcode 4.6 and iOS 6.Includes ARC enabled versions of the starterkit! |
All Starterkit project artwork provided by Arezou Ipakchi Design. Promotional images created by Justin from CartoonSmart.
What it is:
Get a head-start for your Line-Drawing game and save days if not weeks of your time! You’ll get gameplay code modelled after the extremely popular Flight Control game. You’ll learn how to draw lines, detect touches on objects, have objects follow a path - and much, much more! Written by a professional game developer and game industry veteran (me) the source code is annotated with lots of comments explaining my rationale and written with readability in mind.
Contains separate iPhone & iPad targets!
The Starterkit includes targets for iPhone and iPad using the same code if you don’t want to create a Universal app, for example to reduce your app’s size or to be able to charge more for the iPad version. If the iPad Target is selected hi-res iPad images will be used. Image selection is done automatically by loading those images whose filenames have the “-ipad” suffix, the same suffix cocos2d uses.
What others are saying:
“Code is quite clearly written and decently documented […] definitely a fine investment.”
From: Commercial cocos2d Code review from Alex Curylo.
“It was an awesome moment when I found the source for a line draw game of this caliber.”
-Franklin Lyons, SpinFall
“Especially the path and movement system is saving me lots of headaches.”
-Martin Hoffmann
Games made with this Starterkit:
Launch Control
![]() |
![]() |
![]() |
Ferries HD
Feature List:
- cleanly seperated and well-structured GameScene code design with a minimum of dependencies
- easy to add new objects and extend object parameters
- touch object & draw a path for it (whether it’s already following a path or not)
- path drawing ends when path is drawn over appropriate target location (eg airstrip for airplanes, respecting angle of approach)
- path drawing ends when arbitrary point limit is exceeded (to avoid slowdowns)
- path is drawn when dragged with thick transparent line style like Harbor Master, without glitches
- path is split into equal length pieces no matter how quickly user moves finger
- objects spawn outside screen, locations can be re-defined and extended
- objects display incoming warning marker at screen border
- objects display collision warning when any two of them are getting too close
- objects follow path to end - then fade out and increase score or continue moving
- objects always rotate in movement direction
- objects bounce back at screen borders
- motivational Labels for successful landings, precached
- Score and HighScore Labels
- HighScore saved to disk between play sessions
- supports both Landscape orientations with autorotation
- loads correct resource files depending on Target (iPhone or iPad)
- proper Pause handling for incoming calls, SMS
- many generally useful Math Helper functions included
- lots of comments explaining rationale and giving tips for improvement
- assertive coding style to help catch coding errors early on
- offline and online documentation
- you can choose between using cocos2d-iphone v1.1 and v2.0
- you can choose between using ARC or classic manual reference counting
- compatible with iOS 5.0 and newer, including iOS 6
- compatible with Xcode 4.6 (the most recent versions also work)
- easy setup: just unzip, open Xcode project, select build scheme, build and run
Questions? Need Help?
Just send me an email.
Legal Disclaimer
Cocos2D is a registered trademark of Ricardo Quesada. Steffen Itterheim, the Learn & Master Cocos2D website and the Line-Drawing Game Starterkit are neither affiliated with nor endorsed by Zynga or Ricardo Quesada.
Try Before Buy!
Buy Now!Site License! Unlimited Apps!Royalty Free! No Attribution!60 day money-back guarantee!Made with the popular cocos2d-iphone game engine.Compatible with cocos2d-iphone v1.1 and v2.0, Xcode 4.6 and iOS 6.Includes ARC enabled versions of the starterkit! |
License Agreement
Copyright
Purchase grants you the License to use and modify the source code and assets under the following Terms and Conditions:
You are not allowed to make the source code publicly available. You are not allowed to give or sell the source code to others, modified or not. Licenses are not transferable.
All Licenses are royalty free. You can make as many free or commercial Apps using the source code as you want. You may re-use any existing assets in your App.
If you do contract work and have or want to give the Starterkit source code to your client, your client needs to purchase a Site License as well.
Site License
Each purchase grants you a Site License. The Site license grants you the use of the Starterkit without restrictions at one site.
A site is an office, building or living space rented or owned by the company or individual making the purchase. It allows anyone working on site to use and modify the Starterkit source code.
Large companies operating at several sites need to purchase a site license for each individual location if the Starterkit is to be used at multiple locations. Contact me if you’re such a corporation and you prefer a flat fee license with your own license text to go along with it.
Support
Updates to the Starterkit are done on an as needed basis. I will also keep it up to date and running with the latest stable releases of cocos2d. Updates are distributed via a download link sent to the email address you used for your order. If your email address ever changes please contact me, ideally you should forward me your order confirmation in that case to speed up the change.
Source Code not covered by this License
The licensed Source Code project contains files which are available for free and are governed by different licenses. The Terms & Conditions outlined here do not apply to source code files which do not contain the Copyright notice “Copyright (year) Steffen Itterheim. All rights reserved.”.
Disclaimer
THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Questions? Contact me!
If you have any questions or if you require specific License texts before making a purchase, please contact me.