Commit 22be9808 authored by haiyoucuv's avatar haiyoucuv

init

parent 600851d4
......@@ -42,14 +42,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -8,
"offsetY": -4,
"trimX": 27,
"trimY": 40,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1224,
"height": 595,
"rawWidth": 1294,
"rawHeight": 667,
"rawWidth": 1224,
"rawHeight": 595,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......@@ -83,24 +83,24 @@
3
],
"uv": [
27,
627,
1251,
627,
27,
32,
1251,
32
0,
595,
1224,
595,
0,
0,
1224,
0
],
"nuv": [
0.020865533230293665,
0.047976011994003,
0.9667697063369397,
0.047976011994003,
0.020865533230293665,
0.9400299850074962,
0.9667697063369397,
0.9400299850074962
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-612,
......
......@@ -22,22 +22,22 @@
"__id__": 2
},
{
"__id__": 8
"__id__": 10
}
],
"_active": true,
"_components": [
{
"__id__": 16
"__id__": 18
}
],
"_prefab": {
"__id__": 18
"__id__": 20
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 50,
"y": -50,
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
......@@ -79,15 +79,18 @@
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 7
"__id__": 9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"y": 25,
"z": 0
},
"_lrot": {
......@@ -186,6 +189,42 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "c28bWe7x9K7LYG81m3c0je"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_alignFlags": 17,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8fC9QrTS5HFr5rtMwYqycV"
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -210,23 +249,23 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 15
}
],
"_prefab": {
"__id__": 15
"__id__": 17
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -79.09699999999998,
"y": -50.120000000000005,
"z": 0
},
"_lrot": {
......@@ -258,11 +297,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 10
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
......@@ -286,11 +325,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 12
"__id__": 14
},
"_customMaterial": null,
"_srcBlendFactor": 2,
......@@ -357,17 +396,17 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 14
"__id__": 16
},
"_alignFlags": 1,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 113.97699999999998,
"_top": 110,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -410,12 +449,12 @@
},
"_enabled": true,
"__prefab": {
"__id__": 17
"__id__": 19
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -437,6 +476,7 @@
"__id__": 0
},
"fileId": "37Q9JdyMlO7qcpn+8hIDo0",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
......@@ -15,7 +15,6 @@ export default class GameResultPanel extends Panel {
static skin = "GameResultPanel";
@property(Node) share: Node = null;
@property(Node) again: Node = null;
@property(Node) back: Node = null;
@property(Node) prizeNode: Node = null;
@property(Prefab) prizePrefab: Prefab = null;
......@@ -24,7 +23,6 @@ export default class GameResultPanel extends Panel {
onLoad() {
this.share.on(Button.EventType.CLICK, this.clickShare, this);
this.again.on(Button.EventType.CLICK, this.clickAgain, this);
this.back.on(Button.EventType.CLICK, this.clickBack, this);
}
......@@ -54,11 +52,6 @@ export default class GameResultPanel extends Panel {
});
}
clickAgain() {
this.hidePanel();
changeScene(HomeScene);
}
clickBack() {
this.hidePanel();
changeScene(HomeScene);
......
import { _decorator, Component, easing, Graphics, Label, Animation, misc, Node, Tween, tween, v3 } from "cc";
import { Global } from "../Global";
const { ccclass, property, executeInEditMode } = _decorator;
......@@ -67,15 +68,26 @@ export class Target extends Component {
});
}
async showBanner3() {
async showTarget3() {
await this.showBanner(this.bannerArr[2]);
}
async showBanner2() {
async showTarget2() {
const { time, length } = Global.stageConfig[1];
this.goalTxt.string = `${time}秒长度达到${length}`;
this.bannerArr[1].getChildByName("txt")
.getComponent(Label)
.string = `${time}秒长度达到${length}`;
await this.showBanner(this.bannerArr[1]);
}
async showBanner1() {
async showTarget1() {
const { time } = Global.stageConfig[0];
this.goalTxt.string = `存活${time}秒`;
this.bannerArr[0].getChildByName("txt")
.getComponent(Label)
.string = `存活${time}秒`;
await this.showBanner(this.bannerArr[0]);
}
......
......@@ -28,6 +28,16 @@ export class Global {
return { x, y };
}
static stageConfig = [
{
time: 10,
},
{
time: 60,
length: 50,
}
];
}
......
......@@ -121,7 +121,8 @@ export class MainGame extends Scene {
};
review = () => {
review = async () => {
await PreCd.ins.startCd();
this.isOver = false;
this.node.addChild(this.player.node);
this.player.revive();
......@@ -150,7 +151,25 @@ export class MainGame extends Scene {
} else if (currentStage == 2) {
const { time, length } = Global.stageConfig[0];
// TODO 判断条件
if (MainGame.ins.player.length >= length) {
const submitSuc = await gameStore.submitTwo();
if (submitSuc) {
const gameSuc = await gameStore.startGame();
if (gameSuc) {
// await changeScene(GameLoading, {
// callBack: async () => {
await changeScene(MainGame);
// }
// });
} else {
changeScene(HomeScene);
}
}
} else {
showPanel(GameFailPanel);
}
} else {
......@@ -218,22 +237,21 @@ export class MainGame extends Scene {
PropManager.ins.init(10);
CardManager.ins.init(10);
LuckyBagManager.ins.init();
await Target.ins.showBanner3();
await Target.ins.showTarget3();
await PreCd.ins.startCd();
} else if (currentStage == 2) {
Target.ins.totalCd = Target.ins.cd = 60;
await Target.ins.showBanner2();
const { time } = Global.stageConfig[0];
Target.ins.totalCd = Target.ins.cd = time;
await Target.ins.showTarget2();
await PreCd.ins.startCd();
Target.ins.startCd(60, this.cdOver);
Target.ins.startCd(time, this.cdOver);
} else if (currentStage == 1) {
Target.ins.totalCd = Target.ins.cd = 10;
await Target.ins.showBanner1();
const { time } = Global.stageConfig[0];
Target.ins.totalCd = Target.ins.cd = time;
await Target.ins.showTarget1();
await PreCd.ins.startCd();
Target.ins.startCd(10, this.cdOver);
Target.ins.startCd(time, this.cdOver);
}
}
......
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