Commit 882fd0f6 authored by Chen Jiping's avatar Chen Jiping

perf:模板开发测试

parent 1c53bef7
{
"ver": "2.0.1",
"uuid": "5f44c988-3569-413f-b9c3-42e3c60e3506",
"downloadMode": 0,
"duration": 1.575667,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "a7d0dac1-bbd1-4495-8e8d-8d08928a4f75",
"downloadMode": 0,
"duration": 0.556563,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "4c818237-b74e-46d0-9d13-ff5b648ad96f",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "c992521a-0464-46cf-8bfd-7eaedf06827d",
"downloadMode": 0,
"duration": 1.07102,
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,7 +5,7 @@
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import { playAudioByUrl, setSprNodeMaxLen, btnClickAnima } from "./util";
cc.Class({
......@@ -80,7 +80,7 @@ cc.Class({
getDefaultData() {
const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}'
const dataJson = '{"exercisesArr":[{"answers":[{"isRight":"0","audioUrl":"http://staging-teach.cdn.ireadabc.com/66fe3a8fe9cd81ebb0a20b4fb134443f.mp3","picUrl":"http://staging-teach.cdn.ireadabc.com/cb6dfd436c533f44e8e9fdd594458576.png"},{"isRight":"1","audioUrl":"http://staging-teach.cdn.ireadabc.com/5d8c6991fabc4bf37a0055bb37eac8b3.mp3","picUrl":"http://staging-teach.cdn.ireadabc.com/b2b296923e5fd09e77cd29fd3883f78e.png"},{"isRight":"0","picUrl":"http://staging-teach.cdn.ireadabc.com/3fed3a7bacc07dfb84de7196a50d39ab.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/9f9361601b4f2dbd60f037c6996a5af6.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/2f65d31e390318626fce1180bb09b2ea.png"}],"frames":[{"picUrl":"http://staging-teach.cdn.ireadabc.com/25a82fd9d55b026a76d2caaeed754a02.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/25a82fd9d55b026a76d2caaeed754a02.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/3d8d02f661a45283aa4eef1b6faed704.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/8c1833c5a38efea3394ad78a44cd8801.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/3d8d02f661a45283aa4eef1b6faed704.png"}],"hotZoneItemArr":[{"index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/59a3efbfa3df99100e8810cbcddef107.png","itemType":"pic","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.9,"imgScale":0.9447513812154696,"mapScale":0.9,"rect":{"x":762.25,"y":244.51,"width":258.57,"height":258.57}}]},{"answers":[{"isRight":"1","audioUrl":"http://staging-teach.cdn.ireadabc.com/4b763321dd84accbf0060038f2e95d6a.mp3","picUrl":"http://staging-teach.cdn.ireadabc.com/10dab2d49188db958a6a6e6b3ab7b5f5.png"},{"isRight":"0","picUrl":"http://staging-teach.cdn.ireadabc.com/cb6a2f948c3febbb7881e6b6a7417811.png"},{"isRight":"0","picUrl":"http://staging-teach.cdn.ireadabc.com/a886b150e8792d433ced3672f4df7dfb.jpg"}],"frames":[{"picUrl":"http://staging-teach.cdn.ireadabc.com/824c94f5e363c351e24dde9325731ab7.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/95638e0ab356b51f960e800e3fa5aacb.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/3d330a49df81ae964a705048f8ea0e0d.png"},{"picUrl":"http://staging-teach.cdn.ireadabc.com/3023da8f58edfa36a0a9c34e68902ef7.png"}],"hotZoneItemArr":[{"index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/00254362880b14c443e533331db4e2bf.png","audio_url":"http://staging-teach.cdn.ireadabc.com/284f8356d7537612833d1d9bf5d76aa8.mp3","itemType":"pic","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":0.9,"imgScale":0.4584450402144772,"mapScale":0.9,"rect":{"x":746.76,"y":71.43,"width":258.57,"height":258.57}}]}],"bg":{"rect":{"x":0,"y":3.6000000000000227,"width":1152,"height":526.8},"picUrl":"http://staging-teach.cdn.ireadabc.com/0b6497174aed7ae05127d1eb8c29d94a.jpg"},"title":{"val":"Find Body Part","audioUrl":"http://staging-teach.cdn.ireadabc.com/8f5559c935b390efdea299ad568d3bd9.mp3"}}';
const data = JSON.parse(dataJson);
return data;
},
......@@ -95,13 +95,76 @@ cc.Class({
addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
if (this.data.bg.picUrl) {
this._imageResList.push({ url: this.data.bg.picUrl });
}
for (let i = 0; i < this.data.exercisesArr.length; ++i) {
let exercises = this.data.exercisesArr[i];
//循环处理备选答案的图片
let answers = exercises.answers;
for (let j = 0; j < answers.length; ++j) {
let answer = answers[j];
if (answer.picUrl) {
this._imageResList.push({ url: answer.picUrl });
}
}
//循环处理序列帧
let frames = exercises.frames;
for (let j = 0; j < frames.length; ++j) {
let frame = frames[j];
if (frame.picUrl) {
this._imageResList.push({ url: frame.picUrl });
}
}
let hotZoneItemArr = exercises.hotZoneItemArr;
for (let j = 0; j < hotZoneItemArr.length; ++j) {
let hotZoneItem = hotZoneItemArr[j];
if (hotZoneItem.pic_url) {
this._imageResList.push({ url: hotZoneItem.pic_url });
}
}
}
},
addPreloadAudio() {
this._audioResList.push({ url: this.data.audio_url });
//this._audioResList.push({ url: this.data.audio_url });
if (this.data.title.audioUrl) {
this._audioResList.push({ url: this.data.title.audioUrl });
}
for (let i = 0; i < this.data.exercisesArr.length; ++i) {
let exercises = this.data.exercisesArr[i];
//循环处理备选答案的音频
let answers = exercises.answers;
for (let j = 0; j < answers.length; ++j) {
let answer = answers[j];
if (answer.audioUrl) {
this._audioResList.push({ url: answer.audioUrl });
}
}
let hotZoneItemArr = exercises.hotZoneItemArr;
for (let j = 0; j < hotZoneItemArr.length; ++j) {
let hotZoneItem = hotZoneItemArr[j];
if (hotZoneItem.audio_url) {
this._audioResList.push({ url: hotZoneItem.audio_url });
}
}
}
},
addPreloadAnima() {
......@@ -127,16 +190,33 @@ cc.Class({
this.initData();
this.initAudio();
this.initView();
// this.initListener();
},
_cantouch: null,
_curIndex: null,
_curExercise: null,
_circleArr: null,
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
this._curIndex = 0;
this._curExercise = this.data.exercisesArr[this._curIndex];
this._circleArr = [];
},
audioBtn: null,
/**正确音频 */
audioRight: null,
/**错误音频 */
audioError: null,
/**重试一次音频 */
audioTryAgain: null,
/**刷新 */
audioRefresh: null,
initAudio() {
const audioNode = cc.find('Canvas/res/audio');
......@@ -145,151 +225,573 @@ cc.Class({
}
this.audioBtn = getAudioByResName('btn');
this.audioRight = getAudioByResName('good_job');
this.audioError = getAudioByResName('error');
this.audioTryAgain = getAudioByResName('try_again');
this.audioRefresh = getAudioByResName('appear');
},
initView() {
this.initMaskLayer();
this.initBg();
this.initPic();
this.initTitle();
this.initBtn();
this.initIcon();
this.initExercise();
this.showStartAudio();
},
maskLayer: null,
initMaskLayer() {
const bNode = this.getSprNode('black');
bNode.scaleX = cc.winSize.width / bNode.width;
bNode.scaleY = cc.winSize.height / bNode.height;
bNode.parent = cc.find('Canvas');
bNode.active = false;
this.maskLayer = bNode;
},
showStartAudio() {
playAudioByUrl(this.data.title.audioUrl, () => {
this.showQuestionAudio();
})
},
showQuestionAudio() {
if(this._curExercise.hotZoneItemArr && this._curExercise.hotZoneItemArr.length > 0){
playAudioByUrl(this._curExercise.hotZoneItemArr[0].audio_url);
}
},
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.active = true;
bgNode.opacity = 255;
//如果客户自定义背景图片,则进行替换
if (this.data.bg.picUrl) {
const spr = bgNode.getComponent(cc.Sprite)
cc.find('Canvas/decorate').active = false;
this.getSpriteFrimeByUrl(this.data.bg.picUrl, (sf) => {
spr.spriteFrame = sf;
})
}
else {
cc.find('Canvas/decorate').active = true;
const titleBgNode = this.getSprNode('bg');
titleBgNode.parent = bgNode;
}
bgNode.scale = this._mapScaleMax;
},
pic1: null,
pic2: null,
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
titleLabel: null,
initTitle() {
const titleBgNode = this.getSprNode('title_bg');
titleBgNode.parent = cc.find('Canvas');
titleBgNode.scale = this._mapScaleMin;
titleBgNode.anchorX = 0;
titleBgNode.anchorY = 1;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x;
canvas.addChild(picNode1);
this.pic1 = picNode1;
titleBgNode.x = -titleBgNode.parent.width / 2
titleBgNode.y = titleBgNode.parent.height / 2;
const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label);
label.string = this.data.text;
label.fontSize = 60;
label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode);
labelNode.parent = titleBgNode;
const label = labelNode.addComponent(cc.RichText);
const size = 36
label.font = cc.find('Canvas/res/font/FatMarker').getComponent(cc.Label).font;
label.string = `<size=${size}><color=#6e160c>${this.data.title.val}</color></size>`
label.horizontalAlign = cc.macro.TextAlignment.LEFT
labelNode.anchorX = 0;
labelNode.anchorY = 0.5;
labelNode.rotation = -3;
labelNode.x = (titleBgNode.width - labelNode.width) / 2;
labelNode.y = -(titleBgNode.height - labelNode.height) / 2;
this.titleLabel = label;
const maxW = titleBgNode.width * 0.8;
if (labelNode.width > maxW) {
labelNode.scale = maxW / labelNode.width;
}
titleBgNode.addComponent(cc.Button);
titleBgNode.on('click', () => {
playAudioByUrl(this.data.title.audioUrl);
});
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2);
picNode2.x = canvas.width;
picNode2.baseX = picNode2.x;
this.pic2 = picNode2;
const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText);
const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size;
picNode2.addChild(labelNode);
});
},
initIcon() {
const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5;
iconNode.anchorX = 1;
iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url);
})
},
curPage: null,
initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级
initBtn() {
const bottomPart = cc.find('Canvas/bottomBtn')
bottomPart.scale = this._mapScaleMin;
bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => {
const lastBtn = bottomPart.getChildByName('btn_last');
const nextBtn = bottomPart.getChildByName('btn_next');
const refreshBtn = bottomPart.getChildByName('btn_refresh');
const closeBtn = bottomPart.getChildByName('btn_close');
btnClickAnima(lastBtn)
lastBtn.on('click', () => {
if (!this._cantouch) {
return;
}
this._cantouch = false;
this.lastBtnClick();
this.refreshBtnStatue();
})
btnClickAnima(nextBtn)
nextBtn.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 0) {
this._cantouch = false;
this.nextBtnClick();
this.refreshBtnStatue();
})
btnClickAnima(refreshBtn)
refreshBtn.on('click', () => {
console.log("this._cantouch: ", this._cantouch);
if (!this._cantouch) {
return;
}
this.curPage = 0
this.leftMove();
this._cantouch = false;
this.refreshBtnClick();
this.refreshBtnStatue();
})
btnClickAnima(closeBtn)
closeBtn.on('click', () => {
cc.audioEngine.play(this.audioBtn.clip, false, 0.8)
})
const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => {
if (!this._cantouch) {
this.refreshBtnStatue();
},
refreshBtnStatue() {
const lastBtn = cc.find('Canvas/bottomBtn/btn_last');
const nextBtn = cc.find('Canvas/bottomBtn/btn_next');
lastBtn.opacity = 255;
nextBtn.opacity = 255;
if (this._curIndex <= 0) {
lastBtn.opacity = 80;
}
if (this._curIndex >= this.data.exercisesArr.length - 1) {
nextBtn.opacity = 80;
}
},
lastBtnClick() {
if (this._curIndex <= 0) {
this._cantouch = true;
return;
}
if (this.curPage == 1) {
cc.audioEngine.play(this.audioBtn.clip, false, 0.1)
this._curIndex--;
this._curExercise = this.data.exercisesArr[this._curIndex];
this.showNewGroup();
},
nextBtnClick() {
if (this._curIndex >= this.data.exercisesArr.length - 1) {
this._cantouch = true;
return;
}
this.curPage = 1
this.rightMove();
cc.audioEngine.play(this.audioBtn.clip, false, 0.1)
cc.audioEngine.play(this.audioBtn.clip, false, 0.5)
this._curIndex++;
this._curExercise = this.data.exercisesArr[this._curIndex];
this.showNewGroup();
},
refreshBtnClick() {
cc.audioEngine.play(this.audioRefresh.clip, false, 0.2);
this.showNewGroup();
},
showNewGroup() {
this.showMaskLayer(() => {
this.initExercise();
this.hideMaskLayer(() => {
this._cantouch = true;
this.showQuestionAudio();
});
})
},
leftMove() {
showMaskLayer(cb) {
this.maskLayer.opacity = 0;
this.maskLayer.active = true;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 255}, {easing: 'sineOut'})
.call(() => {
cb()
})
.start()
},
hideMaskLayer(cb = null) {
this.maskLayer.opacity = 255;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 0}, {easing: 'sineIn'})
.call(() => {
this.maskLayer.active = false;
if (cb) {
cb()
}
})
.start()
},
initCenterPart() {
const centerPart = cc.find('Canvas/stage/centerPart');
centerPart.scale = this._mapScaleMin;
if (this._curExercise.frames && this._curExercise.frames.length > 1) {
if (centerPart.pic) {
centerPart.pic.removeFromParent();
}
console.log(this._curExercise.frames[0].picUrl);
this.getSprNodeByUrl(this._curExercise.frames[0].picUrl, (spr) => {
spr.node.parent = centerPart;
spr.node.scale = 1.0;
spr.node.x = 0;
spr.node.y = 0;
centerPart.pic = spr.node;
let picMaxW = centerPart.width;
let picMaxH = centerPart.height;
setSprNodeMaxLen(spr.node, picMaxW, picMaxH);
centerPart.bubbleArr = centerPart.bubbleArr || [];
for (let i = 0; i < this._curExercise.hotZoneItemArr.length; ++i) {
let hotZoneItem = this._curExercise.hotZoneItemArr[i];
this.getSprNodeByUrl(hotZoneItem.pic_url, (bubbleSpr) => {
if (centerPart.bubbleArr[i]) {
centerPart.bubbleArr[i].removeFromParent();
}
let bubble_bg = cc.find('Canvas/stage/centerPart/bubble_bg');
bubbleSpr.node.parent =bubble_bg;
bubbleSpr.node.scale = 0;
bubbleSpr.node.x = hotZoneItem.rect.x * hotZoneItem.mapScale;
bubbleSpr.node.y = hotZoneItem.rect.y * hotZoneItem.mapScale;
centerPart.bubbleArr[i] = bubbleSpr.node;
bubbleSpr.node.addComponent(cc.Button)
bubbleSpr.node.on('click', () => {
playAudioByUrl(hotZoneItem.audio_url, () => {
});
});
cc.tween(bubbleSpr.node)
.to(0.7, {scale: 1}, {easing: 'cubicIn'}).call(()=>{
}).start();
});
}
});
}
},
initExercise() {
let answers = this._curExercise.answers;
this.initCenterPart();
const circleArr = this.getCircleArr(answers);
this._circleArr = circleArr;
circleArr.forEach((item, i) => {
const data = answers[i];
if (data) {
this.getSprNodeByUrl(data.picUrl, (spr) => {
if (!item.blackMask) {
const blackMaskNode = this.getSprNode('mask')
blackMaskNode.parent = item;
blackMaskNode.scale = 1.0;
blackMaskNode.x = 0;
blackMaskNode.y = 3;
blackMaskNode.zIndex = 1;
item.blackMask = blackMaskNode;
}
item.blackMask.active = false;
if (!item.blackMask.icon) {
const icon = this.getSprNode('circle_x');
icon.parent = item.blackMask;
item.blackMask.icon = icon;
}
item.blackMask.icon.scale = 0;
if (!item.maskNode) {
let maskNode = new cc.Node(); // new cc.Node();
maskNode.parent = item;
if (item.getChildByName('mask')) {
maskNode = item.getChildByName('mask');
maskNode.scale = 1.0;
maskNode.x = 0;
maskNode.y = 3;
const mask = maskNode.getComponent(cc.Mask);
mask.inverted = false;
}
item.maskNode = maskNode
}
const maskNode = item.maskNode;
if (item.pic) {
item.pic.removeFromParent();
}
spr.node.parent = maskNode;
let picMaxW, picMaxH
picMaxW = item.width;
picMaxH = item.height;
setSprNodeMaxLen(spr.node, picMaxW, picMaxH);
item.pic = spr.node;
spr.node.parent.addComponent(cc.Button);
spr.node.parent.on('click', () => {
if (!this._cantouch) {
return;
}
console.log('data: ', data);
if (data.isRight == '1') {
this.showRightCircle(item);
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start();
} else {
this.showWrongCircle(item);
}
});
})
}
});
this.addCircleSound();
this._cantouch = true;
},
_answer_node : null,
getCircleArr(answers) {
const circleArr = [];
let node, circleNum = 0;
console.log('answers: ', answers);
const answer_3 = cc.find('Canvas/stage/answer_3');
const answer_4 = cc.find('Canvas/stage/answer_4');
const answer_5 = cc.find('Canvas/stage/answer_5');
if (answers.length == 3) {
answer_3.active = true;
answer_4.active = false;
answer_5.active = false;
node = answer_3;
circleNum = 3;
} else if (answers.length == 4) {
answer_3.active = false;
answer_4.active = true;
answer_5.active = false;
node = answer_4;
circleNum = 4;
}
else if (answers.length == 5) {
answer_3.active = false;
answer_4.active = false;
answer_5.active = true;
node = answer_5;
circleNum = 5;
}
this._answer_node = node;
for (let i = 0; i < circleNum; i++) {
let circleNode = node.getChildByName('option_board_' + (i + 1).toString());
if (answers[i]) {
circleNode.active = true;
circleNode.data = answers[i];
circleArr.push(circleNode);
} else {
circleNode.active = false;
}
}
return circleArr;
},
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
addCircleSound() {
this._circleArr.forEach(item => {
if (item.icon) {
return;
}
const sprNode = this.getSprNode('loudspeaker');
sprNode.parent = item;
sprNode.x = item.width / 2.4;
sprNode.y = item.height / 3.0;
sprNode.zIndex = 2;
item.icon = sprNode;
const sprNode2 = this.getSprNode('loudspeaker_playing');
sprNode2.parent = sprNode.parent;
sprNode2.x = sprNode.x;
sprNode2.y = sprNode.y;
sprNode2.opacity = 0;
sprNode.spr2 = sprNode2;
sprNode.addComponent(cc.Button)
sprNode.on('click', () => {
this.showSoundAnima(sprNode);
playAudioByUrl(item.audioUrl, () => {
this.stopSoundAnima(sprNode);
});
});
});
},
/**正在播放的音频节点 */
_playingNode: null,
showSoundAnima(iconNode, time = 0.4) {
if (this._playingNode != iconNode && this._playingNode) {
this.stopSoundAnima(this._playingNode);
}
this._playingNode = iconNode;
iconNode.isRunAnima = true;
iconNode.spr2.opacity = 255;
iconNode.opacity = 0;
cc.tween(iconNode)
.delay(time / 2)
.call(() => {
iconNode.spr2.opacity = 0;
iconNode.opacity = 255;
})
.delay(time / 2)
.call(() => {
if (iconNode.isRunAnima) {
this.showSoundAnima(iconNode);
}
})
.start()
},
stopSoundAnima(iconNode) {
iconNode.isRunAnima = false;
},
showRightCircle(circle) {
cc.audioEngine.play(this.audioRight.clip, false, 0.3)
cc.tween(this._answer_node)
.to(0.7, {scale: 0}, {easing: 'cubicIn'})
.call(() => {
this._answer_node.active = false;
this._answer_node.scale = this._mapScaleMin;
this._cantouch = true;
})
.start();
},
rightMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
showWrongCircle(circle) {
if (circle.blackMask.active) {
return;
}
cc.audioEngine.play(this.audioError.clip, false, 0.2)
const showIcon = () => {
cc.tween(circle.blackMask.icon)
.to(0.3, { scale: 0.9 }, { easing: 'bounceOut' })
.delay(0.2)
.to(0.7, { scale: 0 }, { easing: 'cubicIn' })
.start();
}
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
const hide = () => {
circle.blackMask.opacity = 0;
cc.tween(circle.blackMask)
.to(0.1, { opacity: 255 })
.call(() => {
this._cantouch = true;
showIcon();
})
.start();
.start()
}
hide();
circle.blackMask.active = true;
},
// update (dt) {},
......@@ -338,7 +840,7 @@ cc.Class({
this.getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(node);
cb(spr);
}
})
},
......
{
"ver": "1.1.0",
"uuid": "3d78532c-02ec-4ba2-8453-c83171eb39f5",
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/textures/bg.jpg

25.8 KB | W: | H:

play/assets/tmpGame/textures/bg.jpg

279 KB | W: | H:

play/assets/tmpGame/textures/bg.jpg
play/assets/tmpGame/textures/bg.jpg
play/assets/tmpGame/textures/bg.jpg
play/assets/tmpGame/textures/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
{
"ver": "2.3.5",
"uuid": "8aa84c5f-aa0e-456d-aeed-4b3d799af2dd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 388,
"platformSettings": {},
"subMetas": {
"bg_floor": {
"ver": "1.0.4",
"uuid": "129b0bf8-e9a1-4f43-b3c5-a8783dd27b44",
"rawTextureUuid": "8aa84c5f-aa0e-456d-aeed-4b3d799af2dd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 388,
"rawWidth": 1280,
"rawHeight": 388,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "78232ea2-bf69-4323-a632-539e486a3aac",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"width": 285,
"height": 205,
"platformSettings": {},
"subMetas": {
"1orange": {
"bg_lt": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "d4aba120-0e61-4836-853a-0a38433ffc04",
"rawTextureUuid": "78232ea2-bf69-4323-a632-539e486a3aac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"offsetY": 0,
"trimX": 0,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"trimY": 0,
"width": 285,
"height": 205,
"rawWidth": 285,
"rawHeight": 205,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "fb7cf0eb-92ee-4ccd-add2-ff91274d4f84",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"width": 285,
"height": 205,
"platformSettings": {},
"subMetas": {
"btn_right": {
"bg_rt": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"uuid": "a76c2fa5-6864-4076-8209-2abfac0ffdf3",
"rawTextureUuid": "fb7cf0eb-92ee-4ccd-add2-ff91274d4f84",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 66,
"rawWidth": 61,
"rawHeight": 67,
"width": 285,
"height": 205,
"rawWidth": 285,
"rawHeight": 205,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "d5320ba1-149b-41d6-a429-fe8046456b60",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"width": 990,
"height": 345,
"platformSettings": {},
"subMetas": {
"icon": {
"bg_star": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "d53bf7c7-6195-4009-a62b-3aa2557b51e4",
"rawTextureUuid": "d5320ba1-149b-41d6-a429-fe8046456b60",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 990,
"height": 345,
"rawWidth": 990,
"rawHeight": 345,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "e8229e86-8527-4b88-80ee-36d84a95e746",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 102,
"platformSettings": {},
"subMetas": {
"bg_top": {
"ver": "1.0.4",
"uuid": "760864d5-b4bf-4f7a-929b-833fdd1ed24c",
"rawTextureUuid": "e8229e86-8527-4b88-80ee-36d84a95e746",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 102,
"rawWidth": 1280,
"rawHeight": 102,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f7b806a4-4c99-482c-9ef5-3faba9ed4d7a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 100,
"height": 100,
"platformSettings": {},
"subMetas": {
"black": {
"ver": "1.0.4",
"uuid": "b71ab9cc-f816-4ab4-a418-c3894b9c33f1",
"rawTextureUuid": "f7b806a4-4c99-482c-9ef5-3faba9ed4d7a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 100,
"height": 100,
"rawWidth": 100,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a88ca261-1410-40a6-8b62-de00aac4311e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 49,
"height": 50,
"platformSettings": {},
"subMetas": {
"btn_close": {
"ver": "1.0.4",
"uuid": "ee764781-bde3-4e88-83dc-6afaac9fb481",
"rawTextureUuid": "a88ca261-1410-40a6-8b62-de00aac4311e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 49,
"height": 50,
"rawWidth": 49,
"rawHeight": 50,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "273e9e9f-35a8-4de2-bcb0-930e497ae0d1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"width": 45,
"height": 46,
"platformSettings": {},
"subMetas": {
"btn_left": {
"btn_last": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "8d639968-f42c-4f91-90de-4ba34c6bca91",
"rawTextureUuid": "273e9e9f-35a8-4de2-bcb0-930e497ae0d1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -22,10 +22,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 61,
"height": 67,
"rawWidth": 61,
"rawHeight": 67,
"width": 45,
"height": 46,
"rawWidth": 45,
"rawHeight": 46,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "9a1a9dd9-b5d6-4d65-8a84-cfd59a350b0a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 44,
"height": 46,
"platformSettings": {},
"subMetas": {
"btn_next": {
"ver": "1.0.4",
"uuid": "4a7548c2-e983-41ab-b6b4-f1092dd2b2cc",
"rawTextureUuid": "9a1a9dd9-b5d6-4d65-8a84-cfd59a350b0a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 44,
"height": 46,
"rawWidth": 44,
"rawHeight": 46,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7d99e5d6-be6e-4906-ad92-2140f52fb705",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 47,
"height": 57,
"platformSettings": {},
"subMetas": {
"btn_refresh": {
"ver": "1.0.4",
"uuid": "3237b1d3-0795-4bbb-bee3-ba2a77b875df",
"rawTextureUuid": "7d99e5d6-be6e-4906-ad92-2140f52fb705",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 47,
"height": 57,
"rawWidth": 47,
"rawHeight": 57,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "aa5ca4b8-3f45-40f2-a72e-784660086597",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 109,
"height": 109,
"platformSettings": {},
"subMetas": {
"circle_x": {
"ver": "1.0.4",
"uuid": "5e2f92d5-3a8f-4299-afec-39341eae777b",
"rawTextureUuid": "aa5ca4b8-3f45-40f2-a72e-784660086597",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 109,
"height": 109,
"rawWidth": 109,
"rawHeight": 109,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1512c336-ab6d-470e-a794-6f1dbedda6de",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 103,
"height": 646,
"platformSettings": {},
"subMetas": {
"l_curtain": {
"ver": "1.0.4",
"uuid": "42998bc9-e010-4a63-bc8f-f1e82cfaa1b9",
"rawTextureUuid": "1512c336-ab6d-470e-a794-6f1dbedda6de",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 103,
"height": 646,
"rawWidth": 103,
"rawHeight": 646,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f2d0669f-ebdb-4b51-96b1-460f95f7166f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 57,
"height": 61,
"platformSettings": {},
"subMetas": {
"loudspeaker": {
"ver": "1.0.4",
"uuid": "e1f115a3-879c-4c53-8b4e-daabf238e534",
"rawTextureUuid": "f2d0669f-ebdb-4b51-96b1-460f95f7166f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 57,
"height": 61,
"rawWidth": 57,
"rawHeight": 61,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "67cab122-fe68-4fed-ab6c-7106ad4aa97c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 57,
"height": 61,
"platformSettings": {},
"subMetas": {
"loudspeaker_playing": {
"ver": "1.0.4",
"uuid": "703040de-e10d-4a49-acdd-fecb3c0ecf98",
"rawTextureUuid": "67cab122-fe68-4fed-ab6c-7106ad4aa97c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 57,
"height": 61,
"rawWidth": 57,
"rawHeight": 61,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2189026f-8e66-4610-b5f7-f5b7d506ff76",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 149,
"height": 149,
"platformSettings": {},
"subMetas": {
"mask": {
"ver": "1.0.4",
"uuid": "e5623257-3b71-4720-8b9b-bd5b0f3d2106",
"rawTextureUuid": "2189026f-8e66-4610-b5f7-f5b7d506ff76",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 149,
"height": 149,
"rawWidth": 149,
"rawHeight": 149,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6218c4e7-1f95-4a09-9776-06b34ad295e0",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 190,
"height": 201,
"platformSettings": {},
"subMetas": {
"option_board": {
"ver": "1.0.4",
"uuid": "54fa87db-64cb-4caf-89dc-f7685524fc22",
"rawTextureUuid": "6218c4e7-1f95-4a09-9776-06b34ad295e0",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 190,
"height": 201,
"rawWidth": 190,
"rawHeight": 201,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "76a2de25-7550-48cf-858f-b8b0679bda10",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 108,
"height": 645,
"platformSettings": {},
"subMetas": {
"r_curtain": {
"ver": "1.0.4",
"uuid": "ce048b47-60c7-4e56-bc63-72082210abaf",
"rawTextureUuid": "76a2de25-7550-48cf-858f-b8b0679bda10",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 108,
"height": 645,
"rawWidth": 108,
"rawHeight": 645,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cfc43dd1-2c05-4266-b488-bd0a86b5edd7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 644,
"height": 132,
"platformSettings": {},
"subMetas": {
"shadow": {
"ver": "1.0.4",
"uuid": "9022c3d2-32e2-442c-82f6-0d8d80d25560",
"rawTextureUuid": "cfc43dd1-2c05-4266-b488-bd0a86b5edd7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 644,
"height": 132,
"rawWidth": 644,
"rawHeight": 132,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "501c0733-2659-461d-807a-d7d7a08c7829",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 517,
"height": 128,
"platformSettings": {},
"subMetas": {
"title_bg": {
"ver": "1.0.4",
"uuid": "14e7fe89-0579-40cd-80a9-b226f20c1a55",
"rawTextureUuid": "501c0733-2659-461d-807a-d7d7a08c7829",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 517,
"height": 128,
"rawWidth": 517,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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