一:一定时间后运行函数math.floor 去小数点(五不进位)
This.time+=dt
Math.floor((this.time*10)+1)==Math.floor((this.time+dt)*10)//每0.1秒运行一次
//dt updata函数每次运行间隔的参数
二:刚体碰撞监听:onBeginContact(contact,self,other)
刚体移动:this.node.linearVelocity(x,y);
三:动画播放状态:this.node.animation.currentClip.name=“”//当前播放
等于this.node.animation.getAnimationState(“name”).isplaying=true;
本文介绍了游戏开发中关键的技术要点,包括使用math.floor函数进行定时操作,刚体碰撞监听及移动控制,以及如何管理和控制动画播放状态。这些技巧对于提升游戏体验和性能优化至关重要。
974

被折叠的 条评论
为什么被折叠?



