| 
 
| 赞 | 6 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 25 |  
| 经验 | 0 |  
| 最后登录 | 2025-5-23 |  
| 在线时间 | 174 小时 |  
 Lv3.寻梦者 
	梦石0 星屑2466 在线时间174 小时注册时间2021-5-4帖子69 | 
| 
在学习一段时间的js 后开始尝试写
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  不过仍然还是不行,以下是一段关于传送的代码
 能不能在传送过程中 是玩家等待,不知有那位大神相告 谢谢了
 
 
 //传送功能代码
 
 function gamePlayer_Transfer(){
 //队伍旋转朝向
 //建立旋转方向的数组 分别对应 2-下 4-左 8-上 6右
 let arr1=[2,4,8,6,2]
 $gamePlayer.gatherFollowers(); //集合队伍
 let i=0
 //      旋转方向
 function Direction(){
 $gamePlayer.setDirection(arr1[i])
 i++
 //              console.log(i)
 }
 
 //进行判断
 
 if(i<arr1.length){
 //每200ms 执行一次
 var clickTime= setInterval(Direction,200)
 }else{
 //清除setInterval
 clearInterval(clickTime)
 i=0
 }
 
 //1200之后执行一次
 setTimeout(function(){
 //显示动画91
 $gamePlayer._animationId = 91
 
 },1200)
 
 //2200之后执行一次
 setTimeout(function(){
 //玩家向后跳 20
 $gamePlayer.jump(0,-20)
 
 },2200)
 
 //  传送功能 2400 后执行一次
 setTimeout(function(){
 //传送(地图id,x,y)
 $gamePlayer.reserveTransfer(71,5,5);
 
 },2400)
 
 setTimeout(function(){
 $gamePlayer._animationId = 91
 
 },2500)
 
 }
 | 
 |