The book, Cocos2d for iPhone 0.99 Beginner's Guide by Pablo Ruiz, is an introduction to game development using the cocos2d for iPhone framework (http://www.cocos2d-iphone.org/). cocos2d for iPhone is an open source game development framework for Objective-C based on the cocos2d framework originally written in Python. As the 2d in the title suggests, it is really geared towards 2D games, although there can be 3D effects. The framework is free to use even in commercial products and is actively maintained with a large community. The framework has even branched out towards iPad and Mac OS X development.
I've been reading Cocos2d for iPhone 0.99 Beginner's Guide by Pablo Ruiz in preparation for an upcoming game I am writing. I'll post a review soon.
It's been a while since I did a post, but I've spent some time recently exploring different aspects of Core Animation for an upcoming app. One effect I wanted to achieve was a flip effect similar to the
UIView. The problem with these animated transitions is that they only work when swapping out a whole view for another. These transitions don't work on sub-views. So after much googling, there didn't seem to be an example of exacting what I needed so I put one together myself. I've posted a video on YouTube showing the effect I am after (sorry for the video quality!).
Well as it turns out people love free stuff! I was quite surprised by the demand! I'm sure OpenFeint's marketing helped drive up the demand in addition to the free cost.
So for the 28 hours (approximately) that Kascade was given away, the final numbers are:
- Total downloaded: 36,142
- Peaked at #91 for all the Free Apps (US)
- Peaked at #52 on the Free Games category
- Peaked at #8 on the Free Games - Puzzle category
- Peaked at #8 on the Free Games - Family category
After Kascade returned to the normal $0.99 price, there was a definite uptick in sales. Still early to tell if the sales will continue to stay at a higher level or will eventually return to the pre-sale levels.
Overall, I am quite pleased with participating in their giveaway.
After hours of fiddling (and cursing) with the UITextView scrolling behavior, I finally got the behavior I wanted. If you ever need to programmatically insert text into a UITextView and move the cursor to right after the insertion point, the following code snippet should work. Make sure you do the bolded items otherwise the UITextView won't scroll properly.
Just started development of a new iPhone game and decided to use cocos2d for the game engine (versus the one built for Kascade). Since there are upcoming API changes, I started with the latest 0.9 alpha/beta (latest tips from subversion) since it will likely be released before the game will be completed.
This entry is part 1 of a series that provides a starting point for anyone using cocos2d. This post kicks things off with useful links and setting up your project.
Well Kascade 1.1 finally hit the App Store today! It now integrates with OpenFeint, but just their Achievements and not their online Scoreboard (as they only have a single scoreboard and the current Kascade scoreboard breaks it down by all-time and the last 7 days). The OpenFeint Achievement system is pretty nice and adds an extra incentive to keep playing.
The integration was painless. After registering on their site, I followed the post on how to integrate OpenFeint in 19 minutes. For the Achievements, you use the OpenFeint website to create one or more achievements to unlock (Kascade currently has 60). Originally, you had to enter your achievements in the order that you wanted them to appear, but they've pushed out an update that now allows reordering - that really helps! I used a spreadsheet to list all the names and point values for all 60 achievements so it would be easier to change and balance rather than flipping through different webpages. Then I entered them in one by one.
In XCode 3.0 (not sure when they added it), there are options to add Unit Tests to your iPhone application but I was not able to get this to work properly using the iPhone Unit Test target. However I did find a reference to add Cocoa Unit Tests to your iPhone project. If you follow the link, you will find all the information you need. It's quick to add to your project and will allow your tests to run every time you build.
If your application requires generation of secure hashes, you can use the raw Crypto APIs. These are actually C calls and do not have nice Objective C objects to interface with. The code snippet below shows how this is done for SHA-1. The input is any NSString and the output is a hex-encoded NSString version of the hashcode. If you need other types of hashing besides SHA-1, then you will need to change the SHA1 names in the functions and constants.
Creating a Lite or Free version (don't call it a 'Demo' on the App Store) of your application is pretty easy to do assuming there your application can support reduced functionality. One way you could do this is just copy your whole project and start modifying your code to make it Lite. The biggest drawback to this is the dual maintenance of code if you have to fix a bug in both the full and Lite versions. The alternative is to create a new target in the same XCode project with different settings. This is the approach I took with Flik.
Fortunately for me, a Lite version of Flik translates into providing just a few levels instead of the full set of levels and so I could focus on those changes.The steps below outline what was done.