角色的移动和转身
来源:互联网 发布:mysql递归 编辑:程序博客网 时间:2024/06/06 00:40
properties: {
bg: cc.Node,
anim: cc.Animation,
player : cc.Node,
},
// use this for initialization
onLoad: function () {
var num = 200
var that = this
this.bg.on(cc.Node.EventType.TOUCH_START,function(event){
var pos = that.player.parent.convertToNodeSpaceAR(event.getLocation())
var playerPos =that.player.getPosition()
cc.log( pos,that.player.getPosition())
if (playerPos.x<pos.x){
that.player.getChildByName("anim").scaleX = -1
}
else {
that.player.getChildByName("anim").scaleX = 1
}
var time = cc.pDistance(pos,playerPos)/num
var moveto = cc.moveTo(time,pos)
that.player.stopAllActions()
that.player.runAction(moveto)
that.anim.play('plyerRun')
clearTimeout(that.timeOut)
that.timeOut = setTimeout(function () {
that.anim.play('plyerAnima')
},time*1000)
})
// for (var i = 0;i<=113)
},
- 角色的移动和转身
- 技术人员的艰难转身——管理角色的认知和转变
- Unity3d 角色转身在向前走的脚本
- 角色移动的处理
- Unity3D 第三人称的游戏角色的单选和移动
- unity 通过键盘控制角色的移动和旋转
- android游戏开发框架libgdx的使用(十三)—TiledMap中的角色和角色移动
- android游戏开发框架libgdx的使用(十三)—TiledMap中的角色和角色移动
- android游戏开发框架libgdx的使用(十三)—TiledMap中的角色和角色移动
- 使用照相机和角色进行移动
- Unity3D AI角色移动和自动跟随
- 转载他人:角色移动和相机跟随
- 控制角色转身之后进行运动以及使角色转弯
- //实现思路:鼠标点击,产生目标点,计算角色和目标点的夹角,旋转角色朝向目标点,然后移动角色。
- 对角色的移动的整理
- unity中简单的角色移动控制
- rigidbody.velocity 控制角色的移动
- 简单的角色响应鼠标而移动
- Uiautomator框架(The UI Automator testing framework)简单介绍
- javascript的settimeout
- Android Databinding 从入门到转行(二)添加点击事件
- 2sum,3sum and 和为s的连续正数序列
- 读取android真机里面的文件的方法
- 角色的移动和转身
- 加油!加油!加油!我相信你一定行!
- 源码分析-java-AbstractSequentialList
- Ubuntu 16.04 编译安装 SkyEye 1.3.5
- C++Builder编译链接错误LME288的解决
- OpenCV初级教程
- fopen函数使用
- 多网卡情况下如何正确获得IP
- 1017. A除以B (20)--做题纪录