如何在cocos2d-x(c ++)ios游戏中将值存储为数据库 [英] How to store a value as a database in cocos2d-x (c++) ios game

查看:93
本文介绍了如何在cocos2d-x(c ++)ios游戏中将值存储为数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对cocos2d-x ios游戏开发完全陌生,并且从codeproject中学到了很多东西。只想感谢所有的软件编码器。现在我的问题是我正在制作一款水平和高分的游戏。但仍然无法找到一种方法来存储高分和清除的级别。当游戏重新启动时,所有的值都设置为初始值,因为没有要获取的数据库。我在cocos2d-x中听说过userdefault,但实际上找不到执行方式。任何人都可以帮我提供样品。我将感谢你

解决方案

我没有在我面前,但我认为cocos2d-x中有一个演示如何使用它 - 通过演示源来看你应该找到它。


你可以在你的cocos2d-x项目中找到答案。

路径是

cocos2d-x-2.1.5\samples\Cpp\TestCpp\Classes\UserDefaultTest\UserDefaultTest.h

cocos2d-x-2.1.5\samples\ Cpp\TestCpp\Classes\UserDefaultTest\UserDefaultTest.cpp

I am totally new to cocos2d-x ios game development and really learning a lot from codeproject.Just want to thank all the software coders.Now my question is I am making a game with levels and high score.But still couldn't find a way to store the high score and the levels cleared.When the game restarts all the values are set to initial values as there is no database to fetch.I have heard about userdefault in cocos2d-x but really couldn't find a way to execute. Can anyone help me with a sample. I will be thankful to you

解决方案

I don't have it in front of me, but I think there is a demo in cocos2d-x that shows how to use it - loof through the demo sources & you should find it.


You May Find Answer In Your cocos2d-x Project.
Path is
cocos2d-x-2.1.5\samples\Cpp\TestCpp\Classes\UserDefaultTest\UserDefaultTest.h
cocos2d-x-2.1.5\samples\Cpp\TestCpp\Classes\UserDefaultTest\UserDefaultTest.cpp


这篇关于如何在cocos2d-x(c ++)ios游戏中将值存储为数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆