Commit 8e3ebdb4 authored by 章红平's avatar 章红平

提交

parent 59a6c521
{
"ver": "1.1.2",
"uuid": "ee181d6e-8581-49f5-8c02-306e27aacc00",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "12968a49-4824-4ebb-afae-2bc3f19d6ad6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"1-游戏介绍,点击start开始": {
"ver": "1.0.4",
"uuid": "7de5df05-cf29-4f0a-b809-6e9d0358559d",
"rawTextureUuid": "12968a49-4824-4ebb-afae-2bc3f19d6ad6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ae84e419-4862-472a-899e-5912cce1c9d5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"10-全部完成出现能量石提示,点击按钮重新开始": {
"ver": "1.0.4",
"uuid": "eb7f4ca2-8d3f-49f7-b589-769740b7da4f",
"rawTextureUuid": "ae84e419-4862-472a-899e-5912cce1c9d5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "081d53ed-e5e4-4fd1-9dd2-ea7bc8e87ddc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"11-5对布局": {
"ver": "1.0.4",
"uuid": "2eef3fb1-8fc7-4e7f-99fd-ed004adc1277",
"rawTextureUuid": "081d53ed-e5e4-4fd1-9dd2-ea7bc8e87ddc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "3c3c90f2-6dbe-49e2-8494-2084489b7445",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"12-3对布局": {
"ver": "1.0.4",
"uuid": "822a276f-831b-4d6f-ac07-9280edce91f3",
"rawTextureUuid": "3c3c90f2-6dbe-49e2-8494-2084489b7445",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "322ad715-5e7a-459b-ae4e-c7f0b90eccb7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"13-2对布局": {
"ver": "1.0.4",
"uuid": "75493d3a-71fa-40cd-9bf6-f243fa382515",
"rawTextureUuid": "322ad715-5e7a-459b-ae4e-c7f0b90eccb7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cc703ffa-e88c-4aed-8ee8-a4cc3c9f3277",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"2-显示卡牌内容": {
"ver": "1.0.4",
"uuid": "b61a1d45-12ce-47b2-ba9e-5fab8823a4d2",
"rawTextureUuid": "cc703ffa-e88c-4aed-8ee8-a4cc3c9f3277",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "96004bc5-8bca-4aa9-a9f5-a047d6ddfc5c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"3-倒数3秒时出现数字提示": {
"ver": "1.0.4",
"uuid": "4a6a2d56-47c0-476d-a630-7eadce3a3847",
"rawTextureUuid": "96004bc5-8bca-4aa9-a9f5-a047d6ddfc5c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "137a116a-5b9a-4573-9be6-725b18ff0862",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"4-倒计时结束卡牌翻到背面,同时右上角开始倒计时": {
"ver": "1.0.4",
"uuid": "bda0137f-a4ec-4d8d-b1ff-df2e1acf95d6",
"rawTextureUuid": "137a116a-5b9a-4573-9be6-725b18ff0862",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f4854aeb-f5b5-45cd-9095-30e642d42416",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"5-点击任意一张牌,牌翻过来同时发音": {
"ver": "1.0.4",
"uuid": "6bd540a7-428d-474b-b795-a698ec23b12a",
"rawTextureUuid": "f4854aeb-f5b5-45cd-9095-30e642d42416",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9dfc2591-7f18-42f0-9efe-7fc95b7e0c13",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"6-配对正确,出现正确动效,两张牌消失": {
"ver": "1.0.4",
"uuid": "a621490c-1e14-4026-b1a4-640ab33caf1e",
"rawTextureUuid": "9dfc2591-7f18-42f0-9efe-7fc95b7e0c13",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "31b4e467-5f92-4b6c-a562-6babf0c7b3e7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"7-配对错误,两张牌同时翻过去": {
"ver": "1.0.4",
"uuid": "cbcbb609-a256-418e-a213-216a48be67ea",
"rawTextureUuid": "31b4e467-5f92-4b6c-a562-6babf0c7b3e7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a82523d4-55d0-4cb9-a0d1-7cea7451bba7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"8-倒计时还剩5秒时数字变红": {
"ver": "1.0.4",
"uuid": "701ae933-52da-470b-8711-ea44a1e2e0ec",
"rawTextureUuid": "a82523d4-55d0-4cb9-a0d1-7cea7451bba7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "02124b4d-ee32-447c-bdb4-b3aefef49820",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"9-倒计时结束直接弹出restart按钮,点击重新开始": {
"ver": "1.0.4",
"uuid": "418bb067-0898-47a7-a13e-590ec789636e",
"rawTextureUuid": "02124b4d-ee32-447c-bdb4-b3aefef49820",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "bd8f6c26-792b-4d76-b644-86d9748229c2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1873,
"height": 3349,
"platformSettings": {},
"subMetas": {
"全部": {
"ver": "1.0.4",
"uuid": "a5884135-b06c-4737-8c02-dc2e23c180ff",
"rawTextureUuid": "bd8f6c26-792b-4d76-b644-86d9748229c2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1873,
"height": 3349,
"rawWidth": 1873,
"rawHeight": 3349,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -27,6 +27,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -27,6 +27,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
clickNodeData1 = null clickNodeData1 = null
canTouch = false canTouch = false
completeNum = 0; completeNum = 0;
@property(cc.Node)
overN:cc.Node
...@@ -68,9 +70,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -68,9 +70,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.tittleLabel.string = this.data.title; this.tittleLabel.string = this.data.title;
this.tipLabel.string = this.data.questionText; this.tipLabel.string = this.data.questionText;
this.initCards() this.initCards()
// this.initTime(); this.initTime();
}
initGameData(){
this.clickNode1 = null;
this.clickNodeData1 = null
this.canTouch = false
this.completeNum = 0;
} }
initBg() { initBg() {
const bgNode = cc.find('Canvas/bg'); const bgNode = cc.find('Canvas/bg');
...@@ -153,13 +161,20 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -153,13 +161,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
// cc.find("Canvas/uiP/top/timeN").active=true; // cc.find("Canvas/uiP/top/timeN").active=true;
let timeN = cc.find("Canvas/uiP/top/timeN/bg_time"); let timeN = cc.find("Canvas/uiP/top/timeN/bg_time");
let timeN1 = cc.find("Canvas/uiP/top/timeN/bg_time2"); let timeN1 = cc.find("Canvas/uiP/top/timeN/bg_time2");
this.watchTime = this.data.questions[0].watchTime; this.watchTime = this.data.questions[this.questionIndex].watchTime;
this.gameTime = this.data.questions[0].gameTime; this.gameTime = this.data.questions[this.questionIndex].gameTime;
let numTime = this.watchTime; let numTime = this.watchTime;
if (this.gameState == "game") numTime = this.gameTime; if (this.gameState == "game") numTime = this.gameTime;
console.log("numTime=======",numTime)
timeN.getComponentInChildren(cc.Label).string = numTime; timeN.getComponentInChildren(cc.Label).string = numTime;
timeN.active = true; timeN1.getComponentInChildren(cc.Label).string = numTime;
timeN.active = false;
timeN1.active = false; timeN1.active = false;
if(numTime>5){
timeN.active = true;
}else{
timeN.active = false;
}
} }
updateTime() { updateTime() {
let timeN = cc.find("Canvas/uiP/top/timeN/bg_time"); let timeN = cc.find("Canvas/uiP/top/timeN/bg_time");
...@@ -213,7 +228,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -213,7 +228,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
startWatch() { startWatch() {
this.canTouch = false this.canTouch = false
this.gameState == "watching" this.gameState = "watching"
this.clearntervals(); this.clearntervals();
this.initTime(); this.initTime();
this.watchInterval = setInterval(() => { this.watchInterval = setInterval(() => {
...@@ -240,8 +255,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -240,8 +255,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initTime(); this.initTime();
this.gameInterval = setInterval(() => { this.gameInterval = setInterval(() => {
this.gameTime--; this.gameTime--;
console.log("watchtime=====", this.gameTime) console.log("gametime=====", this.gameTime)
if (this.gameTime <= 0) { if (this.gameTime <= 0) {
this.gameOver(false);
this.clearntervals(); this.clearntervals();
} }
this.updateTime(); this.updateTime();
...@@ -277,6 +293,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -277,6 +293,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this.completeNum == this.data.questions[this.questionIndex].options.length / 2) { if (this.completeNum == this.data.questions[this.questionIndex].options.length / 2) {
console.log("allTrue===") console.log("allTrue===")
this.clearntervals(); this.clearntervals();
if(this.questionIndex<(this.data.questions.length-1)){
this.questionIndex++
this.onClickRestart()
}else{
this.gameOver(true)
}
} }
console.log("allActionFish=====") console.log("allActionFish=====")
}) })
...@@ -316,81 +338,23 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -316,81 +338,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
clearInterval(this.gameInterval); clearInterval(this.gameInterval);
} }
} }
gameOver(isSuc){
initView() { this.questionIndex=0;
this.initBg(); this.overN.active=true;
this.initBtn();
this.initIcon(); let sucN=this.overN.getChildByName("suc")
} let failN=this.overN.getChildByName("fail")
if(isSuc){
sucN.active=true;
failN.active=false;
pic1 = null; this.playAudioByUrl("suc")
pic2 = null; onHomeworkFinish();
initPic() { }else{
const canvas = cc.find('Canvas'); sucN.active=false;
const maxW = canvas.width * 0.7; failN.active=true;
}
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;
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);
});
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);
})
}
initBtn() {
}
// update (dt) {},
initListener() {
} }
playLocalAudio(audioName) { playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource); const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -400,4 +364,85 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -400,4 +364,85 @@ export default class SceneComponent extends MyCocosSceneComponent {
}); });
}) })
} }
onClickRestart(){
this.overN.active=false;
this.initGameData();
this.initCards();
this.onStartClick();
}
// initView() {
// this.initBg();
// this.initBtn();
// this.initIcon();
// }
// pic1 = null;
// pic2 = null;
// initPic() {
// const canvas = cc.find('Canvas');
// const maxW = canvas.width * 0.7;
// 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;
// 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);
// });
// 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);
// })
// }
// initBtn() {
// }
// // update (dt) {},
// initListener() {
// }
} }
...@@ -56,9 +56,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -56,9 +56,7 @@ export class MyCocosSceneComponent extends cc.Component {
(<any>window).courseware.getData((data) => { (<any>window).courseware.getData((data) => {
this.log('data:' + data); this.log('data:' + data);
this.data = data || this.getDefaultData(); this.data = data || this.getDefaultData();
this.log('data1:' + data);
this.data = JSON.parse(JSON.stringify(this.data)); this.data = JSON.parse(JSON.stringify(this.data));
this.log('data2:' + data);
this.initData(); this.initData();
this.preloadItem(); this.preloadItem();
}) })
...@@ -114,16 +112,16 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -114,16 +112,16 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
log(str) { log (str) {
const node = cc.find('Canvas/middleLayer'); const node = cc.find('middleLayer');
if (node) { if(node){
node.getComponent(cc.Label).string=str; node.getComponent('middleLayer').log(str);
console.log(str); }else{
} else { cc.log(str);
console.log(str);
} }
} }
onLoadEnd() { onLoadEnd() {
} }
......
...@@ -4,7 +4,7 @@ export const defaultData = { ...@@ -4,7 +4,7 @@ export const defaultData = {
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3", questionTextAudio: "http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3",
questions: [{ questions: [{
watchTime: 10, // 看题时间(秒) watchTime: 10, // 看题时间(秒)
gameTime: 120, // 游戏时间(秒) gameTime: 30, // 游戏时间(秒)
options: [{ options: [{
pairIdx: 1, pairIdx: 1,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3", audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
...@@ -37,6 +37,8 @@ export const defaultData = { ...@@ -37,6 +37,8 @@ export const defaultData = {
type: "img" type: "img"
}] }]
}, { }, {
watchTime: 10, // 看题时间(秒)
gameTime: 50, // 游戏时间(秒)
options: [{ options: [{
pairIdx: 1, pairIdx: 1,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3", audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
...@@ -67,6 +69,100 @@ export const defaultData = { ...@@ -67,6 +69,100 @@ export const defaultData = {
image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg", image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3", audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img" type: "img"
},
{
pairIdx: 4,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "ccccc"
}, {
pairIdx: 4,
image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
},
{
pairIdx: 5,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "ccccc"
}, {
pairIdx: 5,
image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
}]
},
{
watchTime: 10, // 看题时间(秒)
gameTime: 40, // 游戏时间(秒)
options: [{
pairIdx: 1,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "aaaaa"
}, {
pairIdx: 1,
image: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
}, {
pairIdx: 2,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "bbbbb"
}, {
pairIdx: 2,
image: "http://staging-teach.cdn.ireadabc.com/98d6388099de7dcd945f39d9f74e226f.jpg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
}, {
pairIdx: 3,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "ccccc"
}, {
pairIdx: 3,
image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
},
{
pairIdx: 4,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "ccccc"
}, {
pairIdx: 4,
image: "http://staging-teach.cdn.ireadabc.com/35cf0aaf4e68a1a8d5e456ff98915057.jpeg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
},
]
},
{
watchTime: 10, // 看题时间(秒)
gameTime: 20, // 游戏时间(秒)
options: [{
pairIdx: 1,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "aaaaa"
}, {
pairIdx: 1,
image: "http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
}, {
pairIdx: 2,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.mp3",
type: "text",
text: "bbbbb"
}, {
pairIdx: 2,
image: "http://staging-teach.cdn.ireadabc.com/98d6388099de7dcd945f39d9f74e226f.jpg",
audio: "http://staging-teach.cdn.ireadabc.com/695bb2b2cda6c7efbacceabc89f1a031.mp3",
type: "img"
}] }]
}] }]
} }
\ 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