Commit bd84de1f authored by 谌继荃's avatar 谌继荃

优化 随机打乱拼图数组

parent 6b040c15
...@@ -13,11 +13,12 @@ export const addDragDemo = (stage: FYGE.Stage) => { ...@@ -13,11 +13,12 @@ export const addDragDemo = (stage: FYGE.Stage) => {
let countDownText = new FYGE.TextField(); let countDownText = new FYGE.TextField();
stage.addChild(gameWrapper); stage.addChild(gameWrapper);
// 优化
const onShuffle = () => { const onShuffle = () => {
shuffle(gamedata); shuffle(gamedata);
// 随机到正确答案后应该再随机一次 // 随机到正确答案后应该再随机一次
if (equalTo(INIT_DATA, gamedata)) { if (equalTo(INIT_DATA, gamedata)) {
shuffle(gamedata); onShuffle();
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment