Quantcast
Channel: Cocos中文社区 - 最新帖子
Viewing all articles
Browse latest Browse all 494966

在Git上找到了一个连连看游戏,但感觉算法有问题?

$
0
0

isOnedir:function(x1,x2,y1,y2,t_arrary){

    var self=this;

 if(self.imageList[y1*self.line + x2].getComponent('pic').isempty == true && self.isLine(x1,x2,y1,y1,t_arrary)&& self.isLine(x2,x2,y1,y2,t_arrary)){
    return true; 
 }
  if(self.imageList[y2*self.line + x1].getComponent('pic').isempty == true && self.isLine(x1,x1,y1,y2,t_arrary)&& self.isLine(x1,x2,y2,y2,t_arrary)){
    return true; 
 }
    return false;
},

修改后的代码,感觉还是有点问题


Viewing all articles
Browse latest Browse all 494966

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>