Saturday, June 28, 2014

Running Gone Bananas on VS 2013

Way back in the days, we're talking years here, I played around with Cocos2D. The native c++/objective-c version that is. I loved it until my project suddenly stopped building and my patiens ran out. That was about the time I picked up MonoTouch instead.

Just the other day I saw the link to this page on the Xamarin web site. http://developer.xamarin.com/guides/cross-platform/cocos2d_xna/cocos2dxna_tutorial/

I figured I give it a try to see if I could get it running.

I ran into a couple of issues on the way.

1. The git-stuff didn't work as expected

Disclaimer: This is probably due to my small experience with git.

In the beginning of the tutorial there is a link to clone the git repository for Cocos2D-XNA. I followed it and got started. The first git command under "Code on GitHub" worked fine. 


Also the sub module initialization and update worked great.

$ git submodule init and $ git submodule update

BUT, the external dependencies update didn't work out that great for me.

$ cd MonoGame
$ git submodule init
$ git submodule update ThirdParty/Libs

I got a "You need to run this command at the toplevel of the working tree" error.

Is this a problem? I don't know? :D If someone reading this knows the answer, please comment to enlighten a poor git fool.

2. Downloaded the bananas project

Yup, did so and unzipped it into my favorite folder. Had to move the project around to get the correct relative path to Cocos2D-xna since it loads some of the Cocos2d-xna projects. Not an issue, but it could be explained somewhere that you need it to be relative to the Cocos2D-xna folders.

3. Cocos2D-xna does not build

In the Cocos2d.ios project there is a class named CCTextFieldTTF. It cannot resolve a namespace reference to Microsoft.Xna.Framework.GamerServices. So what I did was to add the !IOS compiler directive to simply not include it for my iOS configuration. I also have to correct this in like five other places. It does build and run after that.

#if !WINDOWS_PHONE && !XBOX && !PSM && !IOS
    using Microsoft.Xna.Framework.GamerServices;
#endif

After that, all success and I could collect as many bananas as I'd liked.




No comments:

Post a Comment