Coscreator
weixin_43842987
这个作者很懒,什么都没留下…
展开
-
Uncaught TypeError: Cannot read property ‘0‘ of undefined
Uncaught TypeError: Cannot read property ‘0’ of undefined 该错误在第一次用cocos写flappybird项目时发生,是由于数组声明和引用时名称没写对导致原创 2020-07-08 14:07:48 · 714 阅读 · 0 评论 -
2D游戏主角移动速度限制(带方向)
2D游戏主角移动速度限制(带方向) 要限制最大移动速度的时候,最使用的就是 if ( this.xSpeed > this.maxMoveSpeed ) { this.xSpeed = this.maxMoveSpeed } 但是如果是带有方向的速度就要使用如下方法 if ( Math.abs(this.xSpeed) > this.maxMoveSpeed ) { // if speed reach limit, use ma原创 2020-07-06 18:19:14 · 218 阅读 · 0 评论