Commit 370bdbb3 authored by 杨一航's avatar 杨一航

feat: v1.0

parent 6d3a6cc0
No preview for this file type
{
"ver": "1.1.2",
"uuid": "256d6e76-c3de-4c04-b5c1-f895655d1c4d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "9645339d-afdd-4aa3-af16-149965454ccc",
"subMetas": {}
}
\ No newline at end of file
{"name":"right","imagePath":"right_tex.png","height":512,"SubTexture":[{"name":"正确/圆圈","x":1,"height":273,"y":1,"width":273},{"name":"正确/光线1","x":426,"height":148,"y":151,"width":10},{"name":"正确/光线2","x":276,"height":10,"y":52,"width":148},{"name":"正确/光线3","x":276,"height":10,"y":64,"width":148},{"name":"正确/光线4","x":426,"height":148,"y":1,"width":10},{"name":"正确/圆","x":380,"height":29,"y":1,"width":29},{"name":"正确/圆2","x":438,"height":29,"y":1,"width":29},{"name":"正确/圆3","x":438,"height":29,"y":32,"width":29},{"name":"正确/圆4","x":469,"height":29,"y":1,"width":29},{"name":"正确/星2","x":276,"height":49,"y":1,"width":50},{"name":"正确/星1","x":328,"height":49,"y":1,"width":50}],"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f1f76cf3-b00a-4ef3-b106-5696fcb531e4",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "dfc709a0-30d1-42e6-a222-d83c121b2f02",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"right_tex": {
"ver": "1.0.4",
"uuid": "f7208b7a-7366-4167-b92d-d6dd00ea29c2",
"rawTextureUuid": "dfc709a0-30d1-42e6-a222-d83c121b2f02",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -6.5,
"offsetY": 106,
"trimX": 1,
"trimY": 1,
"width": 497,
"height": 298,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "d982949c-bff2-4ae3-b847-9ba05ddd961a", "uuid": "778980f2-cd44-46ab-907a-c21fcf977d35",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.888163, "duration": 3.761633,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "c893db8b-68b6-4f1a-a35a-983fb376ece7", "uuid": "be8ef69b-2de3-456d-9845-9349a342b8c5",
"downloadMode": 0, "downloadMode": 0,
"duration": 3.343673, "duration": 0.835918,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "cc6df8ec-94fa-43c7-99cf-3e6ca74283eb", "uuid": "6b77ecb2-9347-4ba8-a481-d137abc6137b",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.45102, "duration": 0.219333,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "beb9ebd0-f1eb-462f-a629-f8de8c06dc7a", "uuid": "1f80e119-e5cc-4d3d-ae2a-39f72c6cad7e",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.873878, "duration": 3.787755,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "095ead76-b9b5-47ef-b562-3eb09bd10b31",
"downloadMode": 0,
"duration": 1.808583,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "960d26f9-04da-46ee-af9c-a90dd0d0407b",
"downloadMode": 0,
"duration": 0.697429,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "2634b981-e21c-4670-ba5f-096b815eb072",
"downloadMode": 0,
"duration": 0.636667,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "5eefde91-544f-4097-a088-5d1c218e0a2f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -85,11 +85,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -85,11 +85,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.data.url = this.data.url || this.headUrl; this.data.url = this.data.url || this.headUrl;
this.data.name = this.data.name || this.userName; this.data.name = this.data.name || this.userName;
this.rankData = this.data.rank; this.rankData = this.data.rank;
let localScore = cc.sys.localStorage.getItem("mySocre");
cc.log("localScore = " + localScore)
this.data.myInfo.score = localScore || this.data.myInfo.score;
cc.sys.localStorage.setItem("mySocre", this.data.myInfo.score);
this.rankData.sort((a, b) => { this.rankData.sort((a, b) => {
return b.score - a.score; return b.score - a.score;
}) })
} }
initView() { initView() {
const bgNode = cc.find('Canvas/bg'); const bgNode = cc.find('Canvas/bg');
...@@ -192,11 +195,13 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -192,11 +195,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
showRank() { showRank() {
this.playLocalAudio("btn")
this.myInfoCom.openMask(); this.myInfoCom.openMask();
this.rankLayer.active = true; this.rankLayer.active = true;
this.rankLayerCom.show(); this.rankLayerCom.show();
} }
hideRank() { hideRank() {
this.playLocalAudio("btn")
this.myInfoCom.hideMask(); this.myInfoCom.hideMask();
} }
...@@ -382,8 +387,14 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -382,8 +387,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.gameLayerCom.settle(item.data) this.gameLayerCom.settle(item.data)
} else if (item.data.type == "SERVER_gameSettleEnd") { } else if (item.data.type == "SERVER_gameSettleEnd") {
this.gameLayerCom.hide()
let localScore = cc.sys.localStorage.getItem("mySocre");
this.data.myInfo.score = localScore || this.data.myInfo.score;
cc.sys.localStorage.setItem("mySocre", this.data.myInfo.score);
this.data.myInfo.rank = this.rankLayerCom.setMyInfo(this.data.myInfo)
this.gameLayerCom.hide()
this.myInfoCom.init(this.data.myInfo); this.myInfoCom.init(this.data.myInfo);
this.myInfoCom.show(); this.myInfoCom.show();
this.endLayer.active = true; this.endLayer.active = true;
......
...@@ -50,6 +50,7 @@ export class GameServer { ...@@ -50,6 +50,7 @@ export class GameServer {
matchLv: any; matchLv: any;
answerCount: number; answerCount: number;
settleTimer: number; settleTimer: number;
startTime: number;
constructor(playerMaxNumber, networkHelper) { constructor(playerMaxNumber, networkHelper) {
this.playerMaxNumber = playerMaxNumber; this.playerMaxNumber = playerMaxNumber;
...@@ -98,7 +99,9 @@ export class GameServer { ...@@ -98,7 +99,9 @@ export class GameServer {
index: 0, index: 0,
blueRight: 0, blueRight: 0,
redRight: 0, redRight: 0,
total: 0 total: 0,
addRedScore: 0,
addBlueScore: 0,
}; };
startGame() { startGame() {
...@@ -196,6 +199,8 @@ export class GameServer { ...@@ -196,6 +199,8 @@ export class GameServer {
this.prepareNum = 0 this.prepareNum = 0
this.gameStatus.index = 0; this.gameStatus.index = 0;
this.gameStatus.state = 1; this.gameStatus.state = 1;
this.gameStatus.addBlueScore = 0;
this.gameStatus.addRedScore = 0;
this.answerIndex = 0; this.answerIndex = 0;
this.answerCount = 0; this.answerCount = 0;
this.answerData = []; this.answerData = [];
...@@ -222,8 +227,12 @@ export class GameServer { ...@@ -222,8 +227,12 @@ export class GameServer {
if (quetion.rightIndex == data.index) { if (quetion.rightIndex == data.index) {
if (sender.color == "Red") { if (sender.color == "Red") {
this.gameStatus.redRight += 1; this.gameStatus.redRight += 1;
this.gameStatus.addRedScore = 10 - Math.floor((Date.now() - this.startTime) / 1000);
this.gameStatus.addRedScore = Math.max(0, this.gameStatus.addRedScore)
} else { } else {
this.gameStatus.blueRight += 1; this.gameStatus.blueRight += 1;
this.gameStatus.addBlueScore = 10 - Math.floor((Date.now() - this.startTime) / 1000);
this.gameStatus.addBlueScore = Math.max(0, this.gameStatus.addBlueScore)
} }
} }
...@@ -252,6 +261,8 @@ export class GameServer { ...@@ -252,6 +261,8 @@ export class GameServer {
this.prepareNum = 0 this.prepareNum = 0
this.answerIndex++; this.answerIndex++;
this.gameStatus.state = 1; this.gameStatus.state = 1;
this.gameStatus.addBlueScore = 0;
this.gameStatus.addRedScore = 0;
this.gameStatus.index = this.answerIndex; this.gameStatus.index = this.answerIndex;
this.answerCount = 0; this.answerCount = 0;
this.answerData = []; this.answerData = [];
...@@ -283,7 +294,7 @@ export class GameServer { ...@@ -283,7 +294,7 @@ export class GameServer {
countToSettle(time) { countToSettle(time) {
this.startTime = Date.now();
clearTimeout(this.settleTimer) clearTimeout(this.settleTimer)
this.settleTimer = setTimeout(async () => { this.settleTimer = setTimeout(async () => {
...@@ -315,6 +326,8 @@ export class GameServer { ...@@ -315,6 +326,8 @@ export class GameServer {
this.prepareNum = 0 this.prepareNum = 0
this.answerIndex++; this.answerIndex++;
this.gameStatus.state = 1; this.gameStatus.state = 1;
this.gameStatus.addBlueScore = 0;
this.gameStatus.addRedScore = 0;
this.gameStatus.index = this.answerIndex; this.gameStatus.index = this.answerIndex;
this.answerCount = 0; this.answerCount = 0;
this.answerData = []; this.answerData = [];
......
export const defaultData = { export const defaultData = {
"myInfo": { "myInfo": {
"lv": 0, "lv": 0,
"score": 1666, "score": 1001,
"rank": -1, "rank": -1,
"url": "http://staging-teach.cdn.ireadabc.com/0751c28419a0e8ffb1f0e84435b081ce.png", "url": "http://staging-teach.cdn.ireadabc.com/0751c28419a0e8ffb1f0e84435b081ce.png",
"name": "test" "name": "好奇宝宝7"
}, },
"question": [ "question": [
{ {
......
...@@ -30,7 +30,7 @@ export default class Cup extends cc.Component { ...@@ -30,7 +30,7 @@ export default class Cup extends cc.Component {
// onLoad () {} // onLoad () {}
init(score) { init(score, autoAni?) {
let lv = getLv(score); let lv = getLv(score);
let minlv = getMinLv(score); let minlv = getMinLv(score);
...@@ -40,6 +40,12 @@ export default class Cup extends cc.Component { ...@@ -40,6 +40,12 @@ export default class Cup extends cc.Component {
this.lvIcon.spriteFrame = this.lvIconList[lv]; this.lvIcon.spriteFrame = this.lvIconList[lv];
this.lb_minlv.string = ["I", "II", "III", "IV", "V"][minlv]; this.lb_minlv.string = ["I", "II", "III", "IV", "V"][minlv];
if (autoAni) {
cc.tween(this.icon.node).by(1, { y: 20 }, { easing: "sineOut" }).delay(0.15).by(1, { y: -20 }, { easing: "sineOut" }).delay(0.15).union().repeatForever().start()
}
} }
// update (dt) {} // update (dt) {}
......
...@@ -17,10 +17,17 @@ export default class EndLayer extends cc.Component { ...@@ -17,10 +17,17 @@ export default class EndLayer extends cc.Component {
@property(cc.Node) @property(cc.Node)
loseRoot: cc.Node = null; loseRoot: cc.Node = null;
@property(cc.Node)
winGold: cc.Node = null;
@property(cc.Node)
loseGold: cc.Node = null;
@property(cc.Node)
originNode: cc.Node = null;
@property(cc.Button) @property(cc.Button)
btn_restart: cc.Button = null; btn_restart: cc.Button = null;
@property(cc.Node) @property(cc.Node)
blueHead: cc.Node = null; blueHead: cc.Node = null;
@property(cc.Label) @property(cc.Label)
...@@ -35,14 +42,22 @@ export default class EndLayer extends cc.Component { ...@@ -35,14 +42,22 @@ export default class EndLayer extends cc.Component {
@property(cc.Label) @property(cc.Label)
redName: cc.Label = null; redName: cc.Label = null;
mainCom: any; mainCom: any;
endpos: cc.Vec3;
onLoad() { onLoad() {
this.winGold.active = false;
this.loseGold.active = false;
this.endpos = this.winGold.position;
this.btn_restart.node.on("click", this.onClickRestart, this) this.btn_restart.node.on("click", this.onClickRestart, this)
cc.tween(this.btn_restart.node).to(0.3, { scale: 1.1 }).to(0.2, { scale: 1 }).delay(1).union().repeatForever().start();
this.btn_restart.node.opacity = 0;
} }
bind
onClickRestart() { onClickRestart() {
this.mainCom.backHome(); this.mainCom.backHome();
...@@ -52,14 +67,37 @@ export default class EndLayer extends cc.Component { ...@@ -52,14 +67,37 @@ export default class EndLayer extends cc.Component {
this.loseRoot.active = false; this.loseRoot.active = false;
this.winRoot.active = false; this.winRoot.active = false;
this.winGold.active = false;
this.loseGold.active = false;
let root = this.loseRoot; let root = this.loseRoot;
let golden = this.loseGold;
if (data.status.blueRight >= data.status.redRight) { if (data.status.blueRight >= data.status.redRight) {
root = this.winRoot; root = this.winRoot;
golden = this.winGold;
this.mainCom.playLocalAudio("win")
} else {
this.mainCom.playLocalAudio("lose")
} }
golden.active = true;
golden.x = this.originNode.x;
golden.y = this.originNode.y;
golden.scale = this.originNode.scale;
root.active = true; root.active = true;
root.opacity = 0; root.opacity = 0;
cc.tween(root).delay(0.45).to(1, { opacity: 255 }).start(); cc.tween(root).delay(0.2).to(1, { opacity: 255 }).call(() => {
this.btn_restart.node.opacity = 255;
}).start();
cc.tween(golden).to(0.5, { x: this.endpos.x, y: this.endpos.y, scale: 1 }, { easing: "sineOut" }).start()
let icon = root.getChildByName("icon")
icon.opacity = 0;
icon.y += 30
cc.tween(icon).delay(0.5).by(0.3, { y: -30, opacity: 255 }, { easing: "sinInOut" }).start()
this.blueHead.getComponent(Player).init(mydata.url); this.blueHead.getComponent(Player).init(mydata.url);
this.blueName.string = mydata.name; this.blueName.string = mydata.name;
......
...@@ -24,8 +24,7 @@ export default class GameLayer extends cc.Component { ...@@ -24,8 +24,7 @@ export default class GameLayer extends cc.Component {
blueBar: cc.Node = null; blueBar: cc.Node = null;
@property(cc.Node) @property(cc.Node)
redBar: cc.Node = null; redBar: cc.Node = null;
@property(cc.Node)
vsNode: cc.Node = null;
@property(cc.Node) @property(cc.Node)
blueHead: cc.Node = null; blueHead: cc.Node = null;
@property(cc.Node) @property(cc.Node)
...@@ -66,8 +65,6 @@ export default class GameLayer extends cc.Component { ...@@ -66,8 +65,6 @@ export default class GameLayer extends cc.Component {
@property(cc.Node) @property(cc.Node)
cupStart: cc.Node = null; cupStart: cc.Node = null;
@property(cc.Node)
cupEnd: cc.Node = null;
@property(cc.Node) @property(cc.Node)
picRoot: cc.Node = null; picRoot: cc.Node = null;
...@@ -95,7 +92,10 @@ export default class GameLayer extends cc.Component { ...@@ -95,7 +92,10 @@ export default class GameLayer extends cc.Component {
this.questionBar.active = false; this.questionBar.active = false;
this.txtRoot.active = false; this.txtRoot.active = false;
this.cupEnd.active = false; this.timeprobar.progress = 1
this.questionTime.string = "10";
this.picRoot.active = false; this.picRoot.active = false;
this.cupStart.active = true; this.cupStart.active = true;
...@@ -125,6 +125,10 @@ export default class GameLayer extends cc.Component { ...@@ -125,6 +125,10 @@ export default class GameLayer extends cc.Component {
async initQuestion(question, index) { async initQuestion(question, index) {
this.totaltime = -1;
this.countTime = 0;
this.rootCover.active = false; this.rootCover.active = false;
this.questionBar.active = false; this.questionBar.active = false;
...@@ -135,13 +139,18 @@ export default class GameLayer extends cc.Component { ...@@ -135,13 +139,18 @@ export default class GameLayer extends cc.Component {
this.lb_tips.string = `第${index + 1}题` this.lb_tips.string = `第${index + 1}题`
this.lb_tips.node.active = true; this.lb_tips.node.active = true;
cc.tween(this.lb_tips.node).delay(0.5).by(0.5, { y: -50, opacity: -255, scale: -0.5 }, { easing: "sineOut" }).call(() => {
this.lb_tips.node.active = false;
this.lb_tips.node.opacity = 255;
this.lb_tips.node.scale = 1;
this.lb_tips.node.y += 50;
}).start()
await asyncDelay(1); await asyncDelay(1);
this.rootCover.active = false; this.rootCover.active = false;
this.totaltime = 10.2;
this.countTime = 0;
this.questionBar.active = true; this.questionBar.active = true;
this.lb_tips.node.active = false;
this.lb_info.string = question.info; this.lb_info.string = question.info;
...@@ -150,9 +159,16 @@ export default class GameLayer extends cc.Component { ...@@ -150,9 +159,16 @@ export default class GameLayer extends cc.Component {
this.picRoot.active = false; this.picRoot.active = false;
this.list = this.txtRoot.children; this.list = this.txtRoot.children;
for (let i = 0; i < this.list.length; ++i) { for (let i = 0; i < this.list.length; ++i) {
this.list[i].opacity = 0;
cc.tween(this.list[i]).delay(i * 0.1).to(0.2, { opacity: 255 }).start();
this.list[i].getComponent(TxtCell).init(i, ans[i], i == question.rightIndex, (index) => { this.list[i].getComponent(TxtCell).init(i, ans[i], i == question.rightIndex, (index) => {
this.mainCom.playLocalAudio("btn"); if (index == question.rightIndex) {
this.mainCom.playLocalAudio("right")
} else {
this.mainCom.playLocalAudio("wrong")
}
// this.mainCom.playLocalAudio("btn");
this.mainCom.networkHelper.sendFrame({ this.mainCom.networkHelper.sendFrame({
type: "anserQues", type: "anserQues",
uuid: this.mainCom.playerId, uuid: this.mainCom.playerId,
...@@ -164,14 +180,24 @@ export default class GameLayer extends cc.Component { ...@@ -164,14 +180,24 @@ export default class GameLayer extends cc.Component {
}) })
} }
} else { } else {
this.txtRoot.active = false; this.txtRoot.active = false;
this.picRoot.active = true; this.picRoot.active = true;
this.list = this.picRoot.children; this.list = this.picRoot.children;
for (let i = 0; i < this.list.length; ++i) { for (let i = 0; i < this.list.length; ++i) {
this.list[i].opacity = 0;
cc.tween(this.list[i]).delay(i * 0.1).to(0.2, { opacity: 255 }).start();
this.list[i].getComponent(PicCell).init(i, ans[i], i == question.rightIndex, (index) => { this.list[i].getComponent(PicCell).init(i, ans[i], i == question.rightIndex, (index) => {
this.mainCom.playLocalAudio("btn"); if (index == question.rightIndex) {
this.mainCom.playLocalAudio("right")
} else {
this.mainCom.playLocalAudio("wrong")
}
// this.mainCom.playLocalAudio("btn");
this.mainCom.networkHelper.sendFrame({ this.mainCom.networkHelper.sendFrame({
type: "anserQues", type: "anserQues",
uuid: this.mainCom.playerId, uuid: this.mainCom.playerId,
...@@ -183,6 +209,10 @@ export default class GameLayer extends cc.Component { ...@@ -183,6 +209,10 @@ export default class GameLayer extends cc.Component {
} }
} }
await asyncDelay(0.5);
this.totaltime = 10.2;
this.countTime = 0;
} }
async settle(data) { async settle(data) {
...@@ -200,6 +230,41 @@ export default class GameLayer extends cc.Component { ...@@ -200,6 +230,41 @@ export default class GameLayer extends cc.Component {
this.redprobar.progress = data.status.redRight / data.status.total; this.redprobar.progress = data.status.redRight / data.status.total;
this.blueprobar.progress = data.status.blueRight / data.status.total; this.blueprobar.progress = data.status.blueRight / data.status.total;
let addBlueScore = +data.status.addBlueScore;
let addRedScore = +data.status.addRedScore;
if (addBlueScore > 0) {
let bluescore = +this.blueScore.string;
this.blueScore.string = bluescore + data.status.addBlueScore;
cc.sys.localStorage.setItem("mySocre", +this.blueScore.string)
let lbnode = cc.instantiate(this.blueScore.node);
lbnode.parent = this.blueScore.node.parent;
lbnode.color = cc.Color.RED;
lbnode.getComponent(cc.Label).string = "+" + addBlueScore;
cc.tween(lbnode).by(1, { y: 100, opacity: -255 }, { easing: "sineOut" }).removeSelf().start();
}
if (addRedScore > 0) {
let redscore = +this.redScore.string;
this.redScore.string = redscore + data.status.addRedScore;
let lbnode = cc.instantiate(this.redScore.node);
lbnode.parent = this.redScore.node.parent;
lbnode.color = cc.Color.RED;
lbnode.getComponent(cc.Label).string = "+" + addRedScore;
this.mainCom.otherData.score = +this.redScore.string;
cc.tween(lbnode).by(1, { y: 100, opacity: -255 }, { easing: "sineOut" }).removeSelf().start();
}
await asyncDelay(1); await asyncDelay(1);
...@@ -217,21 +282,13 @@ export default class GameLayer extends cc.Component { ...@@ -217,21 +282,13 @@ export default class GameLayer extends cc.Component {
} }
hide() { hide() {
this.redprobar.progress = 0; this.redprobar.progress = 0;
this.blueprobar.progress = 0; this.blueprobar.progress = 0;
cc.tween(this.blueBar).to(0.35, { x: this.blueX - cc.winSize.width }, { easing: "sineIn" }).start() cc.tween(this.blueBar).to(0.35, { x: this.blueX - cc.winSize.width }, { easing: "sineIn" }).start()
cc.tween(this.redBar).to(0.35, { x: this.redX + cc.winSize.width }, { easing: "sineIn" }).start() cc.tween(this.redBar).to(0.35, { x: this.redX + cc.winSize.width }, { easing: "sineIn" }).call(() => {
cc.tween(this.cupStart).to(0.6, { x: this.cupEnd.x, y: this.cupEnd.y, scale: this.cupEnd.scale }).call(() => {
this.node.active = false; this.node.active = false;
}).start(); }).start()
} }
update(dt) { update(dt) {
...@@ -248,10 +305,14 @@ export default class GameLayer extends cc.Component { ...@@ -248,10 +305,14 @@ export default class GameLayer extends cc.Component {
this.questionTime.string = "" + Math.floor(this.totaltime - this.countTime) this.questionTime.string = "" + Math.floor(this.totaltime - this.countTime)
} else { } else {
this.totaltime = -1; this.totaltime = -1;
this.countTime = 0 this.countTime = 0
this.rootCover.active = true; this.rootCover.active = true;
} }
} else {
this.timeprobar.progress = 1
this.questionTime.string = "10";
} }
} }
} }
...@@ -17,15 +17,15 @@ export default class HomeLayer extends cc.Component { ...@@ -17,15 +17,15 @@ export default class HomeLayer extends cc.Component {
@property(cc.Label) @property(cc.Label)
lb_gold = null; lb_gold = null;
@property(cc.Label) @property(cc.Label)
lb_lv = null;
@property(cc.Label)
lb_award = null; lb_award = null;
@property(cc.Label) @property(cc.Label)
lb_cost = null; lb_cost = null;
_startCallBack: Function; _startCallBack: Function;
onLoad() { onLoad() {
this.btn_start.node.on("click", this.onClickStart, this) this.btn_start.node.on("click", this.onClickStart, this);
cc.tween(this.btn_start.node).to(0.3, { scale: 1.1 }).to(0.2, { scale: 1 }).delay(1).union().repeatForever().start();
} }
onClickStart() { onClickStart() {
...@@ -34,7 +34,7 @@ export default class HomeLayer extends cc.Component { ...@@ -34,7 +34,7 @@ export default class HomeLayer extends cc.Component {
} }
initCup(score) { initCup(score) {
this.node.getChildByName("cup").getComponent(Cup).init(score); this.node.getChildByName("cup").getComponent(Cup).init(score, true);
} }
set startCallBack(callback: Function) { set startCallBack(callback: Function) {
this._startCallBack = callback; this._startCallBack = callback;
......
...@@ -42,6 +42,9 @@ export default class MatchLayer extends cc.Component { ...@@ -42,6 +42,9 @@ export default class MatchLayer extends cc.Component {
@property(cc.Node) @property(cc.Node)
matchNode: cc.Node = null; matchNode: cc.Node = null;
@property(cc.Node)
matchAniNode: cc.Node = null;
@property(cc.Label) @property(cc.Label)
matchlb: cc.Label = null; matchlb: cc.Label = null;
...@@ -52,6 +55,8 @@ export default class MatchLayer extends cc.Component { ...@@ -52,6 +55,8 @@ export default class MatchLayer extends cc.Component {
onLoad() { onLoad() {
this.matchAniNode.active = false;
this.blueBar.active = false; this.blueBar.active = false;
this.redBar.active = false; this.redBar.active = false;
this.vsNode.active = false; this.vsNode.active = false;
...@@ -126,9 +131,12 @@ export default class MatchLayer extends cc.Component { ...@@ -126,9 +131,12 @@ export default class MatchLayer extends cc.Component {
this.vsNode.scale = 1.5; this.vsNode.scale = 1.5;
this.vsNode.opacity = 0; this.vsNode.opacity = 0;
this.matchAniNode.active = true;
cc.tween(this.vsNode).to(0.3, { opacity: 255, scale: 1 }).start(); cc.tween(this.vsNode).to(0.3, { opacity: 255, scale: 1 }).start();
await asyncDelay(0.6); await asyncDelay(0.6);
this.matchAniNode.active = false;
cc.tween(this.vsNode).to(0.1, { opacity: 0 }).start(); cc.tween(this.vsNode).to(0.1, { opacity: 0 }).start();
cc.tween(this.blueBar).by(0.3, { x: -cc.winSize.width }, { easing: "sineIn" }).start() cc.tween(this.blueBar).by(0.3, { x: -cc.winSize.width }, { easing: "sineIn" }).start()
cc.tween(this.redBar).by(0.3, { x: cc.winSize.width }, { easing: "sineIn" }).start() cc.tween(this.redBar).by(0.3, { x: cc.winSize.width }, { easing: "sineIn" }).start()
......
...@@ -15,8 +15,10 @@ export default class MyInfo extends cc.Component { ...@@ -15,8 +15,10 @@ export default class MyInfo extends cc.Component {
@property(cc.Node) @property(cc.Node)
root: cc.Node = null; root: cc.Node = null;
@property(cc.Mask) @property(cc.Node)
barMask: cc.Mask = null; barIn: cc.Node = null;
@property(cc.Node)
barOut: cc.Node = null;
@property(cc.Node) @property(cc.Node)
head: cc.Node = null; head: cc.Node = null;
@property(cc.Node) @property(cc.Node)
...@@ -33,15 +35,19 @@ export default class MyInfo extends cc.Component { ...@@ -33,15 +35,19 @@ export default class MyInfo extends cc.Component {
onLoad() { onLoad() {
this.barOut.active = false;
this.barIn.active = true;
this.btn_rise.on("click", this.onClickRisk, this) this.btn_rise.on("click", this.onClickRisk, this)
this.btn_rank.on("click", this.onClickRank, this) this.btn_rank.on("click", this.onClickRank, this)
} }
openMask() { openMask() {
this.barMask.enabled = true; this.barOut.active = true;
this.barIn.active = false;
} }
hideMask() { hideMask() {
this.barMask.enabled = false; this.barOut.active = false;
this.barIn.active = true;
} }
onClickRank() { onClickRank() {
...@@ -52,12 +58,12 @@ export default class MyInfo extends cc.Component { ...@@ -52,12 +58,12 @@ export default class MyInfo extends cc.Component {
} }
hide() { hide() {
cc.tween(this.root).to(0.2, { y: -180 }, { easing: "sineOut" }).start(); cc.tween(this.root).to(0.2, { y: -400 }, { easing: "sineOut" }).start();
} }
show() { show() {
cc.tween(this.root).to(0.2, { y: 180 }, { easing: "sineIn" }).start(); cc.tween(this.root).to(0.2, { y: 0 }, { easing: "sineIn" }).start();
} }
...@@ -65,7 +71,7 @@ export default class MyInfo extends cc.Component { ...@@ -65,7 +71,7 @@ export default class MyInfo extends cc.Component {
this.lb_score.string = data.score; this.lb_score.string = data.score;
this.lb_name.string = data.name; this.lb_name.string = data.name;
this.lb_rank.string = data.rank; this.lb_rank.string = data.rank + 1;
this.head.getComponent(Player).init(data.url); this.head.getComponent(Player).init(data.url);
this.root.getChildByName("cup").getComponent(Cup).init(data.score); this.root.getChildByName("cup").getComponent(Cup).init(data.score);
......
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "dc9952fc-3949-414e-8ecc-f28f6cac1ef1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1125,
"height": 2001,
"platformSettings": {},
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "91b538c0-1d1f-46f8-8a13-00745514fb61",
"rawTextureUuid": "dc9952fc-3949-414e-8ecc-f28f6cac1ef1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1125,
"height": 2001,
"rawWidth": 1125,
"rawHeight": 2001,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6f67b13d-fc31-40be-a88d-e2a39a838544",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 738,
"height": 887,
"platformSettings": {},
"subMetas": {
"bg_lose": {
"ver": "1.0.4",
"uuid": "24e785eb-fffe-4b8b-9555-467e14be091b",
"rawTextureUuid": "6f67b13d-fc31-40be-a88d-e2a39a838544",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 3,
"trimX": 0,
"trimY": 0,
"width": 738,
"height": 881,
"rawWidth": 738,
"rawHeight": 887,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7204baa3-99c3-4557-895b-fcde2bfbea7d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 738,
"height": 887,
"platformSettings": {},
"subMetas": {
"bg_succ": {
"ver": "1.0.4",
"uuid": "5221f6a0-f20e-4add-9642-eb9bbbc772da",
"rawTextureUuid": "7204baa3-99c3-4557-895b-fcde2bfbea7d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 3,
"trimX": 0,
"trimY": 0,
"width": 738,
"height": 881,
"rawWidth": 738,
"rawHeight": 887,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "53c271cb-0504-40b5-98b5-8f4e5fdc7c39",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 174,
"height": 184,
"platformSettings": {},
"subMetas": {
"icon_baiyin": {
"ver": "1.0.4",
"uuid": "4044bc10-596a-4684-b778-dd9b61557f2a",
"rawTextureUuid": "53c271cb-0504-40b5-98b5-8f4e5fdc7c39",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 9,
"trimY": 0,
"width": 156,
"height": 184,
"rawWidth": 174,
"rawHeight": 184,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "75232a77-5c42-4c97-a6b4-7b43c4eda1ed",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 174,
"height": 184,
"platformSettings": {},
"subMetas": {
"icon_heitie": {
"ver": "1.0.4",
"uuid": "687d81f4-0673-46eb-bcfb-205210ecb833",
"rawTextureUuid": "75232a77-5c42-4c97-a6b4-7b43c4eda1ed",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 11,
"trimY": 0,
"width": 153,
"height": 184,
"rawWidth": 174,
"rawHeight": 184,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "91aaa2b2-2b02-4c4c-a534-0e5e0daeb455",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 175,
"height": 185,
"platformSettings": {},
"subMetas": {
"icon_huangjin": {
"ver": "1.0.4",
"uuid": "a406b7bb-f970-45c2-b797-48b5aef5f148",
"rawTextureUuid": "91aaa2b2-2b02-4c4c-a534-0e5e0daeb455",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 175,
"height": 185,
"rawWidth": 175,
"rawHeight": 185,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "dff9df00-6f8e-4f03-a137-add3ac512c3b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 174,
"height": 184,
"platformSettings": {},
"subMetas": {
"icon_qingtong": {
"ver": "1.0.4",
"uuid": "a1313c12-c78c-48d9-a3ec-74c63cc79399",
"rawTextureUuid": "dff9df00-6f8e-4f03-a137-add3ac512c3b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 11,
"trimY": 0,
"width": 153,
"height": 184,
"rawWidth": 174,
"rawHeight": 184,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "82ffe2aa-cf9f-46b7-b216-49446c47bd3d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 332,
"height": 400,
"platformSettings": {},
"subMetas": {
"img_lose 2": {
"ver": "1.0.4",
"uuid": "504b3530-daa0-4e5a-80e7-2af089106d83",
"rawTextureUuid": "82ffe2aa-cf9f-46b7-b216-49446c47bd3d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0.5,
"trimX": 11,
"trimY": 0,
"width": 311,
"height": 399,
"rawWidth": 332,
"rawHeight": 400,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "669e796a-5e9b-4f32-a517-f5f7434e75bf",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 332,
"height": 400,
"platformSettings": {},
"subMetas": {
"img_succ": {
"ver": "1.0.4",
"uuid": "e9075e59-3fd8-4a57-907f-6f0d1e3c5215",
"rawTextureUuid": "669e796a-5e9b-4f32-a517-f5f7434e75bf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0.5,
"trimX": 11,
"trimY": 0,
"width": 311,
"height": 399,
"rawWidth": 332,
"rawHeight": 400,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6e2afc02-e8e3-4eb3-8901-e817e305baa5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 166,
"height": 181,
"platformSettings": {},
"subMetas": {
"icon_knowledge": {
"ver": "1.0.4",
"uuid": "8f8811c6-2c88-4b74-abc9-12ccfc80072e",
"rawTextureUuid": "6e2afc02-e8e3-4eb3-8901-e817e305baa5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 0,
"trimX": 1,
"trimY": 2,
"width": 162,
"height": 177,
"rawWidth": 166,
"rawHeight": 181,
"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