Best example of saving user data using Cocos2dx

0 votes
Is there a good sample of how to save additional user data using the Cocos2dx interface? I want to save their progress (like the levels they have unlocked in a category). The only info I've found so far is this page for doing it with JSON:,app Also, when creating a user using userService->CreateUser() can the userName be their email address? That would simplify dealing with multiple people wanting to have their accounts saved with the same name (like "Nick" in the example code. Thanks!
asked Oct 9, 2016 in Cocos2D-X by Ken (16 points)

1 Answer

+1 vote
Best answer

Hi Ken,

The App42_Cocos2dx_SDK packages comes with sample which has test cases for all the APIs. You can find the same in our github repo. You open this link and search for createUserWithCustomData method which has the exactly your requirement.

In createUser API, user name and email address both are must. However, you can use the email address for the both the fields.

Let me know if you have any further queries.



answered Oct 10, 2016 by rajeev.etc (1,660 points)
selected Oct 10, 2016 by Ken
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on