Migrating to cocos2d-iphone v3 - Tips & Tricks

On March 6, 2014, in idevblogaday, by Steffen Itterheim

This is a collection of Tips & Tricks for users who are migrating to cocos2d-iphone v3 from v2. Mostly refers to questions posted on stackoverflow.com.

Please excuse the short, bullet-pointed format. I’m a little short on time but didn’t want to miss out on another biweekly post like I did two weeks ago (first time in about 4 years, ouch).

General Tips

  • Many classes have been renamed…

“Use the source, Luke!” If you don’t find what you are looking for:
- Check the cocos2d API class reference
- Start typing the class or method name, see what suggestions Xcode autocomplete has for you
- Use part of the class name (ie “repeatforever”) and perform a “Find in Project” to search through all source code files

  • Tutorial XYZ won’t work with v3!

Yes, it won’t. Most likely it was written for cocos2d-iphone v2.
Question is: do you have to use v3? And do you have to use it right now?
Because if you’re in the process of learning cocos2d it’ll be easier to learn from and with v2 tutorials/books for the time being until more v3 tutorials have been published.

  • How to upgrade an existing cocos2d v2 project to v3?

Continue reading »

A premature preview of cocos2d-iphone v3 preview

On November 18, 2013, in cocos2d, by Steffen Itterheim

A preview version of cocos2d-iphone v3 has been available for a couple days now. I thought I’ll take a closer look and summarize what’s been done, what’s working and what isn’t, what’s new and what’s old but revamped.

Installation

Screen Shot 2013-11-18 at 18.06.21The installer script has been revamped. It has a different name (install.sh) and different parameters (-force instead of -f).

The first thing I noticed is that the installer is downloading Chipmunk2D. Made me wonder why, so I double-checked to confirm: Chipmunk isn’t included in the archive. This means no offline installation.

I’ll explain later why Chipmunk isn’t included.

Project & File Templates

Screen Shot 2013-11-18 at 17.34.36

In the preview there’s only one project template. It doesn’t demo any physics features, it’s your typical “Hello World” example with buttons.

There seems to be an issue with the template where any attempt to save it to a custom location caused Xcode to crash. In fact every time the “Save File” sheet came up and I didn’t click on “Create” right away, Xcode would crash. That’s just one of the reasons why it’s still a preview.

The CCNode File Template isn’t worth mentioning at this point, it creates an empty Objective-C class and is barely different from the regular Objective-C class template at this time.

Hello World v3

Continue reading »

Kobold2D Preview 4 now available!

On September 28, 2011, in cocos2d, Kobold2D, by Steffen Itterheim

Without further ado:

Download Kobold2D Preview 4

Enjoy it!

The Most Important Changes & Additions:

Continue reading »

API References…

On January 25, 2011, in , by Steffen Itterheim
Tagged with:  

Starterkit: Line-Drawing

On May 27, 2010, in , by Steffen Itterheim

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!


Sale - only $49 !


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!

Demo App for iPhone
Demo App for iPad

Browse the API Documentation

View a Code Sample


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!


Sale - only $49 !



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.