<span style="background-color: rgb(0,153);"> </span>
<span style="background-color: rgb(204,204,204);">#include "<span style="font-family:Arial Black;">cocos2d</span>.h"</span>
<span style="background-color: rgb(204,204);">USING_NS_CC;//名称控件不可少</span>
<span style="background-color: rgb(204,204);">int MyRandom(int min,int max) { struct tm*tm; time_t timP; if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) { time(&timP); } else { struct timeval tv; gettimeofday(&tv,NULL);</span>
<span style="background-color: rgb(204,204);"> timP = tv.tv_sec; } tm = localtime(&timP); int Sencond = tm->tm_sec; return (((int)(CCRANDOM_0_1() * 1000) + Sencond) % (max-min) + min); }</span>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。