Commit 2030376a authored by Tt's avatar Tt

企鹅运动完成

parent d3444fb7
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "37650a49-aee3-4152-bdeb-7a8e2ea86b6f", "uuid": "b705826d-1e83-4879-8af8-d599cd2e6822",
"downloadMode": 0, "downloadMode": 0,
"duration": 4.04898, "duration": 4.04898,
"subMetas": {} "subMetas": {}
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "9b404917-465f-4278-90fb-c1eace2d89e8", "uuid": "3a14d973-f1ae-456e-87a3-2b5addac5ba9",
"downloadMode": 0, "downloadMode": 0,
"duration": 2.220417, "duration": 2.220417,
"subMetas": {} "subMetas": {}
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "647922fa-f228-485c-a3a0-d632c43b8820", "uuid": "2658d6cd-56ef-4d97-b384-6d486e3d7e52",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 2.952,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "d08086e0-9231-4ace-a7fb-b88b36055c9a", "uuid": "922e1897-10d2-473a-aa15-19efff36ecc3",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.809796, "duration": 0.809796,
"subMetas": {} "subMetas": {}
......
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "9731684b-d8c0-4e2a-acf2-d26150827e60", "uuid": "84e2810e-e049-4711-9c55-b70bacd57a9a",
"downloadMode": 0, "downloadMode": 0,
"duration": 1.906939, "duration": 1.906939,
"subMetas": {} "subMetas": {}
......
import Data from "../script/defaultData";
export default class Game {
private static ins: Game;
public static getIns(): Game {
if (!Game.ins) Game.ins = new Game();
return Game.ins;
}
private data: Array<any>
public pause: boolean;
constructor() {
//
}
reset() {
this.data = Data.list;
this.pause = false;
// let winCount = 0;
// let nowItem = [];
// this.data.forEach(li => {
// winCount += li.stem.times;
// });
}
get nowList() {
//每一个企鹅是什么应该在这边获取。
return [];
}
get penguin() {
let item = null;
return item;
}
}
\ No newline at end of file
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "7091890a-4097-4c74-b388-e0be538f9c1c", "uuid": "061e2c82-faaf-41c5-b082-859b3f186134",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
This diff is collapsed.
import { asyncDelay, onHomeworkFinish } from "../script/util"; import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import pg from "./pg"; import pg from "./pg";
import map from "./map"; import Game from "./Game";
import { import {
showFireworks, showFireworks,
} from '../script/utils'; } from '../script/utils';
...@@ -16,6 +16,8 @@ const CELLTYPE = { ...@@ -16,6 +16,8 @@ const CELLTYPE = {
JUMP_ROLL: 5, JUMP_ROLL: 5,
WIN: 100, WIN: 100,
} }
@ccclass @ccclass
export default class NewClass extends MyCocosSceneComponent { export default class NewClass extends MyCocosSceneComponent {
addPreloadImage() { addPreloadImage() {
...@@ -52,15 +54,18 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -52,15 +54,18 @@ export default class NewClass extends MyCocosSceneComponent {
} }
_cantouch = null; _cantouch = null;
gameData = null;
initData() { initData() {
this.log("test initData") this.log("test initData")
// 所有全局变量 默认都是null // 所有全局变量 默认都是null
this._cantouch = true; this._cantouch = true;
Game.getIns().reset();
//开始显示企鹅
} }
initView() { initView() {
this.log("test initView") this.log("test initView")
this.initTouzi();
this.initChess();
} }
initEvent() { initEvent() {
this.log("test initEvent") this.log("test initEvent")
...@@ -87,8 +92,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -87,8 +92,7 @@ export default class NewClass extends MyCocosSceneComponent {
} else { } else {
this.robotLevel = 2;//0 1 2 三个级别 0 最高 this.robotLevel = 2;//0 1 2 三个级别 0 最高
} }
this.initChess(); pg.event.emit("game_start_loop")
this.scheduleOnce(this.startTouzi, 2.1);
} }
onSpeakScueess() { onSpeakScueess() {
//执行后续的动作。 //执行后续的动作。
...@@ -96,203 +100,10 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -96,203 +100,10 @@ export default class NewClass extends MyCocosSceneComponent {
} }
onSpeakFail() { onSpeakFail() {
//回退到最后一个位置 //回退到最后一个位置
let cell = map[this.playerPoint];
this.jumpChess(cell, this.lastPointId).then(() => {
this.turnNext();
})
} }
turnNext() { turnNext() {
this.turnRobot = !this.turnRobot; this.turnRobot = !this.turnRobot;
this.startTouzi();
}
//-----------------------------CHESS-------------------------------
private chessPlayer: cc.Node;
private chessRobot: cc.Node;
initChess() {
//初始化棋子
this.chessPlayer = pg.view.find(this, "chess/chess_player");
this.chessRobot = pg.view.find(this, "chess/chess_robot");
let point = map[0];
this.chessPlayer.x = Number(point.yellow_x);
this.chessPlayer.y = Number(point.yellow_y);
this.chessRobot.x = Number(point.blue_x);
this.chessRobot.y = Number(point.blue_y);
}
getMovePoints(now, runNum) {
let points = [];
for (let i = now; i <= now + runNum; i++) {
let point = map[i];
if (!point) break;
points.push(point);
}
return points;
}
moveChess(runNum) {
return new Promise((resolve, reject) => {
this.runNum = runNum;
if (this.turnRobot) {
let points = this.getMovePoints(this.robotPoint, runNum);
console.log(points);
this.chessRobot.getComponent("chess").run(points).then(() => {
this.robotPoint += (points.length - 1);
resolve('');
})
} else {
let points = this.getMovePoints(this.playerPoint, runNum);
console.log(points);
this.chessPlayer.getComponent("chess").run(points).then(() => {
this.playerPoint += (points.length - 1);
resolve('');
})
}
});
} }
jumpChess(cell, jumpId) {
return new Promise((resolve, reject) => {
let jumpCell = map[jumpId - 1];
let points = [cell, jumpCell];
if (this.turnRobot) {
this.chessRobot.getComponent("chess").run(points).then(() => {
this.robotPoint = Number(jumpCell.id) - 1;
resolve('');
})
} else {
this.chessPlayer.getComponent("chess").run(points).then(() => {
this.playerPoint = Number(jumpCell.id) - 1;
resolve('');
})
}
});
}
private runNum: number;
checkCell() {
if (this.turnRobot) {
let cell = map[this.robotPoint];
let val = cell.value;
let type = Number(cell.type);
switch (type) {
case CELLTYPE.MOVE_ADD:
this.moveChess(Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.ROLL_AGAIN:
this.turnRobot = !this.turnRobot;
this.turnNext();
break;
case CELLTYPE.JUMP_ROLL:
this.jumpChess(cell, Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.WIN:
this.gameOver();
break;
default:
this.turnNext();
break;
}
return
}
this.scheduleOnce(() => {
let cell = map[this.playerPoint];
let val = cell.value;
let type = Number(cell.type);
switch (type) {
case CELLTYPE.SPEAK:
pg.event.emit("speak_open", cell)
break;
case CELLTYPE.DELAY_TIME:
this.scheduleOnce(this.turnNext, 5);
break;
case CELLTYPE.MOVE_ADD:
this.moveChess(Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.ROLL_AGAIN:
this.turnRobot = !this.turnRobot;
this.turnNext();
break;
case CELLTYPE.JUMP_ROLL:
this.jumpChess(cell, Number(val)).then(() => {
this.checkCell();
})
break;
case CELLTYPE.WIN:
this.gameOver();
break;
default:
this.turnNext();
break;
}
}, 0.1)
}
//-----------------------------TOUZI-------------------------------
initTouzi() {
let touzi_ani = pg.view.find(this, "touzi_ani");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.touchOn(btn_stop, this.onTouchStop, this);
}
onTouchStop() {
if (this.turnRobot) return;
this.stopTouzi();
}
lastPointId: number;
stopTouzi() {
pg.audio.stopAudio(this.touziAudio);
let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(btn_stop, false);
this.lastPointId = this.playerPoint + 1;
let runNum = 1;
let rand = Math.random();
if (this.turnRobot) {
//确认当前机器人是哪个级别,然后再对应级别进行抽奖
runNum = 1 + Math.floor(rand * (6 - (this.robotLevel * 1.3)));
} else {
runNum = 1 + Math.floor(rand * 6);
}
pg.view.visible(hand, false);
this.unschedule(this.handVisible);
touzi.stopAni(runNum).then(() => {
pg.view.visible(touzi_ani, false);
pg.event.emit("player_point_update", { isRobot: this.turnRobot, num: runNum });
this.moveChess(runNum).then(() => {
this.checkCell();
})
})
}
private touziAudio: number;
startTouzi() {
this.log("test startTouzi")
let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi");
let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(touzi_ani, true);
touzi.startAni();
if (this.turnRobot) {
this.scheduleOnce(this.stopTouzi, 1);
} else {
pg.view.visible(btn_stop, true);
this.scheduleOnce(this.handVisible, 5);
}
pg.hw.playLocalAudio("touzi", true).then((id: number) => {
this.touziAudio = id;
})
}
handVisible() {
let touzi_ani = pg.view.find(this, "touzi_ani");
let hand = pg.view.find(touzi_ani, "hand");
pg.view.visible(hand, true);
}
//----------------------------OVER------------------- //----------------------------OVER-------------------
gameOver() { gameOver() {
let state = pg.view.find(this, "state"); let state = pg.view.find(this, "state");
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import pg from "./pg";
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
private mask: cc.Node;
private penguin: cc.Node;
private penguin_1: cc.Node;
private penguin_2: cc.Node;
private panel_text: cc.Node;
private txt: cc.Node;
onLoad() {
this.mask = pg.view.find(this, "mask");
this.penguin = pg.view.find(this.mask, "penguin");
this.penguin_1 = pg.view.find(this.penguin, "penguin_1");
this.penguin_2 = pg.view.find(this.penguin, "penguin_2");
this.panel_text = pg.view.find(this.penguin, "panel_text");
this.txt = pg.view.find(this.panel_text, "txt");
}
start() {
let data = {
text: "info"
}
this.showAni(data);
}
showAni(data) {
this.penguin.y = -100;
this.panel_text.opacity = 0;
pg.view.setString(this.txt, data.text);
pg.view.visible(this.panel_text, true);
cc.tween(this.penguin).to(0.4, { y: 190 }).delay(1).to(0.4, { y: -100 }).delay(0.1).call(() => {
this.node.parent = null;
}).start();
cc.tween(this.panel_text).to(0.2, { opacity: 255 }).delay(1.4).to(0.2, { opacity: 0 }).start();
}
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "7370c8bc-0e6d-4db0-84b1-3d09cb494848", "uuid": "4c474f91-db08-4d41-af13-c776c7ae74a8",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import pg from "./pg";
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Node)
layout_up: cc.Node = null;
@property(cc.Node)
layout_down: cc.Node = null;
@property(cc.Node)
item: cc.Node = null;
onLoad() {
//开始一个循环定期每过一段时间激活一个
pg.event.on("game_start_loop", () => { this.startLoop() })
}
protected onDestroy(): void {
pg.event.off("game_start_loop");
}
start() {
}
startLoop() {
this.schedule(this.createItem, 1);
}
pauseLoop() {
}
stopLoop() {
}
private lastId: number;
createItem() {
console.log("createItem");
let posList = [
cc.v2(-640, -13),
cc.v2(-220, -13),
cc.v2(220, -13),
cc.v2(640, -13),
cc.v2(-640, -280),
cc.v2(-220, -280),
cc.v2(220, -280),
cc.v2(640, -280)
];
let id = Math.floor(Math.random() * posList.length);
while (id == this.lastId) {
id = Math.floor(Math.random() * posList.length);
}
this.lastId = id;
let layout = id <= 3 ? this.layout_up : this.layout_down;
let pos = posList[id];
let item = pg.view.clone(this.item);
item.x = pos.x;
item.y = pos.y;
layout.addChild(item);
}
update(dt) {
}
}
{
"ver": "1.0.8",
"uuid": "32975267-15ec-4196-84fa-2a9ccc230646",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
export default [
{ "id": "1", "yellow_x": "-480", "yellow_y": "70", "blue_x": "-345", "blue_y": "70", "type": "0", "value": "0" }, { "id": "2", "yellow_x": "-480", "yellow_y": "290", "blue_x": "-345", "blue_y": "135", "type": "1", "value": "blackboard" }, { "id": "3", "yellow_x": "-270", "yellow_y": "290", "blue_x": "-270", "blue_y": "135", "type": "1", "value": "window" }, { "id": "4", "yellow_x": "-130", "yellow_y": "290", "blue_x": "-130", "blue_y": "135", "type": "1", "value": "door" }, { "id": "5", "yellow_x": "-10", "yellow_y": "290", "blue_x": "-10", "blue_y": "135", "type": "2", "value": "2" }, { "id": "6", "yellow_x": "150", "yellow_y": "290", "blue_x": "150", "blue_y": "135", "type": "1", "value": "window" }, { "id": "7", "yellow_x": "300", "yellow_y": "290", "blue_x": "300", "blue_y": "135", "type": "5", "value": "14" }, { "id": "8", "yellow_x": "500", "yellow_y": "290", "blue_x": "370", "blue_y": "135", "type": "1", "value": "door" }, { "id": "9", "yellow_x": "500", "yellow_y": "70", "blue_x": "370", "blue_y": "70", "type": "3", "value": "1" }, { "id": "10", "yellow_x": "500", "yellow_y": "-70", "blue_x": "370", "blue_y": "-70", "type": "1", "value": "door" }, { "id": "11", "yellow_x": "500", "yellow_y": "-280", "blue_x": "370", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "12", "yellow_x": "290", "yellow_y": "-280", "blue_x": "290", "blue_y": "-125", "type": "1", "value": "window" }, { "id": "13", "yellow_x": "150", "yellow_y": "-280", "blue_x": "150", "blue_y": "-125", "type": "2", "value": "3" }, { "id": "14", "yellow_x": "10", "yellow_y": "-280", "blue_x": "10", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "15", "yellow_x": "-130", "yellow_y": "-280", "blue_x": "-130", "blue_y": "-125", "type": "2", "value": "1" }, { "id": "16", "yellow_x": "-270", "yellow_y": "-280", "blue_x": "-270", "blue_y": "-125", "type": "1", "value": "window" }, { "id": "17", "yellow_x": "-410", "yellow_y": "-280", "blue_x": "-410", "blue_y": "-125", "type": "4", "value": "5" }, { "id": "18", "yellow_x": "-550", "yellow_y": "-280", "blue_x": "-550", "blue_y": "-125", "type": "1", "value": "door" }, { "id": "19", "yellow_x": "-775", "yellow_y": "-280", "blue_x": "-600", "blue_y": "-125", "type": "1", "value": "blackboard" }, { "id": "20", "yellow_x": "-775", "yellow_y": "-55", "blue_x": "-600", "blue_y": "-55", "type": "1", "value": "window" }, { "id": "21", "yellow_x": "-775", "yellow_y": "80", "blue_x": "-600", "blue_y": "80", "type": "4", "value": "5" }, { "id": "22", "yellow_x": "-775", "yellow_y": "220", "blue_x": "-600", "blue_y": "220", "type": "2", "value": "3" }, { "id": "23", "yellow_x": "-775", "yellow_y": "365", "blue_x": "-600", "blue_y": "365", "type": "1", "value": "door" }, { "id": "24", "yellow_x": "-775", "yellow_y": "550", "blue_x": "-600", "blue_y": "420", "type": "2", "value": "5" }, { "id": "25", "yellow_x": "-550", "yellow_y": "550", "blue_x": "-550", "blue_y": "420", "type": "1", "value": "window" }, { "id": "26", "yellow_x": "-410", "yellow_y": "550", "blue_x": "-410", "blue_y": "420", "type": "4", "value": "5" }, { "id": "27", "yellow_x": "-270", "yellow_y": "550", "blue_x": "-270", "blue_y": "420", "type": "2", "value": "2" }, { "id": "28", "yellow_x": "-130", "yellow_y": "550", "blue_x": "-130", "blue_y": "420", "type": "1", "value": "door" }, { "id": "29", "yellow_x": "10", "yellow_y": "550", "blue_x": "10", "blue_y": "420", "type": "1", "value": "blackboard" }, { "id": "30", "yellow_x": "150", "yellow_y": "550", "blue_x": "150", "blue_y": "420", "type": "3", "value": "1" }, { "id": "31", "yellow_x": "290", "yellow_y": "550", "blue_x": "290", "blue_y": "420", "type": "1", "value": "window" }, { "id": "32", "yellow_x": "430", "yellow_y": "550", "blue_x": "430", "blue_y": "420", "type": "2", "value": "1" }, { "id": "33", "yellow_x": "570", "yellow_y": "550", "blue_x": "570", "blue_y": "420", "type": "4", "value": "5" }, { "id": "34", "yellow_x": "790", "yellow_y": "550", "blue_x": "630", "blue_y": "420", "type": "1", "value": "blackboard" }, { "id": "35", "yellow_x": "790", "yellow_y": "360", "blue_x": "630", "blue_y": "360", "type": "1", "value": "door" }, { "id": "36", "yellow_x": "790", "yellow_y": "215", "blue_x": "630", "blue_y": "215", "type": "2", "value": "3" }, { "id": "37", "yellow_x": "790", "yellow_y": "70", "blue_x": "630", "blue_y": "70", "type": "5", "value": "43" }, { "id": "38", "yellow_x": "790", "yellow_y": "-75", "blue_x": "630", "blue_y": "-75", "type": "3", "value": "1" }, { "id": "39", "yellow_x": "790", "yellow_y": "-220", "blue_x": "630", "blue_y": "-220", "type": "1", "value": "window" }, { "id": "40", "yellow_x": "790", "yellow_y": "-365", "blue_x": "630", "blue_y": "-365", "type": "2", "value": "1" }, { "id": "41", "yellow_x": "790", "yellow_y": "-550", "blue_x": "630", "blue_y": "-405", "type": "1", "value": "blackboard" }, { "id": "42", "yellow_x": "570", "yellow_y": "-550", "blue_x": "570", "blue_y": "-405", "type": "1", "value": "window" }, { "id": "43", "yellow_x": "430", "yellow_y": "-550", "blue_x": "430", "blue_y": "-405", "type": "2", "value": "2" }, { "id": "44", "yellow_x": "290", "yellow_y": "-550", "blue_x": "290", "blue_y": "-405", "type": "1", "value": "door" }, { "id": "45", "yellow_x": "150", "yellow_y": "-550", "blue_x": "150", "blue_y": "-405", "type": "4", "value": "5" }, { "id": "46", "yellow_x": "10", "yellow_y": "-550", "blue_x": "10", "blue_y": "-405", "type": "1", "value": "blackboard" }, { "id": "47", "yellow_x": "-130", "yellow_y": "-550", "blue_x": "-130", "blue_y": "-405", "type": "1", "value": "window" }, { "id": "48", "yellow_x": "-270", "yellow_y": "-550", "blue_x": "-270", "blue_y": "-405", "type": "1", "value": "door" }, { "id": "49", "yellow_x": "-410", "yellow_y": "-550", "blue_x": "-410", "blue_y": "-405", "type": "2", "value": "2" }, { "id": "50", "yellow_x": "-550", "yellow_y": "-550", "blue_x": "-550", "blue_y": "-405", "type": "1", "value": "blackboard" },
{ "id": "51", "yellow_x": "-690", "yellow_y": "-490", "blue_x": "-690", "blue_y": "-490", "type": "100", "value": "0" }
]
\ No newline at end of file
...@@ -435,6 +435,7 @@ let pg = { ...@@ -435,6 +435,7 @@ let pg = {
}, },
hw: { hw: {
playLocalAudio(audioName, loop = false) { playLocalAudio(audioName, loop = false) {
console.log("play audio->" + 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) => {
const id = cc.audioEngine.playEffect(audio.clip, loop); const id = cc.audioEngine.playEffect(audio.clip, loop);
......
...@@ -19,21 +19,18 @@ export default class NewClass extends cc.Component { ...@@ -19,21 +19,18 @@ export default class NewClass extends cc.Component {
text: string = 'hello'; text: string = 'hello';
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
private text_tip: cc.Node;
private btn_audio_start: cc.Node; private btn_audio_start: cc.Node;
private btn_audio_stop: cc.Node; private btn_audio_stop: cc.Node;
private speak_ske: cc.Node; private speak_ske: cc.Node;
private bg_goodjob: cc.Node; private bg_goodjob: cc.Node;
private bg_tryagain: cc.Node; private bg_tryagain: cc.Node;
onLoad() { onLoad() {
this.text_tip = pg.view.find(this, "text_tip");
this.btn_audio_start = pg.view.find(this, "btn_audio_start"); this.btn_audio_start = pg.view.find(this, "btn_audio_start");
this.btn_audio_stop = pg.view.find(this, "btn_audio_stop"); this.btn_audio_stop = pg.view.find(this, "btn_audio_stop");
this.speak_ske = pg.view.find(this, "speak_ske"); this.speak_ske = pg.view.find(this, "speak_ske");
this.bg_goodjob = pg.view.find(this, "bg_goodjob"); this.bg_goodjob = pg.view.find(this, "bg_goodjob");
this.bg_tryagain = pg.view.find(this, "bg_tryagain"); this.bg_tryagain = pg.view.find(this, "bg_tryagain");
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false); pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false); pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false); pg.view.visible(this.speak_ske, false);
...@@ -62,7 +59,6 @@ export default class NewClass extends cc.Component { ...@@ -62,7 +59,6 @@ export default class NewClass extends cc.Component {
if (cell) { if (cell) {
this.val = cell.value; this.val = cell.value;
} }
pg.view.visible(this.text_tip, true);
pg.view.visible(this.btn_audio_start, true); pg.view.visible(this.btn_audio_start, true);
pg.view.visible(this.btn_audio_stop, false); pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, true); pg.view.visible(this.speak_ske, true);
...@@ -70,7 +66,6 @@ export default class NewClass extends cc.Component { ...@@ -70,7 +66,6 @@ export default class NewClass extends cc.Component {
pg.view.visible(this.bg_tryagain, false); pg.view.visible(this.bg_tryagain, false);
} }
close() { close() {
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false); pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false); pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false); pg.view.visible(this.speak_ske, false);
...@@ -125,7 +120,6 @@ export default class NewClass extends cc.Component { ...@@ -125,7 +120,6 @@ export default class NewClass extends cc.Component {
onRealStop(score) { onRealStop(score) {
let db = pg.view.playDBAnimation(this.speak_ske, "newAnimation", 1); let db = pg.view.playDBAnimation(this.speak_ske, "newAnimation", 1);
db.once(dragonBones.EventObject.COMPLETE, () => { db.once(dragonBones.EventObject.COMPLETE, () => {
pg.view.visible(this.text_tip, false);
pg.view.visible(this.btn_audio_start, false); pg.view.visible(this.btn_audio_start, false);
pg.view.visible(this.btn_audio_stop, false); pg.view.visible(this.btn_audio_stop, false);
pg.view.visible(this.speak_ske, false); pg.view.visible(this.speak_ske, false);
......
...@@ -4,15 +4,6 @@ const { ccclass, property } = cc._decorator; ...@@ -4,15 +4,6 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class NewClass extends cc.Component { export default class NewClass extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
// LIFE-CYCLE CALLBACKS:
onLoad() { onLoad() {
this.initView(); this.initView();
let panel_gray = pg.view.find(this, "panel_gray"); let panel_gray = pg.view.find(this, "panel_gray");
......
export const defaultData = { export default {
"list": "list":
[ [
{ {
"id": 0, "id": 0,
"stem": { "times": 5 }, "stem": {
"list": [{ "id": 2001, "text": "door", "pic": "", "type": "text", "right": "1" }, { "id": 2002, "text": "ijfs", "pic": "", "type": "text", "right": "1" }, { "id": 2003, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/d0414e91f8519ece2909b15cedf23f08.png", "type": "pic", "right": "0" }, { "id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/ae28013163687fee4124a85261a7b48f.png", "type": "pic", "right": "0" }] "times": 5
},
"list": [
{
"id": 2001, "text": "door", "pic": "", "type": "text", "right": "1"
},
{
"id": 2002, "text": "ijfs", "pic": "", "type": "text", "right": "1"
},
{
"id": 2003, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/d0414e91f8519ece2909b15cedf23f08.png", "type": "pic", "right": "0"
},
{
"id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/ae28013163687fee4124a85261a7b48f.png", "type": "pic", "right": "0"
}
]
}, },
{ {
"id": 1, "id": 1,
"stem": { "times": 4 }, "stem": {
"times": 4
},
"list": "list":
[ [
{ {
"id": 2001, "text": "window", "pic": "", "type": "text", "right": "1" "id": 2001, "text": "window", "pic": "", "type": "text", "right": "1"
}, { },
{
"id": 2002, "text": "winxa", "pic": "", "type": "text", "right": "0" "id": 2002, "text": "winxa", "pic": "", "type": "text", "right": "0"
}, { },
{
"id": 2003, "text": "indowa", "pic": "", "type": "text", "right": "0" "id": 2003, "text": "indowa", "pic": "", "type": "text", "right": "0"
}, { },
{
"id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/444d37818d6075febadc6052af5f995b.png", "type": "pic", "right": "0" "id": 2004, "text": "", "pic": "http://staging-teach.cdn.ireadabc.com/444d37818d6075febadc6052af5f995b.png", "type": "pic", "right": "0"
} }
] ]
......
{
"ver": "1.1.2",
"uuid": "d96529a1-229d-4fd6-97c1-577e7c50e320",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "97dda2de-75b3-400e-baa2-d6ce064b3370",
"downloadMode": 0,
"duration": 0.182857,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "fd0c5f31-3d26-41d2-b9ed-08902b3dd3a4",
"downloadMode": 0,
"duration": 0.261224,
"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