I cannot build HelloWorld with 0.9.2 (though on 0.9.1 all works fine, except usage of obsolete names HelloWorld.mkb).
First HelloWorld.mkb needs to be updated to fit recent sources structure, to take files:
AppDelegate.h
AppDelegate.cpp
HelloWorldScene.h
HelloWorldScene.cpp
from …/Classes rather than …/.
Next error, my vc2008 outputs following error when thrying to build HelloWorld solution:
Error 4 error C2039: ‘setDelegate’ : is not a member of ‘cocos2d::CCAccelerometer’ d:2dx\cocos2d-1.0.1-x-0.9.2\cocos2dx\layers_scenes_transitions_nodes\cclayer.cpp 151 HelloWorld_vc9
Hey! I just came across the same thing when I tried to upgrade to 0.9.2….
It looks like “setDelegate” has been replaced with calls to “addDelegate” and “removeDelegate”…. So whenever in the code it seems like you’re adding a delegate, call “addDelegate” instead, and vice versa.
I’m not 100% sure if all my changes were correct…. but it works with the AirPlay simulator using the accelerometer…. and I’ve tested it for about 5 minutes without any faults….
The one thing that didn’t follow the above changes was in this file, where I just replaced the methods with what you see below.
Whoops! That second line is supposed to be “removeDelegate”, not addDelegate… and to be more clear, if it used to be setDelegate(NULL), then do removeDelegate(this) most of the time…. And once again, not sure if this is how it’s supposed to be done, but it works
Thanks for feedback Brad. However I’ve decided currently to stay at 0.9.1 since 0.9.2 seems to be buggy at the moment (even though it’s called stable:)).
I was still getting errors for the Airplay (Marmalade) platform with the above changes with the cocos2d-x 0.9.2 with the accelerometer refactoring for all the platforms except Marmalade.
I made the changes to the platform specific files following the Anrdoid implementation.
The code attached worked with the Tweejump game in the Marmalade simulator so I’m assuming it will work on the device.