Monday, October 31, 2011

What's the benefit of having 2 names for the same variable?

I was following this tutorial called Cocos2d Sprite Tutorial, and noticed as below, the variables were first declared in the header file with an extra "_" underscore character at the front.    CCSprite *_dragon;    CCAction *_flyAction;    CCAction *_moveAction;But then at the @property declaration, the underscore character was removed.@property (nonatomic, retain) CCSprite *dragon;@property (nonatomic, retain) CCAction *flyAction;@property (nonatomic, retain) CCAction *moveAction;And then in the main ".m" file, both names were used as below with the "="...

Friday, October 28, 2011

Error "Sending 'ccColor4B' (aka 'struct_ccColor4B') to parameter of incompatible type 'CIColor *'"

While trying to compile some old Cocos2D projects, as attached, keep getting this error "Sending 'ccColor4B' (aka 'struct_ccColor4B') to parameter of incompatible type 'CIColor *'" in my Xcode 4.2As below, the Cocos2D is version 0.99.01 according to "cocos2d.h". Looks like have to upgrade the Cocos2D in the project...[UPDATE 16/01/2012]I found the fix!Instead of:+ (id) layerWithColor:(ccColor4B)color{ return [[[self alloc] initWithColor:color] autorelease];}The fix is to change it to as below, with...

Wednesday, October 26, 2011

Error "Illegal Configuration - Pattern colors on iOS versions prior to 3.0"

While looking at some old projects developed with Cocos2D from the net, found that the new Xcode 4.2 throws the following error: "Illegal Configuration - Pattern colors on iOS versions prior to 3.0" and refused to compile.Checked the net and found this page from Mark Tomlinson's site which says "The error is due to incompatibilities with older nib/xib files prior to version 3.0". It also mentioned about the fix is to "change the **Deployment** type in the *Interface Builder Document* settings",...

Monday, October 24, 2011

Problem after upgraded iPad 2 to iOS 5 [fixed]

I have an iPad 2 with wifi only, and I always connect to my iPhone 3GS (iOS 4.3.5) through Bluetooth and then using the "personal hotspot" on iPhone, I can share the Internet connection and do lots of stuffs on the net with the much bigger screen.However, after I upgraded my iPad 2 to iOS 5 yesterday, the Bluetooth connection still works, but it can't get any Internet connection any more!This is really annoying. I guess can also upgrade my iPhone to iOS 5 to see if that would fix the problem, but there's first of all the risk that it still won't work, plus I will then loose a device for testing...

Saturday, October 22, 2011

Top "In App Purchases" shown in App Store

You might already know this, while studying the 101-in-1 Games, I noticed theApp Store shows the top "In App Purchases" ranking too. It sort of provides you a rough idea about:(a) whether the game provides In App Purchase(b) what sort of In App Purchase options the creator provides(c) which product/price range is the most popular one Also have a quick look at another one of my favourite game Tiny Tower and it also shows similar ranking as well, but only 3 been displayed instead of 5.This also proves...

Where to get hundreds of game ideas for free

When you started learning to write games, one of the main problem will be about finding an idea for you new game project.I found this new game 101-in-1 Games which is quite interesting.When I first saw the game, to be honest I was a bit depressed - as if someone already provided a free application that includes 101 games, how much space will be left for us? After tried the game for a while however, I felt a lot better. As each of the included games is only in a very simple form - which means each...

Monday, October 17, 2011

Inspecting Apps (.ipa) files under Microsoft Windows

A friend told me that although the code for iPhone Apps are protected by encryption, other stuffs like music, images, ..etc can still easily accessed from any Microsoft Windows machine. I didn't quite believe it until I check it on a XP machine after synchronised with my iPhone. No I didn't jailbreak or change anything on the phone - all I have to do is look at the "My Documents\My Music\iTunes\iTunes Media\Mobile Applications" folder and open each of the ".ipa" files using WinZIP or WinRAR. Tried...

Thursday, October 13, 2011

Can iOS5 Face Detection API detect this?

Seen quite a few blogs/news articles taking about the new iOS5 Face Detection API "CIFaceFeature" which has properties like "hasLeftEyePosition", "hasRightEyePosition", "hasMouthPosition", ...etc. Would be interested to see how it really works.Also, just wondering, what would be the result if we run it against Johnny Deep's famous "multiple-eyes" image? :-)[UPDATE 2011-11-08] Yes it works! See this post about the result when I use this photo to run the face detection example... Quite co...

Instrument 4.1 (Build 4138) still hung in OS X 10.7.2 Lion - issue fixed in 4.2 (Build 4233)

Software update prompted me to upgrade today, so I upgraded my MacBook Pro to 10.7.2 straight away.Although the new iCloud function looks interesting, the first thing I tried is actually the annoying Instrument 4.1 hung issue. Unfortunately still the same...Wait, isn't iOS5 out now, what about Xcode update? I must have missed something.... Have a quick look at AppStore, and yes! Xcode 4.2 is available!Can't tell you the result yet as I have to download the 1.8GB file first... Will let you know how...

Wednesday, October 12, 2011

4th Open Source Game - Follow Me If You Can

After a few weeks hard work, I am please to announce my 4th Open Source game - "Follow Me If You Can" - released in MIT license.It's a very simple memory game: the computer moves some tiles around and you have to remember all the moves. As when it's your turn you have to repeat it. You get points for every correct move, extra bonus and life if all correct. You loose life for every incorrect move - but the correct move will be shown as hint.Some screen dumps as below:Features:1. My first project...

Sunday, October 9, 2011

Expect to finish 4th Open Source Game this week

My 4th open source game almost ready. This time I added music, first attempt on KVO, start up/ending menu, a simple scrollable "how to play" view, top scores, ...etc. So far, the most complicated open source game I ever created...Expect to release it before end of this week...

Saturday, October 1, 2011

Started learning Cocos2D

Just started learning Cocos2D with the Learning Cocos2D book.Currently halfway through chapter 1 and already found a few issues: (1) "HelloWorldScene.m" should be "HelloWorldLayer.m"(2) The new code to add the space cargo ship image should be "under" the existing Hello World label code inside "init()" so that the previously declared variable "size" won't cause compiler error.The forum for the book is also not as organised as the others I have seen - which organised the questions into different chapters to make it easier for readers to find what they want instead of using search.Any way, so far...

Page 1 of 66712345Next