游戏编程--雪花效果
来源:互联网 发布:数控编程视频教学 编辑:程序博客网 时间:2024/04/29 04:54
void CMainPage::processParticle() { VFLOAT rad = 0; srand( (unsigned)time( NULL ) ); //初始化随机数 for(VINT32 i = 0; i < 1; ++i) { //1 is the snow num VFLOAT k = rand() % PI; //rand a radius that the snow move, what follows next the function "cos" VINT32 iSpeed = rand()%2 + 1; VFLOAT fX = m_pParticle[i]->getX().toFloat() - cos(k); m_pParticle[i]->setX(fX); VFLOAT fY = m_pParticle[i]->getY().toFloat() + iSpeed; //iSpeed is the rand speed m_pParticle[i]->setY(fY); if (fY >= 480) { m_pParticle[i]->setY(-5); } if ((fX >= 242) /*|| (fY <= 0)*/) { fX = -10 + rand()%450; m_pParticle[i]->setX(fX); m_pParticle[i]->setY(-5); } }}
0 0
- 游戏编程--雪花效果
- 简单实现手机游戏雪花场景效果
- 雪花效果
- AS3雪花飘落效果
- 雪花飘落效果
- IOS 雪花飘落效果
- ActionScript 实现雪花效果
- 雪花飘落效果
- 雪花效果前台
- Android 雪花飘落效果
- ios 雪花下坠效果
- 雪花效果实现
- 实现雪花飞舞效果
- 漫天雪花效果
- 雪花飘飘效果
- Android雪花下落效果
- canvas实现雪花效果
- 雪花飘落效果
- MySQL将查询结果插入到数据表中
- A schema cannot contains two global components with the same name
- jsp out
- Wince上如何获取系统时间的函数
- hdu 3836 Equivalent Sets【强联通】
- 游戏编程--雪花效果
- JAVA客户端调用memcached
- 为iPhone 6设计自适应布局
- Cocos2d-X中使用CCHttpClient实现网络通信
- LeetCode Add Two Numbers
- java重载-方法重载中的准确性原则
- perl 代码《2》
- ACM--steps--2.2.7--数字的根
- Struts2之通配符映射(降低配置量)