Cocos creator (JavaScript) - a simple little game to achieve the connection

effect

Here Insert Picture Description

Realization of ideas

 * 游戏结束标志:所有灯被点亮,即所有灯均连接到电源.
 * 3种思路
 * 
 * 第一种: 从电源出发依次查找电线通过的路,直到发现灯为止.
 * 第二种: 从灯出发依次查找电线通过的路,直到发现电源为止.
 * 第三种: 从点击位置电线出发,分别查找灯与电源,直到电源与灯都被找到.
 * 
 * 因为要实现与电源连通的线变为绿色,故
 * 下文使用第1种方法实现:

Examples of the use of Cocos Creator 1.9.3 complete drawing since the drawing is used cc.Graphics, cc.Graphics large changes in the release, running Please 1.x..
Details direct more detailed look at the code Note: Code cloud connection

Released eight original articles · won praise 5 · Views 548

Guess you like

Origin blog.csdn.net/qq_14965517/article/details/104822586