From a45a461a85fe4c2386e62de6661347a46ba57b15 Mon Sep 17 00:00:00 2001 From: tiendat3699 <96950844+tiendat3699@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:28:59 +0700 Subject: [PATCH] feat: web flow --- assets/_Game/Scenes/EndLessScene.scene | 2696 +++++++++++++++-- assets/_Game/Scripts/API/BEConnector.ts | 39 +- assets/_Game/Scripts/Enum/GameState.ts | 2 + assets/_Game/Scripts/Manager/GameManager.ts | 55 +- .../Scripts/Manager/SpawnObjectManager.ts | 8 +- assets/_Game/Scripts/UI/ConfirmPanel.ts | 32 + ...ontroller.ts.meta => ConfirmPanel.ts.meta} | 2 +- .../_Game/Scripts/UI/EndGameUIController.ts | 137 - assets/_Game/Scripts/UI/GameOverPanel.ts | 34 + assets/_Game/Scripts/UI/GameOverPanel.ts.meta | 9 + assets/_Game/Scripts/UI/UIController.ts | 29 +- 11 files changed, 2623 insertions(+), 420 deletions(-) create mode 100644 assets/_Game/Scripts/UI/ConfirmPanel.ts rename assets/_Game/Scripts/UI/{EndGameUIController.ts.meta => ConfirmPanel.ts.meta} (70%) delete mode 100644 assets/_Game/Scripts/UI/EndGameUIController.ts create mode 100644 assets/_Game/Scripts/UI/GameOverPanel.ts create mode 100644 assets/_Game/Scripts/UI/GameOverPanel.ts.meta diff --git a/assets/_Game/Scenes/EndLessScene.scene b/assets/_Game/Scenes/EndLessScene.scene index 8e12c6e..a7fd72c 100644 --- a/assets/_Game/Scenes/EndLessScene.scene +++ b/assets/_Game/Scenes/EndLessScene.scene @@ -25,7 +25,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 684 + "__id__": 746 }, "_lpos": { "__type__": "cc.Vec3", @@ -56,7 +56,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 690 + "__id__": 752 }, "_id": "82e6ef2e-3f9c-4d4e-ab02-dc963e925b88" }, @@ -5315,7 +5315,7 @@ "z": 1 }, "_mobility": 0, - "_layer": 4294967295, + "_layer": 33554432, "_euler": { "__type__": "cc.Vec3", "x": 0, @@ -20097,7 +20097,7 @@ "y": -1200, "z": 0 }, - "_timePlay": 90, + "_timePlay": 120, "_startSound": { "__uuid__": "6452248b-259c-4844-b0e1-70f47d69955e", "__expectedType__": "cc.AudioClip" @@ -20253,19 +20253,19 @@ "__id__": 619 }, { - "__id__": 666 + "__id__": 728 } ], "_active": true, "_components": [ { - "__id__": 681 + "__id__": 743 }, { - "__id__": 682 + "__id__": 744 }, { - "__id__": 683 + "__id__": 745 } ], "_prefab": null, @@ -20320,18 +20320,21 @@ }, { "__id__": 644 + }, + { + "__id__": 705 } ], "_active": true, "_components": [ { - "__id__": 663 + "__id__": 725 }, { - "__id__": 664 + "__id__": 726 }, { - "__id__": 665 + "__id__": 727 } ], "_prefab": null, @@ -21193,22 +21196,31 @@ "__id__": 645 }, { - "__id__": 650 - }, - { - "__id__": 655 - } - ], - "_active": false, - "_components": [ - { - "__id__": 660 + "__id__": 653 }, { "__id__": 661 }, { - "__id__": 662 + "__id__": 669 + }, + { + "__id__": 677 + } + ], + "_active": false, + "_components": [ + { + "__id__": 701 + }, + { + "__id__": 702 + }, + { + "__id__": 703 + }, + { + "__id__": 704 } ], "_prefab": null, @@ -21243,22 +21255,605 @@ }, { "__type__": "cc.Node", - "_name": "RestartButton", + "_name": "Top", "_objFlags": 0, "_parent": { "__id__": 644 }, + "_children": [ + { + "__id__": 646 + } + ], + "_active": true, + "_components": [ + { + "__id__": 650 + }, + { + "__id__": 651 + }, + { + "__id__": 652 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 50, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "d4hB1hSE9Gk7i9IyvtXitB" + }, + { + "__type__": "cc.Node", + "_name": "Top Score", + "_objFlags": 0, + "_parent": { + "__id__": 645 + }, "_children": [], "_active": true, "_components": [ - { - "__id__": 646 - }, { "__id__": 647 }, { "__id__": 648 + }, + { + "__id__": 649 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 100, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "66dSHyTghFWoVVSFWZn9hf" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 646 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140.7, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "926+o0A7lMVI/iazt/gXyf" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 646 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "1000", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "38UGDLbQpHtpYpXS8nu7ZP" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 646 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "6bX0nhgJZBgpzlb0TvnHvw" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 645 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 351.4, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 1, + "y": 0.5 + }, + "_id": "f7BheAPglAdJYHd04ZLDlT" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 645 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Top Score:", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "b69uTkpzNCdYyX/qmIK3It" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 645 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "16+du8oXtHgLCl132pR3C3" + }, + { + "__type__": "cc.Node", + "_name": "Result", + "_objFlags": 0, + "_parent": { + "__id__": 644 + }, + "_children": [ + { + "__id__": 654 + } + ], + "_active": true, + "_components": [ + { + "__id__": 658 + }, + { + "__id__": 659 + }, + { + "__id__": 660 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -50, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "71gzt7VvxNd59gt8l3EayE" + }, + { + "__type__": "cc.Node", + "_name": "Your Score", + "_objFlags": 0, + "_parent": { + "__id__": 653 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 655 + }, + { + "__id__": 656 + }, + { + "__id__": 657 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 100, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "cbRYxjcYlKyK5RuiIILEDH" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 654 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 109.45, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "3ctMCfMNxCgbfB+vYxOIz3" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 654 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "100", + "_horizontalAlign": 0, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "04vVYPL7REqKPnBCTG0JQI" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 654 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "25d9gljfFFqZbvizsch6F+" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 653 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 380.75, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 1, + "y": 0.5 + }, + "_id": "9cl88AtLBHF6SbW50FU7mQ" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 653 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Your Score:", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "12qCwLnEtIUoj0UqV14fCz" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 653 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "0ck9NCQN5Mw5NY2NYttyJK" + }, + { + "__type__": "cc.Node", + "_name": "ButtonY", + "_objFlags": 0, + "_parent": { + "__id__": 644 + }, + "_children": [ + { + "__id__": 662 + } + ], + "_active": true, + "_components": [ + { + "__id__": 665 + }, + { + "__id__": 666 + }, + { + "__id__": 667 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 150, + "y": -200, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "01jyCcLspL6Ize1sovRPi/" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 512, + "_parent": { + "__id__": 661 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 663 + }, + { + "__id__": 664 } ], "_prefab": null, @@ -21289,35 +21884,35 @@ "y": 0, "z": 0 }, - "_id": "64PKLRMElOWZOdqoFW26Zp" + "_id": "e0sOnB7DhHQoBnwo90hKwz" }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "node": { - "__id__": 645 + "__id__": 662 }, "_enabled": true, "__prefab": null, "_contentSize": { "__type__": "cc.Size", - "width": 478, - "height": 194 + "width": 150, + "height": 50 }, "_anchorPoint": { "__type__": "cc.Vec2", "x": 0.5, "y": 0.5 }, - "_id": "c1uDG/dplBWL/iMKi4S+rW" + "_id": "99iKR6Zs5AabWjR+9WcbUh" }, { - "__type__": "cc.Sprite", + "__type__": "cc.Label", "_name": "", "_objFlags": 0, "node": { - "__id__": 645 + "__id__": 662 }, "_enabled": true, "__prefab": null, @@ -21331,13 +21926,75 @@ "b": 255, "a": 255 }, + "_string": "👌", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "cfHwDdDPFPXopubPsA5Cy4" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 661 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "1agUFgOb1KZK6NZPfuq6jF" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 661 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 255, + "b": 10, + "a": 255 + }, "_spriteFrame": { - "__uuid__": "ff046972-01bd-4d20-b27d-92120e050ca3@f9941", + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", "__expectedType__": "cc.SpriteFrame" }, "_type": 1, "_fillType": 0, - "_sizeMode": 1, + "_sizeMode": 0, "_fillCenter": { "__type__": "cc.Vec2", "x": 0, @@ -21348,20 +22005,20 @@ "_isTrimmedMode": true, "_useGrayscale": false, "_atlas": null, - "_id": "559jlgpPBPXI83ZrZP1LD4" + "_id": "5e2lEHKvtPs4gTAMS+4pdg" }, { "__type__": "cc.Button", "_name": "", "_objFlags": 0, "node": { - "__id__": 645 + "__id__": 661 }, "_enabled": true, "__prefab": null, "clickEvents": [ { - "__id__": 649 + "__id__": 668 } ], "_interactable": true, @@ -21395,7 +22052,7 @@ "a": 255 }, "_normalSprite": { - "__uuid__": "ff046972-01bd-4d20-b27d-92120e050ca3@f9941", + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", "__expectedType__": "cc.SpriteFrame" }, "_hoverSprite": { @@ -21413,48 +22070,49 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 645 + "__id__": 661 }, - "_id": "a8Mg86ufxIhZPm+HYCnlf2" + "_id": "83tN1zwmxCxI7aJ2ug7LTQ" }, { "__type__": "cc.ClickEvent", "target": { - "__id__": 7 + "__id__": 644 }, "component": "", - "_componentId": "85b9aaRsZBAn5sUxS5RQ3EF", - "handler": "play", + "_componentId": "c5e2dm0qXVOuKP1ju7uyMtJ", + "handler": "onClickYesButton", "customEventData": "" }, { "__type__": "cc.Node", - "_name": "Result", + "_name": "ButtonN", "_objFlags": 0, "_parent": { "__id__": 644 }, - "_children": [], + "_children": [ + { + "__id__": 670 + } + ], "_active": true, "_components": [ { - "__id__": 651 + "__id__": 673 }, { - "__id__": 652 + "__id__": 674 }, { - "__id__": 653 - }, - { - "__id__": 654 + "__id__": 675 } ], "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": 400, + "x": -150, + "y": -200, "z": 0 }, "_lrot": { @@ -21478,146 +22136,30 @@ "y": 0, "z": 0 }, - "_id": "66dSHyTghFWoVVSFWZn9hf" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 650 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 517.9, - "height": 134 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "926+o0A7lMVI/iazt/gXyf" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 650 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_string": "Score: 0", - "_horizontalAlign": 0, - "_verticalAlign": 2, - "_actualFontSize": 100, - "_fontSize": 100, - "_fontFamily": "Arial", - "_lineHeight": 100, - "_overflow": 0, - "_enableWrapText": true, - "_font": { - "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", - "__expectedType__": "cc.TTFFont" - }, - "_isSystemFontUsed": false, - "_spacingX": 0, - "_isItalic": false, - "_isBold": false, - "_isUnderline": false, - "_underlineHeight": 2, - "_cacheMode": 0, - "_id": "38UGDLbQpHtpYpXS8nu7ZP" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 650 - }, - "_enabled": true, - "__prefab": null, - "_alignFlags": 18, - "_target": null, - "_left": 50, - "_right": 0, - "_top": 50, - "_bottom": 0, - "_horizontalCenter": 0, - "_verticalCenter": 400, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 0, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "e9RV9IAhNG444cHnO+lYYl" - }, - { - "__type__": "cc.LabelOutline", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 650 - }, - "_enabled": true, - "__prefab": null, - "_color": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_width": 4, - "_id": "6bX0nhgJZBgpzlb0TvnHvw" + "_id": "74l0gZG+FA1JRP/vaMTAkP" }, { "__type__": "cc.Node", - "_name": "Timer", - "_objFlags": 0, + "_name": "Label", + "_objFlags": 512, "_parent": { - "__id__": 644 + "__id__": 669 }, "_children": [], "_active": true, "_components": [ { - "__id__": 656 + "__id__": 671 }, { - "__id__": 657 - }, - { - "__id__": 658 - }, - { - "__id__": 659 + "__id__": 672 } ], "_prefab": null, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 258.726, + "y": 0, "z": 0 }, "_lrot": { @@ -21641,35 +22183,35 @@ "y": 0, "z": 0 }, - "_id": "cbRYxjcYlKyK5RuiIILEDH" + "_id": "3e+zHMTF9HcbKLuMx1lczl" }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "node": { - "__id__": 655 + "__id__": 670 }, "_enabled": true, "__prefab": null, "_contentSize": { "__type__": "cc.Size", - "width": 462, - "height": 134 + "width": 150, + "height": 50 }, "_anchorPoint": { "__type__": "cc.Vec2", "x": 0.5, "y": 0.5 }, - "_id": "3ctMCfMNxCgbfB+vYxOIz3" + "_id": "54n7FR0utMRIs6XQW8SNux" }, { "__type__": "cc.Label", "_name": "", "_objFlags": 0, "node": { - "__id__": 655 + "__id__": 670 }, "_enabled": true, "__prefab": null, @@ -21683,14 +22225,322 @@ "b": 255, "a": 255 }, - "_string": "00:00:00", - "_horizontalAlign": 2, + "_string": "👎", + "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 100, - "_fontSize": 100, + "_actualFontSize": 40, + "_fontSize": 40, "_fontFamily": "Arial", - "_lineHeight": 100, - "_overflow": 0, + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "b5f4DqQ7VFO7QxxBEOXnaT" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 669 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "23OAtiRqtD0oU05Id2Xg82" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 669 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 0, + "b": 0, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "f3dW82XBVI1a9SUJizmOZs" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 669 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [ + { + "__id__": 676 + } + ], + "_interactable": true, + "_transition": 3, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 669 + }, + "_id": "05kavv3MFKp4R9iVYAgcDb" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 644 + }, + "component": "", + "_componentId": "c5e2dm0qXVOuKP1ju7uyMtJ", + "handler": "onClickNoButton", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "ConfirmPanel", + "_objFlags": 0, + "_parent": { + "__id__": 644 + }, + "_children": [ + { + "__id__": 678 + }, + { + "__id__": 681 + }, + { + "__id__": 689 + } + ], + "_active": false, + "_components": [ + { + "__id__": 697 + }, + { + "__id__": 698 + }, + { + "__id__": 699 + }, + { + "__id__": 700 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "38gm7oOwlFl401WOxZmQ0a" + }, + { + "__type__": "cc.Node", + "_name": "Info", + "_objFlags": 0, + "_parent": { + "__id__": 677 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 679 + }, + { + "__id__": 680 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "ae1PdEkUdMKYyWDCcgemcH" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 678 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1000, + "height": 163 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "6fM87kyl5OK59EzcIHksIt" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 678 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "To continue playing, you will be deducted 1 extras. Do you want to proceed?", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 3, "_enableWrapText": true, "_font": { "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", @@ -21703,55 +22553,707 @@ "_isUnderline": false, "_underlineHeight": 2, "_cacheMode": 0, - "_id": "04vVYPL7REqKPnBCTG0JQI" + "_id": "3aCx8W+m9G2a9UdFy2VTKu" + }, + { + "__type__": "cc.Node", + "_name": "ButtonY", + "_objFlags": 0, + "_parent": { + "__id__": 677 + }, + "_children": [ + { + "__id__": 682 + } + ], + "_active": true, + "_components": [ + { + "__id__": 685 + }, + { + "__id__": 686 + }, + { + "__id__": 687 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 150, + "y": -200, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "48szlRWpRNj7tlvJ6KUJm/" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 512, + "_parent": { + "__id__": 681 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 683 + }, + { + "__id__": 684 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "60AVp7Cp1BgbNISYjOAPW+" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 682 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 50 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "0fTVrZU0RPQKRtqwATDFk6" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 682 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "👌", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "cahv8eE/tMAoDg8BIVyD14" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 681 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "2dPo/1Q81MHa455mkqbCb9" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 681 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 255, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "46fSOWXxNGda5LvaOkyYFH" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 681 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [ + { + "__id__": 688 + } + ], + "_interactable": true, + "_transition": 3, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 681 + }, + "_id": "e0HMdyZstFuJfDx9qs4BW5" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 677 + }, + "component": "", + "_componentId": "a0eceQhm3FG+KWHNdalmRJZ", + "handler": "onClickYesButton", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "ButtonN", + "_objFlags": 0, + "_parent": { + "__id__": 677 + }, + "_children": [ + { + "__id__": 690 + } + ], + "_active": true, + "_components": [ + { + "__id__": 693 + }, + { + "__id__": 694 + }, + { + "__id__": 695 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -150, + "y": -200, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "1aYzO05QJDTL32GIm0GoSo" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 512, + "_parent": { + "__id__": 689 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 691 + }, + { + "__id__": 692 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "80DMXi3YlHL4Z1LYde1hxb" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 690 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 50 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "d081mRsHBNpKSrrAoth6Cy" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 690 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "👎", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 1, + "_enableWrapText": false, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "8djQT9e/ZFJKu/1uhB49yf" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 689 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "df4q9j1CZBJKYCN6DIYa+o" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 689 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 0, + "b": 0, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "65sn3VeI9BnqLCJbKf+qA+" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 689 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [ + { + "__id__": 696 + } + ], + "_interactable": true, + "_transition": 3, + "_normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_hoverSprite": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_pressedSprite": { + "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_disabledSprite": { + "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 689 + }, + "_id": "17e4bI95xBn7IfO8hGQkcR" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 677 + }, + "component": "", + "_componentId": "a0eceQhm3FG+KWHNdalmRJZ", + "handler": "onClickNoButton", + "customEventData": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 677 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 10000, + "height": 4000 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "72HtFkt85DSZ0tg8gtOhY3" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 677 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 2, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "559UBxRIND+J7PydJXNgLb" }, { "__type__": "cc.Widget", "_name": "", "_objFlags": 0, "node": { - "__id__": 655 + "__id__": 677 }, "_enabled": true, "__prefab": null, - "_alignFlags": 18, + "_alignFlags": 45, "_target": null, "_left": 0, - "_right": 50, - "_top": 200, - "_bottom": -76.00000000000001, + "_right": 0, + "_top": 0, + "_bottom": 0, "_horizontalCenter": 0, - "_verticalCenter": 258.726, + "_verticalCenter": 0, "_isAbsLeft": true, "_isAbsRight": true, "_isAbsTop": true, "_isAbsBottom": true, "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, - "_originalWidth": 0, - "_originalHeight": 252, + "_originalWidth": 512, + "_originalHeight": 512, "_alignMode": 2, "_lockFlags": 0, - "_id": "75XfQEq7xK7q1uxB1f3Qv3" + "_id": "a4vh9PgjtJsom8DgoUUFiE" }, { - "__type__": "cc.LabelOutline", + "__type__": "a0eceQhm3FG+KWHNdalmRJZ", "_name": "", "_objFlags": 0, "node": { - "__id__": 655 + "__id__": 677 }, "_enabled": true, "__prefab": null, - "_color": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 + "ticketWaringText": { + "__id__": 680 }, - "_width": 4, - "_id": "25d9gljfFFqZbvizsch6F+" + "_id": "41r7/Q71lEZbU8ZHfoJf5p" }, { "__type__": "cc.UITransform", @@ -21841,6 +23343,703 @@ "_lockFlags": 0, "_id": "1eaaPIoxtAkLvoRrUOy3Js" }, + { + "__type__": "c5e2dm0qXVOuKP1ju7uyMtJ", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 644 + }, + "_enabled": true, + "__prefab": null, + "topScore": { + "__id__": 648 + }, + "yourScore": { + "__id__": 656 + }, + "confirmPanel": { + "__id__": 677 + }, + "_id": "bbcyvzebBDsJfOOH9VNeON" + }, + { + "__type__": "cc.Node", + "_name": "ResultPanel", + "_objFlags": 0, + "_parent": { + "__id__": 619 + }, + "_children": [ + { + "__id__": 706 + }, + { + "__id__": 714 + } + ], + "_active": false, + "_components": [ + { + "__id__": 722 + }, + { + "__id__": 723 + }, + { + "__id__": 724 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "cfkphFS+ZHpaLXIrnk3QS8" + }, + { + "__type__": "cc.Node", + "_name": "Score", + "_objFlags": 0, + "_parent": { + "__id__": 705 + }, + "_children": [ + { + "__id__": 707 + } + ], + "_active": true, + "_components": [ + { + "__id__": 711 + }, + { + "__id__": 712 + }, + { + "__id__": 713 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 50, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "32wNlCOe5IhqvqOiBdnYt1" + }, + { + "__type__": "cc.Node", + "_name": "Score", + "_objFlags": 0, + "_parent": { + "__id__": 706 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 708 + }, + { + "__id__": 709 + }, + { + "__id__": 710 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 100, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "59rMm1O59JVIUzoftSQtaM" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 707 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140.7, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "648pDWPexMtZ7QxBaEG0Ot" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 707 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "1000", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "1fwsMbdJ1NNZBtJaEawUpA" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 707 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "31FcYzvgNLEqVN2U3U77DN" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 706 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 211.7, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 1, + "y": 0.5 + }, + "_id": "55mDPjQ7pF2am3r5UPbs2i" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 706 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Score:", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "ccnlhRlARFsaTqp1uUq9NA" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 706 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "471qMruCJD1b9g7H3MtDkj" + }, + { + "__type__": "cc.Node", + "_name": "Total", + "_objFlags": 0, + "_parent": { + "__id__": 705 + }, + "_children": [ + { + "__id__": 715 + } + ], + "_active": true, + "_components": [ + { + "__id__": 719 + }, + { + "__id__": 720 + }, + { + "__id__": 721 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -50, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "67qWzNiadKxpzOSMHXCMDd" + }, + { + "__type__": "cc.Node", + "_name": "TotalScore", + "_objFlags": 0, + "_parent": { + "__id__": 714 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 716 + }, + { + "__id__": 717 + }, + { + "__id__": 718 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 100, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "26DMkbGA9MRaRTyG1r/5YP" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 715 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 171.95, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "2exT40DPVA/4LegnfRIiXm" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 715 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "10000", + "_horizontalAlign": 0, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "93YxZOdzdOa6EenyQbUxXi" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 715 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "9d7GkG+NROzJSTVBacnBUe" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 714 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 224.05, + "height": 71 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 1, + "y": 0.5 + }, + "_id": "9ccBZbBKBJyZD63+YndN+l" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 714 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Total:", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 50, + "_fontSize": 50, + "_fontFamily": "Arial", + "_lineHeight": 50, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "7745538c-645c-4a76-bbfc-b42ec99d7bcc", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "7bBOJE3ZhEppZx+RbkaGcr" + }, + { + "__type__": "cc.LabelOutline", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 714 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_width": 4, + "_id": "62sVr7ejlI0LGg/YuVJAap" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 705 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 10000, + "height": 4000 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "b0073WPA9NtLhYASp7cpUY" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 705 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 2, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "a87N2VuQdJIIM2vofjDorf" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 705 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": -4460, + "_right": -4460, + "_top": -830, + "_bottom": -830, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 512, + "_originalHeight": 512, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "3az6EAafpIhZv9Yn2mf477" + }, { "__type__": "cc.UITransform", "_name": "", @@ -21907,7 +24106,10 @@ "__id__": 627 }, "_resultLabel": { - "__id__": 652 + "__id__": 709 + }, + "_resultTotalLabel": { + "__id__": 717 }, "_buffFx": null, "_startPanel": { @@ -21919,8 +24121,8 @@ "_timeLabe": { "__id__": 632 }, - "_timeResult": { - "__id__": 657 + "_resultPanel": { + "__id__": 705 }, "_id": "449hzGcyZL+Lsj/r1gnEMe" }, @@ -21931,14 +24133,14 @@ "__id__": 618 }, "_prefab": { - "__id__": 667 + "__id__": 729 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 666 + "__id__": 728 }, "asset": { "__uuid__": "c7549312-ab7b-4974-8863-1a55c119c34f", @@ -21946,7 +24148,7 @@ }, "fileId": "d6MYHCymBFRbEj0OPlLt9v", "instance": { - "__id__": 668 + "__id__": 730 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -21959,28 +24161,28 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 669 + "__id__": 731 }, { - "__id__": 671 + "__id__": 733 }, { - "__id__": 672 + "__id__": 734 }, { - "__id__": 673 + "__id__": 735 }, { - "__id__": 674 + "__id__": 736 }, { - "__id__": 676 + "__id__": 738 }, { - "__id__": 678 + "__id__": 740 }, { - "__id__": 680 + "__id__": 742 } ], "removedComponents": [] @@ -21988,7 +24190,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 670 + "__id__": 732 }, "propertyPath": [ "_name" @@ -22004,7 +24206,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 670 + "__id__": 732 }, "propertyPath": [ "_lpos" @@ -22019,7 +24221,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 670 + "__id__": 732 }, "propertyPath": [ "_lrot" @@ -22035,7 +24237,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 670 + "__id__": 732 }, "propertyPath": [ "_euler" @@ -22050,7 +24252,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 675 + "__id__": 737 }, "propertyPath": [ "_enabled" @@ -22066,7 +24268,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 677 + "__id__": 739 }, "propertyPath": [ "_enabled" @@ -22082,7 +24284,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 679 + "__id__": 741 }, "propertyPath": [ "_prewarm" @@ -22098,7 +24300,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 679 + "__id__": 741 }, "propertyPath": [ "playOnAwake" @@ -22178,35 +24380,35 @@ "instance": null, "targetOverrides": [ { - "__id__": 685 + "__id__": 747 }, { - "__id__": 688 + "__id__": 750 } ], "nestedPrefabInstanceRoots": [ { - "__id__": 666 + "__id__": 728 } ] }, { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 666 + "__id__": 728 }, "sourceInfo": { - "__id__": 686 + "__id__": 748 }, "propertyPath": [ "_trailModule", "_particleSystem" ], "target": { - "__id__": 666 + "__id__": 728 }, "targetInfo": { - "__id__": 687 + "__id__": 749 } }, { @@ -22224,17 +24426,17 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 665 + "__id__": 727 }, "sourceInfo": null, "propertyPath": [ "_buffFx" ], "target": { - "__id__": 666 + "__id__": 728 }, "targetInfo": { - "__id__": 689 + "__id__": 751 } }, { @@ -22246,22 +24448,22 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 691 + "__id__": 753 }, "shadows": { - "__id__": 692 + "__id__": 754 }, "_skybox": { - "__id__": 693 + "__id__": 755 }, "fog": { - "__id__": 694 + "__id__": 756 }, "octree": { - "__id__": 695 + "__id__": 757 }, "lightProbeInfo": { - "__id__": 696 + "__id__": 758 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false diff --git a/assets/_Game/Scripts/API/BEConnector.ts b/assets/_Game/Scripts/API/BEConnector.ts index a414c5d..d359a6a 100644 --- a/assets/_Game/Scripts/API/BEConnector.ts +++ b/assets/_Game/Scripts/API/BEConnector.ts @@ -1,10 +1,23 @@ import { _decorator } from 'cc'; import * as CryptoES from 'crypto-es'; import { GameManager } from '../Manager/GameManager'; +import Utilities from '../Utilities'; export let CryptoESDefault = CryptoES.default; const { ccclass, property } = _decorator; +window.addEventListener('message', (data) => { + const { data: res } = data; + const objectRes = Utilities.getJson(res); + if (objectRes) { + const { type, value } = objectRes; + if (type === 'newTicket') { + BEConnector.instance.numberTicket += value; + GameManager.instance.gameRelive(); + } + } +}); + @ccclass('BEConnector') export default class BEConnector { public static _instance: BEConnector = null; @@ -18,6 +31,7 @@ export default class BEConnector { // Ticket infors public numberTicket: number; public maxScore: number; + public currentScore: number; private mileStone: string; private gameURL: string = ''; @@ -43,6 +57,7 @@ export default class BEConnector { this.numberTicket = parseInt(url.get('numberTicket')); this.maxScore = parseInt(url.get('maxScore')); + this.currentScore = parseInt(url.get('currentScore')) || 0; this.mileStone = url.get('mileStone'); this.gameURL = ENV_CONFIG[url.get('env')]; } @@ -115,19 +130,15 @@ export default class BEConnector { public postMessage() { let totalScore: number = GameManager.instance.score; - // window.parent.postMessage( - // JSON.stringify({ - // error: false, - // message: "Hello World", - // score: totalScore, - // type: "paypal_modal", - // }), - // "*" - // ); - setTimeout(() => { - BEConnector.instance.numberTicket += 5; - GameManager.instance.onRevive(); - }, 2000); + window.parent.postMessage( + JSON.stringify({ + error: false, + message: 'Hello World', + score: totalScore, + type: 'paypal_modal', + }), + '*', + ); } public postScoreToServer(score: number) { @@ -155,7 +166,7 @@ export default class BEConnector { JSON.stringify({ error: false, message: 'Hello World', - score: score, + score: score + this.currentScore, type: 'game_tournament', }), '*', diff --git a/assets/_Game/Scripts/Enum/GameState.ts b/assets/_Game/Scripts/Enum/GameState.ts index 5fb6d05..9d5869c 100644 --- a/assets/_Game/Scripts/Enum/GameState.ts +++ b/assets/_Game/Scripts/Enum/GameState.ts @@ -2,6 +2,8 @@ enum GameState { Init, Playing, GameOver, + End, + Relive, } export default GameState; diff --git a/assets/_Game/Scripts/Manager/GameManager.ts b/assets/_Game/Scripts/Manager/GameManager.ts index 7935fc9..998aa51 100644 --- a/assets/_Game/Scripts/Manager/GameManager.ts +++ b/assets/_Game/Scripts/Manager/GameManager.ts @@ -22,8 +22,21 @@ import ScoreType from '../Enum/ScoreType'; import { FloatingText } from '../Environments/FloatingText'; import { SoundManager } from './SoundManager'; import TimeConfig from '../Enum/TimeConfig'; +import BEConnector from '../API/BEConnector'; const { ccclass, property } = _decorator; +window.addEventListener('message', (data) => { + const { data: res } = data; + const objectRes = Utilities.getJson(res); + if (objectRes) { + const { type, value } = objectRes; + if (type === 'newTicket') { + BEConnector.instance.numberTicket += value; + GameManager.instance.gameRelive(); + } + } +}); + @ccclass('GameManager') export class GameManager extends Component { //singleton @@ -55,6 +68,7 @@ export class GameManager extends Component { private _timer: number; private _score = 0; + private isReplayed = false; private _isMultiBall = false; private _currentBallInGame = 0; @@ -84,9 +98,29 @@ export class GameManager extends Component { EventManger.instance.emit(GameEvent.TimeUpdate, this._timer); } - private changeGameState(state: GameState) { + private async changeGameState(state: GameState) { this._gameState = state; EventManger.instance.emit(GameEvent.GameStateChange, this._gameState); + + switch (state) { + case GameState.Init: + BEConnector.instance.authenticate(); + break; + case GameState.Playing: + BEConnector.instance.ticketMinus('auth'); + break; + case GameState.GameOver: + break; + case GameState.End: + await Utilities.delay(3); + BEConnector.instance.postScoreToServer(this._score); + break; + case GameState.Relive: + BEConnector.instance.ticketMinus('revive'); + break; + default: + throw new Error(`Argument Out Of Range Exception: ${GameState[state]}`); + } } private addScore(score: number, type: ScoreType, position: Vec3) { @@ -164,7 +198,13 @@ export class GameManager extends Component { this._timer += time; } - private gameOver() { + public gameOver() { + if (this.isReplayed) { + this.changeGameState(GameState.End); + return; + } + + this.isReplayed = true; this._ballPool.releaseAll(); this.changeGameState(GameState.GameOver); } @@ -180,7 +220,14 @@ export class GameManager extends Component { this.spawnBall(true); } - public onRevive() { - throw new Error('Method not implemented.'); + public async gameRelive() { + this.changeGameState(GameState.Relive); + this._timer = 60 + TimeConfig.DelayPLay; + this._currentBallInGame = 0; + this._isMultiBall = false; + SoundManager.instance.playBGM(this._backgroundMusic, 0.5); + this.changeGameState(GameState.Playing); + await Utilities.delay(TimeConfig.DelayPLay); + this.spawnBall(true); } } diff --git a/assets/_Game/Scripts/Manager/SpawnObjectManager.ts b/assets/_Game/Scripts/Manager/SpawnObjectManager.ts index 2dea4a1..a423b24 100644 --- a/assets/_Game/Scripts/Manager/SpawnObjectManager.ts +++ b/assets/_Game/Scripts/Manager/SpawnObjectManager.ts @@ -101,9 +101,6 @@ export class SpawnObjectManager extends Component { private onGameStateChange(state: GameState) { switch (state) { case GameState.Init: - break; - case GameState.Playing: - this._playing = true; this._weights = this._objects.map((obj) => { obj.currentWeight = obj.weight; return obj.currentWeight; @@ -112,10 +109,11 @@ export class SpawnObjectManager extends Component { this.spawn(); } break; + case GameState.Playing: + this._playing = true; + break; case GameState.GameOver: this._playing = false; - this._objects.forEach((object) => (object.currentWeight = object.weight)); - this._pools.forEach((pool) => pool.releaseAll()); break; } } diff --git a/assets/_Game/Scripts/UI/ConfirmPanel.ts b/assets/_Game/Scripts/UI/ConfirmPanel.ts new file mode 100644 index 0000000..2204690 --- /dev/null +++ b/assets/_Game/Scripts/UI/ConfirmPanel.ts @@ -0,0 +1,32 @@ +import { _decorator, Component, Label, Node } from 'cc'; +import BEConnector from '../API/BEConnector'; +import { GameManager } from '../Manager/GameManager'; +const { ccclass, property } = _decorator; + +@ccclass('ConfirmPanel') +export class ConfirmPanel extends Component { + @property(Label) ticketWaringText: Label = null; + + protected onEnable(): void { + this.ticketWaringText.string = `To continue playing, you will be deducted ${BEConnector.instance.getTicketCanBeMinus()} ticket`; + } + + onClickYesButton() { + if (BEConnector.instance.canRelive()) { + BEConnector.instance + .checkGameScoreTicket() + .then(() => { + GameManager.instance.gameRelive(); + }) + .catch(() => { + GameManager.instance.gameOver(); + }); + } else { + BEConnector.instance.postMessage(); + } + } + + onClickNoButton() { + this.node.active = false; + } +} diff --git a/assets/_Game/Scripts/UI/EndGameUIController.ts.meta b/assets/_Game/Scripts/UI/ConfirmPanel.ts.meta similarity index 70% rename from assets/_Game/Scripts/UI/EndGameUIController.ts.meta rename to assets/_Game/Scripts/UI/ConfirmPanel.ts.meta index dd5d646..cedc743 100644 --- a/assets/_Game/Scripts/UI/EndGameUIController.ts.meta +++ b/assets/_Game/Scripts/UI/ConfirmPanel.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "99bfd134-ace2-424f-b5da-79474dd94bd9", + "uuid": "a0ece421-9b71-46f8-a587-35d6a5991259", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/UI/EndGameUIController.ts b/assets/_Game/Scripts/UI/EndGameUIController.ts deleted file mode 100644 index 3deaafe..0000000 --- a/assets/_Game/Scripts/UI/EndGameUIController.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { _decorator, Button, CCInteger, Component, EventTarget, Label, Node, EventTouch } from 'cc'; -import BEConnector from '../API/BEConnector'; -import { GameManager } from '../Manager/GameManager'; -const { ccclass, property } = _decorator; - -export enum PanelState { - NotShowing, - CompareScore, - Continue, - ShowResult, -} -@ccclass('EndGameUIController') -export class EndGameUIController extends Component { - @property(CCInteger) - private countdownTime: number = 15; - private currentCD: number = 15; - - private isContinuable: boolean = true; - private isEndGameByTime: boolean = false; - private currentState: PanelState = PanelState.NotShowing; - - // Texts - @property(Label) - private yourScoreTxt: Label = null; - @property(Label) - private topScoreTxt: Label = null; - @property(Label) - private continueTxt: Label = null; - @property(Label) - private countdownToReplayTxt: Label = null; - - // Buttons - @property(Button) - private yesBtn: Label = null; - @property(Button) - private noBtn: Label = null; - - // Panel - @property(Node) - private compareScorePnl: Node = null; - @property(Node) - private continuePnl: Node = null; - @property(Node) - private finalResultPnl: Node = null; - - private eventRevive = new EventTarget(); - - //#region Cocos methods - protected onEnable(): void { - this.Setup(); - this.currentCD = this.countdownTime; - } - protected update(dt: number): void { - if (this.isEndGameByTime == true) return; - - this.currentCD -= dt; - this.countdownToReplayTxt.string = Math.round(this.currentCD).toString(); - - if (this.currentCD <= 0 && !this.isEndGameByTime) { - this.currentCD = 0; - this.ChangeState(PanelState.ShowResult); - this.isEndGameByTime = true; - } - } - //#endregion - - private Setup(): void { - if (this.isContinuable) this.ChangeState(PanelState.CompareScore); - else this.ChangeState(PanelState.ShowResult); - } - - private ChangeState(newState: PanelState): void { - if (this.currentState == newState) return; - - this.currentState = newState; - switch (this.currentState) { - case PanelState.CompareScore: - this.TurnOffAllPanels(this.compareScorePnl); - var totalScore = GameManager.instance.score; - this.yourScoreTxt.string = 'Your score: ' + totalScore; - - /// Todo: set top score here - break; - case PanelState.Continue: - this.TurnOffAllPanels(this.continuePnl); - var ticket = BEConnector.instance.numberTicket; - - if (ticket >= BEConnector.instance.getTicketCanBeMinus()) { - this.continueTxt.string = - 'To continue playing, you will be deducted ' + ticket + ' Extras. Do you want to proceed?'; - } else { - this.continueTxt.string = - "You don't have enough Extras to continue playing. Would you like to buy more tickets?"; - } - break; - case PanelState.ShowResult: - this.yesBtn.node.active = false; - this.noBtn.node.active = false; - this.countdownToReplayTxt.node.active = false; - - this.TurnOffAllPanels(this.finalResultPnl); - BEConnector.instance.postScoreToServer(GameManager.instance.score); - break; - } - } - private TurnOffAllPanels(activePnl: Node): void { - this.compareScorePnl.active = false; - this.continuePnl.active = false; - this.finalResultPnl.active = false; - if (activePnl != null) activePnl.active = true; - } - - public YesNoClick(e: EventTouch, yesNoString: string): void { - var isYesClick = true; - if (yesNoString == 'true') isYesClick = true; - else isYesClick = false; - - switch (this.currentState) { - case PanelState.CompareScore: - if (isYesClick) this.ChangeState(PanelState.Continue); - else this.ChangeState(PanelState.ShowResult); - break; - case PanelState.Continue: - if (isYesClick) { - var ticket = BEConnector.instance.getTicketCanBeMinus(); - if (BEConnector.instance.numberTicket >= ticket) { - GameManager.instance.onRevive(); - BEConnector.instance.ticketMinus('revive'); - this.isContinuable = false; - } else BEConnector.instance.postMessage(); - } else { - this.ChangeState(PanelState.CompareScore); - } - break; - } - } -} diff --git a/assets/_Game/Scripts/UI/GameOverPanel.ts b/assets/_Game/Scripts/UI/GameOverPanel.ts new file mode 100644 index 0000000..7fc2470 --- /dev/null +++ b/assets/_Game/Scripts/UI/GameOverPanel.ts @@ -0,0 +1,34 @@ +import { _decorator, Component, Label, Node } from 'cc'; +import BEConnector from '../API/BEConnector'; +import { GameManager } from '../Manager/GameManager'; +const { ccclass, property } = _decorator; + +@ccclass('GameOverPanel') +export class GameOverPanel extends Component { + @property(Label) private topScore: Label = null; + @property(Label) private yourScore: Label = null; + @property(Node) private confirmPanel: Node = null; + + protected onEnable(): void { + let currentScore = BEConnector.instance.currentScore + GameManager.instance.score; + this.topScore.string = BEConnector.instance.maxScore.toString(); + this.yourScore.string = currentScore.toString(); + this.scheduleOnce(this.endGame, 60); + } + + onClickYesButton() { + this.confirmPanel.active = true; + } + + onClickNoButton() { + GameManager.instance.gameOver(); + } + + protected onDisable(): void { + this.unschedule(this.endGame); + } + + private endGame() { + GameManager.instance.gameOver(); + } +} diff --git a/assets/_Game/Scripts/UI/GameOverPanel.ts.meta b/assets/_Game/Scripts/UI/GameOverPanel.ts.meta new file mode 100644 index 0000000..d706532 --- /dev/null +++ b/assets/_Game/Scripts/UI/GameOverPanel.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "c5e2d9b4-a975-4eb8-a3f5-8eeeeec8cb49", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/_Game/Scripts/UI/UIController.ts b/assets/_Game/Scripts/UI/UIController.ts index 4898e18..2f755ab 100644 --- a/assets/_Game/Scripts/UI/UIController.ts +++ b/assets/_Game/Scripts/UI/UIController.ts @@ -3,6 +3,8 @@ import { EventManger } from '../Manager/EventManger'; import GameEvent from '../Events/GameEvent'; import ScoreType from '../Enum/ScoreType'; import GameState from '../Enum/GameState'; +import { GameManager } from '../Manager/GameManager'; +import BEConnector from '../API/BEConnector'; const { ccclass, property } = _decorator; @ccclass('UIController') @@ -13,6 +15,8 @@ export class UIController extends Component { private _eventLabel: Label; @property({ type: Label, visible: true }) private _resultLabel: Label; + @property({ type: Label, visible: true }) + private _resultTotalLabel: Label; @property({ type: ParticleSystem, visible: true }) private _buffFx: ParticleSystem; @property({ type: Node, visible: true }) @@ -21,10 +25,8 @@ export class UIController extends Component { private _overPanel: Node; @property({ type: Label, visible: true }) private _timeLabe: Label; - @property({ type: Label, visible: true }) - private _timeResult: Label; - private _timer = 0; - private _playing = false; + @property({ type: Node, visible: true }) + private _resultPanel: Node = null; protected async onLoad() { EventManger.instance.on(GameEvent.Score, this.onScore, this); @@ -35,10 +37,6 @@ export class UIController extends Component { this._eventLabel.string = ''; } - protected update(dt: number): void { - if (this._playing) this._timer += dt; - } - private async onScore(score: number, type: ScoreType) { this._scoreLabel.string = `Score: ${score}`; if (type == ScoreType.Goal) { @@ -76,18 +74,25 @@ export class UIController extends Component { this._startPanel.active = true; break; case GameState.Playing: - this._timer = 0; - this._playing = true; this._scoreLabel.string = 'Score: 0'; this._startPanel.active = false; this._overPanel.active = false; break; case GameState.GameOver: this._buffFx.stop(); - this._playing = false; this._overPanel.active = true; this._resultLabel.string = this._scoreLabel.string; - this._timeResult.string = this.secondsToTime(this._timer); + break; + case GameState.End: + this._overPanel.active = false; + this._resultPanel.active = true; + this._resultLabel.string = GameManager.instance.score.toString(); + this._resultTotalLabel.string = ( + GameManager.instance.score + BEConnector.instance.currentScore + ).toString(); + break; + case GameState.Relive: + this._overPanel.active = false; break; } }