Commit 03a45a60 authored by Tt's avatar Tt

Merge branch 'master' of http://120.27.1.210:43210/huiwan/op_input into master

parents 2d37d334 f1a71cf3
......@@ -24,6 +24,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
}
onLoadEnd() {
cc.macro.ENABLE_MULTI_TOUCH = false;
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
......@@ -223,6 +224,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
}
}
onItemTouchStart(e) {
if (this.checkRoundOver()) return;
let target: cc.Node = e.target;
let data = target.data;
//已经成功的方块要拒绝掉
......@@ -232,12 +234,14 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
this.setTouchPos(e);
}
onItemTouchMove(e) {
if (this.checkRoundOver()) return;
let target: cc.Node = e.target;
let data = target.data;
//已经成功的方块要拒绝掉
this.setTouchPos(e);
}
onItemTouchEnd(e) {
if (this.checkRoundOver()) return;
let target: cc.Node = e.target;
let data = target.data;
let itemBg = this.wordItams.find((bg) => {
......@@ -259,7 +263,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
itemBg.errorCount++;
if (itemBg.errorCount >= 3) {
this.errorThere(target, itemBg);
this.playLocalAudio("right");
this.playLocalAudio("right", 0.6);
this.roundOver();
} else {
this.playLocalAudio("error");
......@@ -276,7 +280,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
let line = cc.find("line", item);
word.active = true;
line.active = false;
this.playLocalAudio("right");
this.playLocalAudio("right", 0.6);
this.roundOver();
}
private moveError(target, data) {
......@@ -360,22 +364,15 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
let mao_ske = cc.find("mao_ske", this.node);
let ske = mao_ske.getComponent(dragonBones.ArmatureDisplay).playAnimation(aniName, 0);
}
playLocalAudio(audioName) {
playLocalAudio(audioName, volume = 1) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
cc.audioEngine.setEffectsVolume(volume);
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
cc.audioEngine.setEffectsVolume(1);
resolve(id);
});
})
}
}
/**
* 新游的调整
1. 不是播一个单词 换一轮 是播完所有单词 开始换第二轮
2. 最后弹出完整单词的时候 字母间不要有间距
3. 第二轮不需要题目音频
4. 第二轮 问号是可以点击的 发单词音
5. 播放完成音效的同时 弹出goodjob goodjob不消失
6. 音频加一个第二轮引导音频 在开始第二轮的时候 小猫自动播放第二轮引导音频
*/
\ No newline at end of file
}
\ No newline at end of file
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