The Cocos2d-x Programmers Guide

The Programmer Guide, originally, was geared towards that and we realized that it didn’t make sense. People’s interest in games is different and we felt that readers would stop reading if the sample game was of no interest.

Currently the Programmer Guide is getting put up chapter by chapter, I have more chapters to get up already. It contains source code for each chapter demonstrating the concepts in that chapter.

i hope the ‘bridging’ method between iOS and Cocos2d-x gets finished soon wohooo :smiley:

what does that mean?

i meant to say, i wish there’s a working example for in-app purchase with regard to ‘buying coins’ , ‘buying levels’ , ‘removing ads forever’. those stuff. i’ve spent two weeks on a wild goose chase on how to implement in-apps(iOS) in Cocos2dX and I have yet to find it. and please dont suggest soomla

2 Likes

same here… i also try soomla, but no luck… i’m looking for a wrapper for object-c and an object-c class for inapt or a good example code… i found few but all of them are deprecated or not complete or disaster to implement… i really want an inapp example too!!!

love the engine by the way :slight_smile:

2 Likes

i have managed to call objective c functions using c++, it’s not that complicated. Things get awry and tawdry when I try to implement the “real in-app” functions. If only someone could make use of Ray Wenderlich’s tutorial(cocos2d) and convert it to Cocos2dX.

i think i just made one… after 3 weeks of deep digging and constant coding. i’m testing it right now so i’ll let you know if something is happened.

But, please everyone, realize that this is the “Programmer Guide for Cocos2d-x” Its not a “tutorial on how to integrate products out of our control into Cocos2d-x guide.”

sorry about that… i didn’t get any answeres on in the topic… i finished it! :slight_smile: sorry again…

1 Like

Try The Plugin-x, it’s very good to doing that.

Hey @steknika did you finally make it work?? Hope you can share it^_^ I am having a tidbit of a problem here. I can give you my erroneous source code so you can take a look or you can just share your working method ( github or dropbox) :smiley:

What was the problem?

You can use plugin-x or AnySDK: http://en.anysdk.com/

If you want an easy way for code communication/calling C++<->JNI and C++<->Obj-C, you can use EasyNDK: https://github.com/alfonsocejudo/EasyNDK-for-cocos2dx3

Please move this conversation to another topic.

I looked into AnySDK. It seems like it may require you to compile your code with their tool. Maybe even upload it to their site. Is that correct? That’s not something I want to do.

@slackmoehrle
Chapter 8 , tutorial on touch events has a problem on v3.2

i copy pasted ur code and it gave that error. how do i fix this ?

Sounds good :slight_smile:

As requested by @slackmoehrle, I moved the topic to here: Moved topic EasyNDK

1 Like

It’s cause the code does not return a boolean. Just type return true; in the function body.
The full signature is std::function<bool(Touch*, Event*)> onTouchBegan; and the full function header would be: listener1->onTouchBegan = [](Touch* touch, Event* event) -> bool { ... };

The code in the example is just the short version and the compiler will try to figure it out. It’s similar to the auto type, but as long as you don’t return a boolean, it will not match the signature.

1 Like

Chapter 8 sample code is underway. I’ll fix this too. Thanks for the reply @IQD

also keep in mind that the guide is here: http://cocos2d-x.org/programmersguide

Also, Still in Preview, WIP, etc. I’m preparing to add new content today too.