level 1
Love丶阿毛头
楼主
//显示分数
_gameScore 已经在头文件中定义,且在构造函数中初始化为0。
shoScore也在头文件中定义,这下面代码中创建时出错。
if (_gameScore >= 0 && _gameScore <= RAND_MAX){
showScore = CCLabelBMFont::create("Score:","font/arial.ttf"); //到这行就中断,请问了为什么
CCString* temStr = CCString::createWithFormat("%d", _gameScore);
showScore->setString(temStr->m_sString.c_str());
addChild(showScore);
showScore->setPosition(CCPoint(450, 300));
}
2015年07月18日 02点07分
1
_gameScore 已经在头文件中定义,且在构造函数中初始化为0。
shoScore也在头文件中定义,这下面代码中创建时出错。
if (_gameScore >= 0 && _gameScore <= RAND_MAX){
showScore = CCLabelBMFont::create("Score:","font/arial.ttf"); //到这行就中断,请问了为什么
CCString* temStr = CCString::createWithFormat("%d", _gameScore);
showScore->setString(temStr->m_sString.c_str());
addChild(showScore);
showScore->setPosition(CCPoint(450, 300));
}