diff --git a/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab b/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab new file mode 100644 index 0000000..ba11618 --- /dev/null +++ b/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab @@ -0,0 +1,403 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "timerNode", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false + }, + { + "__type__": "cc.Node", + "_name": "timerNode", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 8 + } + ], + "_active": true, + "_components": [ + { + "__id__": 14 + } + ], + "_prefab": { + "__id__": 16 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -600, + "y": 154, + "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": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "combtn1", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_prefab": { + "__id__": 7 + }, + "_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": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 4 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 184.59799999999998, + "height": 66.78595302783627 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7fwmu/a1VFRbVNDt+FBl5b" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 6 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "21c4e332-eafb-448b-a8fb-7f078bfa9c22@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "ab7N5x5xFOAYunjD4A1qsK" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "11ITMjcD1BjI9dKjatbFMA", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "timer", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 9 + }, + { + "__id__": 11 + } + ], + "_prefab": { + "__id__": 13 + }, + "_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": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": { + "__id__": 10 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 107.5, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f0UMy7wylJZZdkvBPwoWrg" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": { + "__id__": 12 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 39, + "g": 39, + "b": 39, + "a": 255 + }, + "_string": "03:00", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "f40babd5-d5a5-4df0-ae5c-6d5c04f6f25b", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": -2 + }, + "_shadowBlur": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "15R0OIE3tBfLBVlO7Mkd8W" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "f5SpsjSWJEbqADlm7ULGEf", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 196.315, + "height": 90.053 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "90cie1v9NBpYrDMuqJ6qtA" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "36/YoP/aJHo5U6akto3lXB", + "targetOverrides": null + } +] \ No newline at end of file diff --git a/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab.meta b/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab.meta new file mode 100644 index 0000000..1579728 --- /dev/null +++ b/tgx-games-client/assets/module_arean/common/prefabs/timerNode.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.50", + "importer": "prefab", + "imported": true, + "uuid": "e0258a83-5ef1-470b-abcf-9e10180d864e", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "timerNode" + } +} diff --git a/tgx-games-client/assets/module_arean/level1/Script/WoodenManGame.ts b/tgx-games-client/assets/module_arean/level1/Script/WoodenManGame.ts index 3b04082..06ce59f 100644 --- a/tgx-games-client/assets/module_arean/level1/Script/WoodenManGame.ts +++ b/tgx-games-client/assets/module_arean/level1/Script/WoodenManGame.ts @@ -33,6 +33,8 @@ export class WoodenManGame extends Component { @property(Node) guiNode: Node = null; // ui节点 + @property(Label) + timerLabel: Label = null!; // 倒计时文本显示 private turnAnimationDuration: number = 0.3; // 转身动画持续时间 private readonly TURN_BACK_DELAY = 2; // 转回正面的延迟时间 @@ -45,8 +47,10 @@ export class WoodenManGame extends Component { readonly maxRoleId: number = 5; readonly REQUIRED_QUALIFIED = 10; // 需要晋级的人数 qualifiedCount: number = 0; // 已晋级人数 - gameTimer: number = 180; // 游戏时间(3分钟) + gameTimer: number = 120; // 游戏时间(2分钟) isGameOver: boolean = false; // 游戏是否结束 + private isCountdownStarted: boolean = false; // 是否已开始倒计时 + private startDelay: number = 0; // 延迟多久开始倒计时 @property(Node) warningLightsNode: Node = null; // 三个警示灯的父节点 @@ -78,7 +82,6 @@ export class WoodenManGame extends Component { async start() { await this.initPlayers(); - this.schedule(this.updateGameTimer, 1); this.updateWinCount(); tgxAudioMgr.inst.play(EMusicDefine.MUSIC_BGM_BATTLE, 1, ModuleDef.BASIC); // 修改按钮事件监听 @@ -89,12 +92,22 @@ export class WoodenManGame extends Component { this.stopButton.on(Node.EventType.TOUCH_CANCEL, this.onStopButtonRelease, this); } + // 初始化计时器显示 + if (this.timerLabel) { + this.updateTimerDisplay(); + } + // 延迟3秒后开始第一次转身 this.scheduleOnce(() => { this.isGameStarted = true; // 标记游戏开始 // 显示停止按钮 this.guiNode.getComponent(Animation).play("showUI"); this.executeTurnBackPhase(true); + + // 开始倒计时 + this.scheduleOnce(() => { + this.startCountdown(); + }, this.startDelay); }, 12); // 延长等待时间,等摄像机序列播放完 } @@ -379,6 +392,7 @@ export class WoodenManGame extends Component { if (this.isGameOver) return; this.isGameOver = true; + this.isCountdownStarted = false; this.unscheduleAllCallbacks(); // 停止所有定时器 @@ -536,9 +550,11 @@ export class WoodenManGame extends Component { // 更新游戏时间 private updateGameTimer() { - if (this.isGameOver) return; + if (this.isGameOver || !this.isCountdownStarted) return; this.gameTimer--; + this.updateTimerDisplay(); + if (this.gameTimer <= 0) { this.endGame('时间到!游戏结束'); } @@ -585,4 +601,23 @@ export class WoodenManGame extends Component { // 开始点亮第一个灯 lightInterval(); } + + // 开始倒计时 + private startCountdown() { + this.isCountdownStarted = true; + this.unschedule(this.updateGameTimer); // 确保不会重复计时 + this.schedule(this.updateGameTimer, 1); + this.updateTimerDisplay(); + } + + // 更新计时器显示 + private updateTimerDisplay() { + if (!this.timerLabel) return; + + const minutes = Math.floor(this.gameTimer / 60); + const seconds = this.gameTimer % 60; + + // 格式化为 "xx:xx" + this.timerLabel.string = `${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`; + } } \ No newline at end of file diff --git a/tgx-games-client/assets/module_arean/level1/anim/showUI.anim b/tgx-games-client/assets/module_arean/level1/anim/showUI.anim index 6b5dd1c..07f1154 100644 --- a/tgx-games-client/assets/module_arean/level1/anim/showUI.anim +++ b/tgx-games-client/assets/module_arean/level1/anim/showUI.anim @@ -28,13 +28,16 @@ }, { "__id__": 39 + }, + { + "__id__": 51 } ], "_exoticAnimation": null, "_events": [], "_embeddedPlayers": [], "_additiveSettings": { - "__id__": 51 + "__id__": 62 }, "_auxiliaryCurveEntries": [] }, @@ -811,6 +814,192 @@ "preExtrapolation": 1, "postExtrapolation": 1 }, + { + "__type__": "cc.animation.VectorTrack", + "_binding": { + "__type__": "cc.animation.TrackBinding", + "path": { + "__id__": 52 + }, + "proxy": null + }, + "_channels": [ + { + "__id__": 54 + }, + { + "__id__": 56 + }, + { + "__id__": 58 + }, + { + "__id__": 60 + } + ], + "_nComponents": 3 + }, + { + "__type__": "cc.animation.TrackPath", + "_paths": [ + { + "__id__": 53 + }, + "position" + ] + }, + { + "__type__": "cc.animation.HierarchyPath", + "path": "topUI/timerNode" + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 55 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.08333333333333333 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -600, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": -600, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 57 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.08333333333333333 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 801.88, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 656.97, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 59 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [ + 0, + 0.08333333333333333 + ], + "_values": [ + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 0, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + }, + { + "__type__": "cc.RealKeyframeValue", + "interpolationMode": 0, + "tangentWeightMode": 0, + "value": 0, + "rightTangent": 0, + "rightTangentWeight": 1, + "leftTangent": 0, + "leftTangentWeight": 1, + "easingMethod": 0, + "__editorExtras__": { + "tangentMode": 0 + } + } + ], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, + { + "__type__": "cc.animation.Channel", + "_curve": { + "__id__": 61 + } + }, + { + "__type__": "cc.RealCurve", + "_times": [], + "_values": [], + "preExtrapolation": 1, + "postExtrapolation": 1 + }, { "__type__": "cc.AnimationClipAdditiveSettings", "enabled": false, diff --git a/tgx-games-client/assets/module_arean/level1/scene/WoodenManScene.scene b/tgx-games-client/assets/module_arean/level1/scene/WoodenManScene.scene index 0f573a4..3d95a09 100644 --- a/tgx-games-client/assets/module_arean/level1/scene/WoodenManScene.scene +++ b/tgx-games-client/assets/module_arean/level1/scene/WoodenManScene.scene @@ -26,13 +26,13 @@ "__id__": 9 }, { - "__id__": 176 + "__id__": 184 } ], "_active": true, "_components": [], "_prefab": { - "__id__": 178 + "__id__": 186 }, "_lpos": { "__type__": "cc.Vec3", @@ -63,7 +63,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 188 + "__id__": 198 }, "_id": "911a405a-c484-4e78-871b-381278dfe518" }, @@ -178,7 +178,7 @@ "__id__": 6 }, { - "__id__": 175 + "__id__": 183 } ], "_prefab": null, @@ -231,22 +231,23 @@ "aliveCountLabel": null, "winCountLabel": null, "playersNode": { - "__id__": 164 + "__id__": 172 }, "localPlayerNode": { - "__id__": 108 + "__id__": 116 }, "guiNode": { "__id__": 10 }, + "timerLabel": null, "warningLightsNode": { "__id__": 62 }, "stopButton": { - "__id__": 78 + "__id__": 86 }, "goAnim": { - "__id__": 97 + "__id__": 105 }, "_id": "0fMSr7jAhGraL64aiDSukb" }, @@ -257,7 +258,7 @@ "__id__": 8 }, "_prefab": { - "__id__": 165 + "__id__": 173 }, "__editorExtras__": {} }, @@ -271,25 +272,25 @@ }, "_children": [ { - "__id__": 104 + "__id__": 112 }, { - "__id__": 129 + "__id__": 137 }, { - "__id__": 108 + "__id__": 116 }, { "__id__": 7 }, - { - "__id__": 148 - }, { "__id__": 156 }, { "__id__": 164 + }, + { + "__id__": 172 } ], "_active": true, @@ -388,22 +389,22 @@ "__id__": 13 }, { - "__id__": 77 + "__id__": 85 } ], "_active": true, "_components": [ { - "__id__": 100 + "__id__": 108 }, { - "__id__": 101 + "__id__": 109 }, { - "__id__": 102 + "__id__": 110 }, { - "__id__": 103 + "__id__": 111 } ], "_prefab": null, @@ -550,15 +551,18 @@ }, { "__id__": 62 + }, + { + "__id__": 75 } ], "_active": true, "_components": [ { - "__id__": 75 + "__id__": 83 }, { - "__id__": 76 + "__id__": 84 } ], "_prefab": null, @@ -1886,6 +1890,117 @@ "_atlas": null, "_id": "129Iqb1ONJz4Ne7086Jb1Y" }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 13 + }, + "_prefab": { + "__id__": 76 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 75 + }, + "asset": { + "__uuid__": "e0258a83-5ef1-470b-abcf-9e10180d864e", + "__expectedType__": "cc.Prefab" + }, + "fileId": "36/YoP/aJHo5U6akto3lXB", + "instance": { + "__id__": 77 + }, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "52Ml99JVlELrwfecm9wYEI", + "prefabRootNode": null, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 78 + }, + { + "__id__": 80 + }, + { + "__id__": 81 + }, + { + "__id__": 82 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 79 + }, + "propertyPath": [ + "_name" + ], + "value": "timerNode" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "36/YoP/aJHo5U6akto3lXB" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 79 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": -600, + "y": 801.88, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 79 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 79 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, { "__type__": "cc.UITransform", "_name": "", @@ -1948,19 +2063,19 @@ }, "_children": [ { - "__id__": 78 + "__id__": 86 }, { - "__id__": 89 + "__id__": 97 } ], "_active": true, "_components": [ { - "__id__": 98 + "__id__": 106 }, { - "__id__": 99 + "__id__": 107 } ], "_prefab": null, @@ -1999,29 +2114,29 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 77 + "__id__": 85 }, "_children": [ { - "__id__": 79 + "__id__": 87 }, { - "__id__": 82 + "__id__": 90 } ], "_active": true, "_components": [ { - "__id__": 85 + "__id__": 93 }, { - "__id__": 86 + "__id__": 94 }, { - "__id__": 87 + "__id__": 95 }, { - "__id__": 88 + "__id__": 96 } ], "_prefab": null, @@ -2060,16 +2175,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 78 + "__id__": 86 }, "_children": [], "_active": true, "_components": [ { - "__id__": 80 + "__id__": 88 }, { - "__id__": 81 + "__id__": 89 } ], "_prefab": null, @@ -2108,7 +2223,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 87 }, "_enabled": true, "__prefab": null, @@ -2130,7 +2245,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 79 + "__id__": 87 }, "_enabled": true, "__prefab": null, @@ -2169,16 +2284,16 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 78 + "__id__": 86 }, "_children": [], "_active": true, "_components": [ { - "__id__": 83 + "__id__": 91 }, { - "__id__": 84 + "__id__": 92 } ], "_prefab": null, @@ -2217,7 +2332,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 82 + "__id__": 90 }, "_enabled": true, "__prefab": null, @@ -2239,7 +2354,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 82 + "__id__": 90 }, "_enabled": true, "__prefab": null, @@ -2304,7 +2419,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 86 }, "_enabled": true, "__prefab": null, @@ -2326,7 +2441,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 86 }, "_enabled": true, "__prefab": null, @@ -2380,7 +2495,7 @@ "_duration": 0.1, "_zoomScale": 0.95, "_target": { - "__id__": 78 + "__id__": 86 }, "_id": "aaB/GYJ/FCxKnw9WMpsUwf" }, @@ -2390,7 +2505,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 86 }, "_enabled": false, "__prefab": null, @@ -2420,7 +2535,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 78 + "__id__": 86 }, "_enabled": true, "__prefab": null, @@ -2456,23 +2571,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 77 + "__id__": 85 }, "_children": [ { - "__id__": 90 + "__id__": 98 }, { - "__id__": 93 + "__id__": 101 } ], "_active": true, "_components": [ { - "__id__": 96 + "__id__": 104 }, { - "__id__": 97 + "__id__": 105 } ], "_prefab": null, @@ -2511,16 +2626,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 89 + "__id__": 97 }, "_children": [], "_active": true, "_components": [ { - "__id__": 91 + "__id__": 99 }, { - "__id__": 92 + "__id__": 100 } ], "_prefab": null, @@ -2559,7 +2674,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 98 }, "_enabled": true, "__prefab": null, @@ -2581,7 +2696,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 90 + "__id__": 98 }, "_enabled": true, "__prefab": null, @@ -2646,16 +2761,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 89 + "__id__": 97 }, "_children": [], "_active": true, "_components": [ { - "__id__": 94 + "__id__": 102 }, { - "__id__": 95 + "__id__": 103 } ], "_prefab": null, @@ -2694,7 +2809,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 101 }, "_enabled": true, "__prefab": null, @@ -2716,7 +2831,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 101 }, "_enabled": true, "__prefab": null, @@ -2781,7 +2896,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 89 + "__id__": 97 }, "_enabled": true, "__prefab": null, @@ -2803,7 +2918,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 89 + "__id__": 97 }, "_enabled": true, "__prefab": null, @@ -2826,7 +2941,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 85 }, "_enabled": true, "__prefab": null, @@ -2848,7 +2963,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 85 }, "_enabled": true, "__prefab": null, @@ -2973,16 +3088,16 @@ }, "_children": [ { - "__id__": 105 + "__id__": 113 }, { - "__id__": 126 + "__id__": 134 } ], "_active": true, "_components": [ { - "__id__": 128 + "__id__": 136 } ], "_prefab": null, @@ -3021,16 +3136,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 104 + "__id__": 112 }, "_children": [], "_active": true, "_components": [ { - "__id__": 106 + "__id__": 114 }, { - "__id__": 107 + "__id__": 115 } ], "_prefab": null, @@ -3069,7 +3184,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 113 }, "_enabled": true, "__prefab": null, @@ -3115,12 +3230,12 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 113 }, "_enabled": true, "__prefab": null, "targetNode": { - "__id__": 108 + "__id__": 116 }, "FINISH_POINT": { "__type__": "cc.Vec3", @@ -3137,14 +3252,14 @@ "__id__": 8 }, "_prefab": { - "__id__": 109 + "__id__": 117 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 108 + "__id__": 116 }, "asset": { "__uuid__": "b91905ff-fb95-4680-bcd6-5603f2b07dee", @@ -3152,7 +3267,7 @@ }, "fileId": "c5/G3wUJ1HoaT+UobgHLY5", "instance": { - "__id__": 110 + "__id__": 118 }, "targetOverrides": null }, @@ -3163,27 +3278,27 @@ "mountedChildren": [], "mountedComponents": [ { - "__id__": 111 + "__id__": 119 } ], "propertyOverrides": [ - { - "__id__": 114 - }, - { - "__id__": 116 - }, - { - "__id__": 118 - }, - { - "__id__": 120 - }, { "__id__": 122 }, { "__id__": 124 + }, + { + "__id__": 126 + }, + { + "__id__": 128 + }, + { + "__id__": 130 + }, + { + "__id__": 132 } ], "removedComponents": [] @@ -3191,11 +3306,11 @@ { "__type__": "cc.MountedComponentsInfo", "targetInfo": { - "__id__": 112 + "__id__": 120 }, "components": [ { - "__id__": 113 + "__id__": 121 } ] }, @@ -3211,11 +3326,11 @@ "_objFlags": 0, "__editorExtras__": { "mountedRoot": { - "__id__": 108 + "__id__": 116 } }, "node": { - "__id__": 108 + "__id__": 116 }, "_enabled": true, "__prefab": null, @@ -3225,7 +3340,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 115 + "__id__": 123 }, "propertyPath": [ "_name" @@ -3241,7 +3356,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 117 + "__id__": 125 }, "propertyPath": [ "_lpos" @@ -3262,7 +3377,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 119 + "__id__": 127 }, "propertyPath": [ "_lrot" @@ -3284,7 +3399,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 121 + "__id__": 129 }, "propertyPath": [ "_euler" @@ -3305,7 +3420,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 123 + "__id__": 131 }, "propertyPath": [ "playOnLoad" @@ -3322,7 +3437,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 125 + "__id__": 133 }, "propertyPath": [ "_lpos" @@ -3346,13 +3461,13 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 104 + "__id__": 112 }, "_children": [], "_active": true, "_components": [ { - "__id__": 127 + "__id__": 135 } ], "_prefab": null, @@ -3391,7 +3506,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 126 + "__id__": 134 }, "_enabled": true, "__prefab": null, @@ -3437,7 +3552,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 104 + "__id__": 112 }, "_enabled": true, "__prefab": null, @@ -3461,14 +3576,14 @@ "__id__": 8 }, "_prefab": { - "__id__": 130 + "__id__": 138 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 129 + "__id__": 137 }, "asset": { "__uuid__": "cc669726-1f46-4a7d-b03f-c46640ce3cfa@5d70b", @@ -3476,7 +3591,7 @@ }, "fileId": "dfz4v2h/1SFZJDKjIvxkO+", "instance": { - "__id__": 131 + "__id__": 139 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3489,25 +3604,7 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 132 - }, - { - "__id__": 134 - }, - { - "__id__": 135 - }, - { - "__id__": 136 - }, - { - "__id__": 137 - }, - { - "__id__": 139 - }, - { - "__id__": 141 + "__id__": 140 }, { "__id__": 142 @@ -3522,7 +3619,25 @@ "__id__": 145 }, { - "__id__": 146 + "__id__": 147 + }, + { + "__id__": 149 + }, + { + "__id__": 150 + }, + { + "__id__": 151 + }, + { + "__id__": 152 + }, + { + "__id__": 153 + }, + { + "__id__": 154 } ], "removedComponents": [] @@ -3530,7 +3645,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_name" @@ -3546,7 +3661,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_lpos" @@ -3561,7 +3676,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_lrot" @@ -3577,7 +3692,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_euler" @@ -3592,7 +3707,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 138 + "__id__": 146 }, "propertyPath": [ "_active" @@ -3608,7 +3723,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_active" @@ -3624,7 +3739,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 138 + "__id__": 146 }, "propertyPath": [ "_lpos" @@ -3639,7 +3754,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_active" @@ -3649,7 +3764,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_layer" @@ -3659,7 +3774,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_layer" @@ -3669,7 +3784,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 138 + "__id__": 146 }, "propertyPath": [ "_layer" @@ -3679,7 +3794,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 147 + "__id__": 155 }, "propertyPath": [ "_shadowCastingMode" @@ -3692,116 +3807,6 @@ "ad0zfzK2NbL4uP/V/XM6JX" ] }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 8 - }, - "_prefab": { - "__id__": 149 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 148 - }, - "asset": { - "__uuid__": "b19b3763-d300-454a-a89d-31df66ba8eea", - "__expectedType__": "cc.Prefab" - }, - "fileId": "c5/G3wUJ1HoaT+UobgHLY5", - "instance": { - "__id__": 150 - }, - "targetOverrides": [] - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "c3g0bbR5hMvoPZxS/qry7q", - "prefabRootNode": null, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 151 - }, - { - "__id__": 153 - }, - { - "__id__": 154 - }, - { - "__id__": 155 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 152 - }, - "propertyPath": [ - "_name" - ], - "value": "red_b" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "c5/G3wUJ1HoaT+UobgHLY5" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 152 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": 2.536, - "y": 0, - "z": -50 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 152 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 152 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, { "__type__": "cc.Node", "_objFlags": 0, @@ -3830,7 +3835,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "bcdPQwnNRBFp9nnmIblH1H", + "fileId": "c3g0bbR5hMvoPZxS/qry7q", "prefabRootNode": null, "mountedChildren": [], "mountedComponents": [], @@ -3858,7 +3863,7 @@ "propertyPath": [ "_name" ], - "value": "red_b2" + "value": "red_b" }, { "__type__": "cc.TargetInfo", @@ -3876,7 +3881,7 @@ ], "value": { "__type__": "cc.Vec3", - "x": -2.593, + "x": 2.536, "y": 0, "z": -50 } @@ -3912,6 +3917,116 @@ "z": 0 } }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_prefab": { + "__id__": 165 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 164 + }, + "asset": { + "__uuid__": "b19b3763-d300-454a-a89d-31df66ba8eea", + "__expectedType__": "cc.Prefab" + }, + "fileId": "c5/G3wUJ1HoaT+UobgHLY5", + "instance": { + "__id__": 166 + }, + "targetOverrides": [] + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "bcdPQwnNRBFp9nnmIblH1H", + "prefabRootNode": null, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 167 + }, + { + "__id__": 169 + }, + { + "__id__": 170 + }, + { + "__id__": 171 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 168 + }, + "propertyPath": [ + "_name" + ], + "value": "red_b2" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "c5/G3wUJ1HoaT+UobgHLY5" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 168 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": -2.593, + "y": 0, + "z": -50 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 168 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 168 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, { "__type__": "cc.Node", "_name": "playersNode", @@ -3964,7 +4079,7 @@ }, "fileId": "c5/G3wUJ1HoaT+UobgHLY5", "instance": { - "__id__": 166 + "__id__": 174 }, "targetOverrides": null }, @@ -3976,16 +4091,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 167 + "__id__": 175 }, { - "__id__": 169 + "__id__": 177 }, { - "__id__": 171 + "__id__": 179 }, { - "__id__": 173 + "__id__": 181 } ], "removedComponents": [] @@ -3993,7 +4108,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 168 + "__id__": 176 }, "propertyPath": [ "_name" @@ -4009,7 +4124,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 170 + "__id__": 178 }, "propertyPath": [ "_lpos" @@ -4030,7 +4145,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 172 + "__id__": 180 }, "propertyPath": [ "_lrot" @@ -4052,7 +4167,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 174 + "__id__": 182 }, "propertyPath": [ "_euler" @@ -4081,15 +4196,15 @@ "_enabled": false, "__prefab": null, "camera": { - "__id__": 127 + "__id__": 135 }, "defaultTransitionTime": 2, "defaultStayTime": 3, "defaultCamera": { - "__id__": 105 + "__id__": 113 }, "deadCamera": { - "__id__": 126 + "__id__": 134 }, "_id": "c4Ky48chhHsZEYE9DJ8jwB" }, @@ -4105,7 +4220,7 @@ "_active": true, "_components": [ { - "__id__": 177 + "__id__": 185 } ], "_prefab": null, @@ -4144,7 +4259,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 176 + "__id__": 184 }, "_enabled": true, "__prefab": null, @@ -4165,33 +4280,36 @@ "instance": null, "targetOverrides": [ { - "__id__": 179 + "__id__": 187 }, { - "__id__": 182 + "__id__": 190 }, { - "__id__": 184 + "__id__": 192 }, { - "__id__": 186 + "__id__": 194 + }, + { + "__id__": 196 } ], "nestedPrefabInstanceRoots": [ { - "__id__": 129 + "__id__": 137 }, { - "__id__": 108 + "__id__": 116 }, { "__id__": 7 }, { - "__id__": 148 + "__id__": 156 }, { - "__id__": 156 + "__id__": 164 }, { "__id__": 22 @@ -4201,6 +4319,9 @@ }, { "__id__": 45 + }, + { + "__id__": 75 } ] }, @@ -4210,7 +4331,7 @@ "__id__": 13 }, "sourceInfo": { - "__id__": 180 + "__id__": 188 }, "propertyPath": [ "_target" @@ -4219,7 +4340,7 @@ "__id__": 13 }, "targetInfo": { - "__id__": 181 + "__id__": 189 } }, { @@ -4247,7 +4368,7 @@ "__id__": 22 }, "targetInfo": { - "__id__": 183 + "__id__": 191 } }, { @@ -4259,17 +4380,17 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 113 + "__id__": 121 }, "sourceInfo": null, "propertyPath": [ "buttonLabel" ], "target": { - "__id__": 78 + "__id__": 86 }, "targetInfo": { - "__id__": 185 + "__id__": 193 } }, { @@ -4291,7 +4412,7 @@ "__id__": 45 }, "targetInfo": { - "__id__": 187 + "__id__": 195 } }, { @@ -4300,31 +4421,53 @@ "71U4EXNK5Psbigs/vuoZeN" ] }, + { + "__type__": "cc.TargetOverrideInfo", + "source": { + "__id__": 6 + }, + "sourceInfo": null, + "propertyPath": [ + "timerLabel" + ], + "target": { + "__id__": 75 + }, + "targetInfo": { + "__id__": 197 + } + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "15R0OIE3tBfLBVlO7Mkd8W" + ] + }, { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 189 + "__id__": 199 }, "shadows": { - "__id__": 190 + "__id__": 200 }, "_skybox": { - "__id__": 191 + "__id__": 201 }, "fog": { - "__id__": 192 + "__id__": 202 }, "octree": { - "__id__": 193 + "__id__": 203 }, "skin": { - "__id__": 194 + "__id__": 204 }, "lightProbeInfo": { - "__id__": 195 + "__id__": 205 }, "postSettings": { - "__id__": 197 + "__id__": 207 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false @@ -4476,7 +4619,7 @@ "_showWireframe": true, "_showConvex": false, "_data": { - "__id__": 196 + "__id__": 206 }, "_lightProbeSphereVolume": 1 }, diff --git a/tgx-games-client/assets/module_arean/level2/Script/RopeGame.ts b/tgx-games-client/assets/module_arean/level2/Script/RopeGame.ts index ac724e2..31b274f 100644 --- a/tgx-games-client/assets/module_arean/level2/Script/RopeGame.ts +++ b/tgx-games-client/assets/module_arean/level2/Script/RopeGame.ts @@ -1,20 +1,114 @@ -import { _decorator, Component, Node, Animation } from 'cc'; +import { _decorator, Component, Node, Animation, Label, director } from 'cc'; const { ccclass, property } = _decorator; +enum GameState { + Playing, + Paused, + GameOver +} + @ccclass('GameManager') export class GameManager extends Component { @property({type: Animation}) cameraAnim: Animation = null!; + @property(Label) + timerLabel: Label = null!; // 倒计时文本显示 + + @property(Node) + guiNode: Node = null!; // UI节点 + + private gameState: GameState = GameState.Playing; + private countdownDuration: number = 120; // 3分钟 = 180秒 + private countdownRemaining: number = 120; + private isCountdownStarted: boolean = false; + private startDelay: number = 6; // 开场动画结束后延迟1.5秒开始 + private isGameOver: boolean = false; + start() { - // 游戏开始时播放相机动画 - if (this.cameraAnim) { - this.cameraAnim.play('camera1'); + this.initGame(); + } + + private initGame() { + // 初始化游戏状态 + this.gameState = GameState.Playing; + this.countdownRemaining = this.countdownDuration; + this.isCountdownStarted = false; + this.isGameOver = false; + + // 初始化计时器显示 + this.updateTimerDisplay(); + + this.scheduleOnce(() => { + this.startCountdown(); + }, this.startDelay); + } + + + private startCountdown() { + this.isCountdownStarted = true; + this.countdownRemaining = this.countdownDuration; + this.updateTimerDisplay(); + + // 每秒更新一次 + this.schedule(this.updateCountdown, 1); + } + + private updateCountdown() { + if (!this.isCountdownStarted || this.gameState !== GameState.Playing) return; + + this.countdownRemaining--; + this.updateTimerDisplay(); + + if (this.countdownRemaining <= 0) { + // 时间到,结束游戏 + this.unschedule(this.updateCountdown); + this.setGameOver(false); // 时间到算失败 } } - update(deltaTime: number) { + private updateTimerDisplay() { + if (!this.timerLabel) return; + + const minutes = Math.floor(this.countdownRemaining / 60); + const seconds = this.countdownRemaining % 60; + // 格式化为 "xx:xx" + this.timerLabel.string = `${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`; + } + + public setGameOver(isWin: boolean) { + if (this.isGameOver) return; + + this.isGameOver = true; + this.isCountdownStarted = false; + this.unschedule(this.updateCountdown); + this.gameState = GameState.GameOver; + + // 这里可以添加游戏结算逻辑 + console.log(`游戏结束,${isWin ? '胜利' : '失败'},剩余时间: ${this.countdownRemaining}秒`); + + // 这里可以添加显示结算界面的代码 + } + + // 可以添加其他游戏相关方法 + public pauseGame() { + if (this.gameState === GameState.Playing) { + this.gameState = GameState.Paused; + this.unschedule(this.updateCountdown); + } + } + + public resumeGame() { + if (this.gameState === GameState.Paused) { + this.gameState = GameState.Playing; + this.schedule(this.updateCountdown, 1); + } + } + + onDestroy() { + // 清理定时器 + this.unscheduleAllCallbacks(); } } diff --git a/tgx-games-client/assets/module_arean/level2/res.meta b/tgx-games-client/assets/module_arean/level2/res.meta new file mode 100644 index 0000000..2cb412e --- /dev/null +++ b/tgx-games-client/assets/module_arean/level2/res.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "e15fc82a-cf6b-411a-b13a-f48806e54313", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/tgx-games-client/assets/module_arean/level2/scene/level2Scene.scene b/tgx-games-client/assets/module_arean/level2/scene/level2Scene.scene index a98127a..66dcd9b 100644 --- a/tgx-games-client/assets/module_arean/level2/scene/level2Scene.scene +++ b/tgx-games-client/assets/module_arean/level2/scene/level2Scene.scene @@ -32,7 +32,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 1564 + "__id__": 1572 }, "_lpos": { "__type__": "cc.Vec3", @@ -63,7 +63,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 1571 + "__id__": 1581 }, "_id": "f6f19090-2e79-459f-9613-17257cc654f7" }, @@ -525,11 +525,13 @@ "node": { "__id__": 5 }, - "_enabled": false, + "_enabled": true, "__prefab": null, "cameraAnim": { "__id__": 12 }, + "timerLabel": null, + "guiNode": null, "_id": "c49ytRg8VBzKpl6R0A9Tgp" }, { @@ -16149,10 +16151,10 @@ "__id__": 1439 }, { - "__id__": 1545 + "__id__": 1553 }, { - "__id__": 1553 + "__id__": 1561 }, { "__id__": 1448 @@ -16161,13 +16163,13 @@ "_active": true, "_components": [ { - "__id__": 1561 + "__id__": 1569 }, { - "__id__": 1562 + "__id__": 1570 }, { - "__id__": 1563 + "__id__": 1571 } ], "_prefab": null, @@ -16578,13 +16580,13 @@ "__id__": 1445 }, "blue": { - "__id__": 1536 + "__id__": 1544 }, "redScoreLabel": { - "__id__": 1539 + "__id__": 1547 }, "blueScoreLabel": { - "__id__": 1542 + "__id__": 1550 }, "guiNode": { "__id__": 1416 @@ -17319,7 +17321,7 @@ "_active": true, "_components": [ { - "__id__": 1544 + "__id__": 1552 }, { "__id__": 1445 @@ -17365,31 +17367,31 @@ }, "_children": [ { - "__id__": 1525 + "__id__": 1533 }, { - "__id__": 1528 + "__id__": 1536 }, { "__id__": 1446 }, { - "__id__": 1531 + "__id__": 1539 }, { - "__id__": 1534 + "__id__": 1542 }, { - "__id__": 1537 + "__id__": 1545 }, { - "__id__": 1540 + "__id__": 1548 } ], "_active": true, "_components": [ { - "__id__": 1543 + "__id__": 1551 } ], "_prefab": null, @@ -17434,23 +17436,26 @@ { "__id__": 1449 }, + { + "__id__": 1457 + }, { "__id__": 1447 }, { - "__id__": 1475 + "__id__": 1483 }, { - "__id__": 1509 + "__id__": 1517 } ], "_active": true, "_components": [ { - "__id__": 1523 + "__id__": 1531 }, { - "__id__": 1524 + "__id__": 1532 } ], "_prefab": null, @@ -17500,10 +17505,10 @@ "__id__": 1449 }, "asset": { - "__uuid__": "72bc384b-472d-49c2-aaae-ca409e6223fc", + "__uuid__": "e0258a83-5ef1-470b-abcf-9e10180d864e", "__expectedType__": "cc.Prefab" }, - "fileId": "274uCRqEJA+rlC0bXycjcw", + "fileId": "36/YoP/aJHo5U6akto3lXB", "instance": { "__id__": 1451 }, @@ -17512,7 +17517,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "918wZRqtRO8qzbjhvWPuBB", + "fileId": "e01kAx/QxFd4tH0wHpIn+2", "prefabRootNode": null, "mountedChildren": [], "mountedComponents": [], @@ -17528,36 +17533,6 @@ }, { "__id__": 1456 - }, - { - "__id__": 1457 - }, - { - "__id__": 1459 - }, - { - "__id__": 1461 - }, - { - "__id__": 1462 - }, - { - "__id__": 1463 - }, - { - "__id__": 1465 - }, - { - "__id__": 1467 - }, - { - "__id__": 1469 - }, - { - "__id__": 1471 - }, - { - "__id__": 1473 } ], "removedComponents": [] @@ -17570,12 +17545,12 @@ "propertyPath": [ "_name" ], - "value": "playerCount" + "value": "timerNode" }, { "__type__": "cc.TargetInfo", "localID": [ - "274uCRqEJA+rlC0bXycjcw" + "36/YoP/aJHo5U6akto3lXB" ] }, { @@ -17588,8 +17563,8 @@ ], "value": { "__type__": "cc.Vec3", - "x": -259.267, - "y": 154.822, + "x": -600, + "y": 154, "z": 0 } }, @@ -17624,10 +17599,151 @@ "z": 0 } }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 1448 + }, + "_prefab": { + "__id__": 1458 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1457 + }, + "asset": { + "__uuid__": "72bc384b-472d-49c2-aaae-ca409e6223fc", + "__expectedType__": "cc.Prefab" + }, + "fileId": "274uCRqEJA+rlC0bXycjcw", + "instance": { + "__id__": 1459 + }, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "918wZRqtRO8qzbjhvWPuBB", + "prefabRootNode": null, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 1460 + }, + { + "__id__": 1462 + }, + { + "__id__": 1463 + }, + { + "__id__": 1464 + }, + { + "__id__": 1465 + }, + { + "__id__": 1467 + }, + { + "__id__": 1469 + }, + { + "__id__": 1470 + }, + { + "__id__": 1471 + }, + { + "__id__": 1473 + }, + { + "__id__": 1475 + }, + { + "__id__": 1477 + }, + { + "__id__": 1479 + }, + { + "__id__": 1481 + } + ], + "removedComponents": [] + }, { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1458 + "__id__": 1461 + }, + "propertyPath": [ + "_name" + ], + "value": "playerCount" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "274uCRqEJA+rlC0bXycjcw" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 1461 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": -259.267, + "y": 154.822, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 1461 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 1461 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 1466 }, "propertyPath": [ "_string" @@ -17643,7 +17759,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1460 + "__id__": 1468 }, "propertyPath": [ "_contentSize" @@ -17663,7 +17779,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1453 + "__id__": 1461 }, "propertyPath": [ "_lscale" @@ -17678,7 +17794,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1453 + "__id__": 1461 }, "propertyPath": [ "_layer" @@ -17688,7 +17804,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1464 + "__id__": 1472 }, "propertyPath": [ "_layer" @@ -17704,7 +17820,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1466 + "__id__": 1474 }, "propertyPath": [ "_layer" @@ -17720,7 +17836,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1468 + "__id__": 1476 }, "propertyPath": [ "_layer" @@ -17736,7 +17852,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1470 + "__id__": 1478 }, "propertyPath": [ "_layer" @@ -17752,7 +17868,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1472 + "__id__": 1480 }, "propertyPath": [ "_layer" @@ -17768,7 +17884,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1474 + "__id__": 1482 }, "propertyPath": [ "_layer" @@ -17788,14 +17904,14 @@ "__id__": 1448 }, "_prefab": { - "__id__": 1476 + "__id__": 1484 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 1475 + "__id__": 1483 }, "asset": { "__uuid__": "6ad3de0d-23dc-4706-b60b-20ebab4c6031", @@ -17803,7 +17919,7 @@ }, "fileId": "274uCRqEJA+rlC0bXycjcw", "instance": { - "__id__": 1477 + "__id__": 1485 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -17815,33 +17931,21 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 1478 - }, - { - "__id__": 1480 - }, - { - "__id__": 1481 - }, - { - "__id__": 1482 - }, - { - "__id__": 1483 - }, - { - "__id__": 1484 - }, { "__id__": 1486 }, { "__id__": 1488 }, + { + "__id__": 1489 + }, { "__id__": 1490 }, + { + "__id__": 1491 + }, { "__id__": 1492 }, @@ -17852,22 +17956,34 @@ "__id__": 1496 }, { - "__id__": 1497 + "__id__": 1498 }, { - "__id__": 1499 + "__id__": 1500 }, { - "__id__": 1501 + "__id__": 1502 }, { - "__id__": 1503 + "__id__": 1504 }, { "__id__": 1505 }, { "__id__": 1507 + }, + { + "__id__": 1509 + }, + { + "__id__": 1511 + }, + { + "__id__": 1513 + }, + { + "__id__": 1515 } ], "removedComponents": [] @@ -17875,7 +17991,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_name" @@ -17891,7 +18007,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_lpos" @@ -17906,7 +18022,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_lrot" @@ -17922,7 +18038,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_euler" @@ -17937,7 +18053,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_lscale" @@ -17952,7 +18068,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1485 + "__id__": 1493 }, "propertyPath": [ "_string" @@ -17968,7 +18084,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1487 + "__id__": 1495 }, "propertyPath": [ "_contentSize" @@ -17988,7 +18104,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1489 + "__id__": 1497 }, "propertyPath": [ "_string" @@ -18004,7 +18120,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1491 + "__id__": 1499 }, "propertyPath": [ "_contentSize" @@ -18024,7 +18140,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1493 + "__id__": 1501 }, "propertyPath": [ "_contentSize" @@ -18044,7 +18160,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1495 + "__id__": 1503 }, "propertyPath": [ "_spriteFrame" @@ -18063,7 +18179,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1479 + "__id__": 1487 }, "propertyPath": [ "_layer" @@ -18073,7 +18189,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1498 + "__id__": 1506 }, "propertyPath": [ "_layer" @@ -18089,7 +18205,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1500 + "__id__": 1508 }, "propertyPath": [ "_layer" @@ -18105,7 +18221,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1502 + "__id__": 1510 }, "propertyPath": [ "_layer" @@ -18121,7 +18237,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1504 + "__id__": 1512 }, "propertyPath": [ "_layer" @@ -18137,7 +18253,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1506 + "__id__": 1514 }, "propertyPath": [ "_layer" @@ -18153,7 +18269,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1508 + "__id__": 1516 }, "propertyPath": [ "_layer" @@ -18173,14 +18289,14 @@ "__id__": 1448 }, "_prefab": { - "__id__": 1510 + "__id__": 1518 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 1509 + "__id__": 1517 }, "asset": { "__uuid__": "fc0d2216-f356-4506-b6b4-f2c69442df2a", @@ -18188,7 +18304,7 @@ }, "fileId": "96qYAwccJO06ZvJw7OTmwr", "instance": { - "__id__": 1511 + "__id__": 1519 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -18200,29 +18316,29 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 1512 - }, - { - "__id__": 1514 - }, - { - "__id__": 1515 - }, - { - "__id__": 1516 - }, - { - "__id__": 1517 - }, - { - "__id__": 1519 - }, { "__id__": 1520 }, { - "__id__": 1521 + "__id__": 1522 + }, + { + "__id__": 1523 + }, + { + "__id__": 1524 + }, + { + "__id__": 1525 + }, + { + "__id__": 1527 + }, + { + "__id__": 1528 + }, + { + "__id__": 1529 } ], "removedComponents": [] @@ -18230,7 +18346,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_name" @@ -18246,7 +18362,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_lpos" @@ -18261,7 +18377,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_lrot" @@ -18277,7 +18393,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_euler" @@ -18292,7 +18408,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1518 + "__id__": 1526 }, "propertyPath": [ "_string" @@ -18308,7 +18424,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_active" @@ -18318,7 +18434,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1513 + "__id__": 1521 }, "propertyPath": [ "_layer" @@ -18328,7 +18444,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 1522 + "__id__": 1530 }, "propertyPath": [ "_layer" @@ -18405,10 +18521,10 @@ "_active": false, "_components": [ { - "__id__": 1526 + "__id__": 1534 }, { - "__id__": 1527 + "__id__": 1535 } ], "_prefab": null, @@ -18447,7 +18563,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1525 + "__id__": 1533 }, "_enabled": true, "__prefab": null, @@ -18469,7 +18585,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1525 + "__id__": 1533 }, "_enabled": true, "__prefab": null, @@ -18514,10 +18630,10 @@ "_active": false, "_components": [ { - "__id__": 1529 + "__id__": 1537 }, { - "__id__": 1530 + "__id__": 1538 } ], "_prefab": null, @@ -18556,7 +18672,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1528 + "__id__": 1536 }, "_enabled": true, "__prefab": null, @@ -18578,7 +18694,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1528 + "__id__": 1536 }, "_enabled": true, "__prefab": null, @@ -18623,10 +18739,10 @@ "_active": true, "_components": [ { - "__id__": 1532 + "__id__": 1540 }, { - "__id__": 1533 + "__id__": 1541 } ], "_prefab": null, @@ -18665,7 +18781,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1531 + "__id__": 1539 }, "_enabled": true, "__prefab": null, @@ -18687,7 +18803,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1531 + "__id__": 1539 }, "_enabled": true, "__prefab": null, @@ -18732,10 +18848,10 @@ "_active": true, "_components": [ { - "__id__": 1535 + "__id__": 1543 }, { - "__id__": 1536 + "__id__": 1544 } ], "_prefab": null, @@ -18774,7 +18890,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1534 + "__id__": 1542 }, "_enabled": true, "__prefab": null, @@ -18796,7 +18912,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1534 + "__id__": 1542 }, "_enabled": true, "__prefab": null, @@ -18841,10 +18957,10 @@ "_active": false, "_components": [ { - "__id__": 1538 + "__id__": 1546 }, { - "__id__": 1539 + "__id__": 1547 } ], "_prefab": null, @@ -18883,7 +18999,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1537 + "__id__": 1545 }, "_enabled": true, "__prefab": null, @@ -18905,7 +19021,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1537 + "__id__": 1545 }, "_enabled": true, "__prefab": null, @@ -18976,10 +19092,10 @@ "_active": false, "_components": [ { - "__id__": 1541 + "__id__": 1549 }, { - "__id__": 1542 + "__id__": 1550 } ], "_prefab": null, @@ -19018,7 +19134,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1540 + "__id__": 1548 }, "_enabled": true, "__prefab": null, @@ -19040,7 +19156,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1540 + "__id__": 1548 }, "_enabled": true, "__prefab": null, @@ -19153,19 +19269,19 @@ }, "_children": [ { - "__id__": 1546 + "__id__": 1554 } ], "_active": false, "_components": [ { - "__id__": 1549 + "__id__": 1557 }, { - "__id__": 1550 + "__id__": 1558 }, { - "__id__": 1551 + "__id__": 1559 } ], "_prefab": null, @@ -19204,16 +19320,16 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 1545 + "__id__": 1553 }, "_children": [], "_active": true, "_components": [ { - "__id__": 1547 + "__id__": 1555 }, { - "__id__": 1548 + "__id__": 1556 } ], "_prefab": null, @@ -19252,7 +19368,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1546 + "__id__": 1554 }, "_enabled": true, "__prefab": null, @@ -19274,7 +19390,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1546 + "__id__": 1554 }, "_enabled": true, "__prefab": null, @@ -19339,7 +19455,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1545 + "__id__": 1553 }, "_enabled": true, "__prefab": null, @@ -19361,7 +19477,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1545 + "__id__": 1553 }, "_enabled": true, "__prefab": null, @@ -19400,13 +19516,13 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1545 + "__id__": 1553 }, "_enabled": true, "__prefab": null, "clickEvents": [ { - "__id__": 1552 + "__id__": 1560 } ], "_interactable": true, @@ -19446,7 +19562,7 @@ "_duration": 0.3, "_zoomScale": 0.9, "_target": { - "__id__": 1545 + "__id__": 1553 }, "_id": "78LMuVpMFHPJG4gDJo3kkk" }, @@ -19470,19 +19586,19 @@ }, "_children": [ { - "__id__": 1554 + "__id__": 1562 } ], "_active": false, "_components": [ { - "__id__": 1557 + "__id__": 1565 }, { - "__id__": 1558 + "__id__": 1566 }, { - "__id__": 1559 + "__id__": 1567 } ], "_prefab": null, @@ -19521,16 +19637,16 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 1553 + "__id__": 1561 }, "_children": [], "_active": true, "_components": [ { - "__id__": 1555 + "__id__": 1563 }, { - "__id__": 1556 + "__id__": 1564 } ], "_prefab": null, @@ -19569,7 +19685,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1554 + "__id__": 1562 }, "_enabled": true, "__prefab": null, @@ -19591,7 +19707,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1554 + "__id__": 1562 }, "_enabled": true, "__prefab": null, @@ -19656,7 +19772,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1553 + "__id__": 1561 }, "_enabled": true, "__prefab": null, @@ -19678,7 +19794,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1553 + "__id__": 1561 }, "_enabled": true, "__prefab": null, @@ -19717,13 +19833,13 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 1553 + "__id__": 1561 }, "_enabled": true, "__prefab": null, "clickEvents": [ { - "__id__": 1560 + "__id__": 1568 } ], "_interactable": true, @@ -19763,7 +19879,7 @@ "_duration": 0.3, "_zoomScale": 0.9, "_target": { - "__id__": 1553 + "__id__": 1561 }, "_id": "56X5L8e5tEooC2NX45Ycgz" }, @@ -19853,10 +19969,13 @@ "instance": null, "targetOverrides": [ { - "__id__": 1565 + "__id__": 1573 }, { - "__id__": 1568 + "__id__": 1576 + }, + { + "__id__": 1579 } ], "nestedPrefabInstanceRoots": [ @@ -19897,10 +20016,13 @@ "__id__": 1449 }, { - "__id__": 1475 + "__id__": 1457 }, { - "__id__": 1509 + "__id__": 1483 + }, + { + "__id__": 1517 } ] }, @@ -19910,7 +20032,7 @@ "__id__": 732 }, "sourceInfo": { - "__id__": 1566 + "__id__": 1574 }, "propertyPath": [ "_skinningRoot" @@ -19919,7 +20041,7 @@ "__id__": 732 }, "targetInfo": { - "__id__": 1567 + "__id__": 1575 } }, { @@ -19942,7 +20064,7 @@ "__id__": 732 }, "sourceInfo": { - "__id__": 1569 + "__id__": 1577 }, "propertyPath": [ "_skinningRoot" @@ -19951,7 +20073,7 @@ "__id__": 732 }, "targetInfo": { - "__id__": 1570 + "__id__": 1578 } }, { @@ -19968,31 +20090,53 @@ "79fhDsSKtb6rSUhLhuZ1Gn" ] }, + { + "__type__": "cc.TargetOverrideInfo", + "source": { + "__id__": 13 + }, + "sourceInfo": null, + "propertyPath": [ + "timerLabel" + ], + "target": { + "__id__": 1449 + }, + "targetInfo": { + "__id__": 1580 + } + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "15R0OIE3tBfLBVlO7Mkd8W" + ] + }, { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 1572 + "__id__": 1582 }, "shadows": { - "__id__": 1573 + "__id__": 1583 }, "_skybox": { - "__id__": 1574 + "__id__": 1584 }, "fog": { - "__id__": 1575 + "__id__": 1585 }, "octree": { - "__id__": 1576 + "__id__": 1586 }, "skin": { - "__id__": 1577 + "__id__": 1587 }, "lightProbeInfo": { - "__id__": 1578 + "__id__": 1588 }, "postSettings": { - "__id__": 1579 + "__id__": 1589 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false diff --git a/tgx-games-client/assets/module_arean/level3/scene/BallScene.scene b/tgx-games-client/assets/module_arean/level3/scene/BallScene.scene index 4c9b7e3..e71cc75 100644 --- a/tgx-games-client/assets/module_arean/level3/scene/BallScene.scene +++ b/tgx-games-client/assets/module_arean/level3/scene/BallScene.scene @@ -23,7 +23,7 @@ "__id__": 5 }, { - "__id__": 153 + "__id__": 161 }, { "__id__": 13 @@ -32,7 +32,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 254 + "__id__": 262 }, "_lpos": { "__type__": "cc.Vec3", @@ -63,7 +63,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 258 + "__id__": 268 }, "_id": "41011e3b-d190-4abb-a21d-8f019cd1e4f9" }, @@ -188,7 +188,7 @@ "__id__": 12 }, { - "__id__": 253 + "__id__": 261 } ], "_prefab": null, @@ -508,10 +508,10 @@ "__id__": 13 }, "playerCtrl": { - "__id__": 151 + "__id__": 159 }, "ballCtrl": { - "__id__": 215 + "__id__": 223 }, "myBallNumLabel": { "__id__": 35 @@ -526,11 +526,12 @@ "__id__": 55 }, "PlaneNode": { - "__id__": 208 + "__id__": 216 }, "startAnim": { - "__id__": 253 + "__id__": 261 }, + "timerLabel": null, "_id": "01HrIc/r1PYYWrOvFveNYq" }, { @@ -567,22 +568,25 @@ "__id__": 74 }, { - "__id__": 107 + "__id__": 82 }, { - "__id__": 136 + "__id__": 115 + }, + { + "__id__": 144 } ], "_active": true, "_components": [ { - "__id__": 148 + "__id__": 156 }, { - "__id__": 149 + "__id__": 157 }, { - "__id__": 150 + "__id__": 158 } ], "_prefab": null, @@ -3124,13 +3128,124 @@ "root": { "__id__": 74 }, + "asset": { + "__uuid__": "e0258a83-5ef1-470b-abcf-9e10180d864e", + "__expectedType__": "cc.Prefab" + }, + "fileId": "36/YoP/aJHo5U6akto3lXB", + "instance": { + "__id__": 76 + }, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "ffaFZSwHFCDoGqdvkPIGeQ", + "prefabRootNode": null, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 77 + }, + { + "__id__": 79 + }, + { + "__id__": 80 + }, + { + "__id__": 81 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 78 + }, + "propertyPath": [ + "_name" + ], + "value": "timerNode" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "36/YoP/aJHo5U6akto3lXB" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 78 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": -600, + "y": 302.406, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 78 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 78 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 13 + }, + "_prefab": { + "__id__": 83 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 82 + }, "asset": { "__uuid__": "6ad3de0d-23dc-4706-b60b-20ebab4c6031", "__expectedType__": "cc.Prefab" }, "fileId": "274uCRqEJA+rlC0bXycjcw", "instance": { - "__id__": 76 + "__id__": 84 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3142,22 +3257,10 @@ "mountedChildren": [], "mountedComponents": [ { - "__id__": 77 + "__id__": 85 } ], "propertyOverrides": [ - { - "__id__": 80 - }, - { - "__id__": 82 - }, - { - "__id__": 84 - }, - { - "__id__": 86 - }, { "__id__": 88 }, @@ -3171,22 +3274,34 @@ "__id__": 94 }, { - "__id__": 95 + "__id__": 96 }, { - "__id__": 97 + "__id__": 98 }, { - "__id__": 99 + "__id__": 100 }, { - "__id__": 101 + "__id__": 102 }, { "__id__": 103 }, { "__id__": 105 + }, + { + "__id__": 107 + }, + { + "__id__": 109 + }, + { + "__id__": 111 + }, + { + "__id__": 113 } ], "removedComponents": [] @@ -3194,11 +3309,11 @@ { "__type__": "cc.MountedComponentsInfo", "targetInfo": { - "__id__": 78 + "__id__": 86 }, "components": [ { - "__id__": 79 + "__id__": 87 } ] }, @@ -3214,11 +3329,11 @@ "_objFlags": 0, "__editorExtras__": { "mountedRoot": { - "__id__": 74 + "__id__": 82 } }, "node": { - "__id__": 74 + "__id__": 82 }, "_enabled": true, "__prefab": null, @@ -3245,7 +3360,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 81 + "__id__": 89 }, "propertyPath": [ "_name" @@ -3261,7 +3376,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 83 + "__id__": 91 }, "propertyPath": [ "_lpos" @@ -3282,7 +3397,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 85 + "__id__": 93 }, "propertyPath": [ "_lrot" @@ -3304,7 +3419,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 87 + "__id__": 95 }, "propertyPath": [ "_euler" @@ -3325,7 +3440,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 89 + "__id__": 97 }, "propertyPath": [ "_lscale" @@ -3346,7 +3461,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 91 + "__id__": 99 }, "propertyPath": [ "_string" @@ -3362,7 +3477,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 93 + "__id__": 101 }, "propertyPath": [ "_contentSize" @@ -3382,7 +3497,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 89 + "__id__": 97 }, "propertyPath": [ "_layer" @@ -3392,7 +3507,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 96 + "__id__": 104 }, "propertyPath": [ "_layer" @@ -3408,7 +3523,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 98 + "__id__": 106 }, "propertyPath": [ "_layer" @@ -3424,7 +3539,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 108 }, "propertyPath": [ "_layer" @@ -3440,7 +3555,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 102 + "__id__": 110 }, "propertyPath": [ "_layer" @@ -3456,7 +3571,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 104 + "__id__": 112 }, "propertyPath": [ "_layer" @@ -3472,7 +3587,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 106 + "__id__": 114 }, "propertyPath": [ "_layer" @@ -3492,14 +3607,14 @@ "__id__": 13 }, "_prefab": { - "__id__": 108 + "__id__": 116 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 107 + "__id__": 115 }, "asset": { "__uuid__": "72bc384b-472d-49c2-aaae-ca409e6223fc", @@ -3507,7 +3622,7 @@ }, "fileId": "274uCRqEJA+rlC0bXycjcw", "instance": { - "__id__": 109 + "__id__": 117 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3519,28 +3634,10 @@ "mountedChildren": [], "mountedComponents": [ { - "__id__": 110 + "__id__": 118 } ], "propertyOverrides": [ - { - "__id__": 113 - }, - { - "__id__": 115 - }, - { - "__id__": 116 - }, - { - "__id__": 117 - }, - { - "__id__": 118 - }, - { - "__id__": 119 - }, { "__id__": 121 }, @@ -3550,20 +3647,38 @@ { "__id__": 124 }, + { + "__id__": 125 + }, { "__id__": 126 }, { - "__id__": 128 + "__id__": 127 }, { - "__id__": 130 + "__id__": 129 + }, + { + "__id__": 131 }, { "__id__": 132 }, { "__id__": 134 + }, + { + "__id__": 136 + }, + { + "__id__": 138 + }, + { + "__id__": 140 + }, + { + "__id__": 142 } ], "removedComponents": [] @@ -3571,11 +3686,11 @@ { "__type__": "cc.MountedComponentsInfo", "targetInfo": { - "__id__": 111 + "__id__": 119 }, "components": [ { - "__id__": 112 + "__id__": 120 } ] }, @@ -3591,11 +3706,11 @@ "_objFlags": 0, "__editorExtras__": { "mountedRoot": { - "__id__": 107 + "__id__": 115 } }, "node": { - "__id__": 107 + "__id__": 115 }, "_enabled": true, "__prefab": null, @@ -3622,7 +3737,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_name" @@ -3638,7 +3753,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_lpos" @@ -3653,7 +3768,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_lrot" @@ -3669,7 +3784,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_euler" @@ -3684,7 +3799,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_lscale" @@ -3699,7 +3814,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 120 + "__id__": 128 }, "propertyPath": [ "_string" @@ -3715,7 +3830,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 122 + "__id__": 130 }, "propertyPath": [ "_contentSize" @@ -3735,7 +3850,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 114 + "__id__": 122 }, "propertyPath": [ "_layer" @@ -3745,7 +3860,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 125 + "__id__": 133 }, "propertyPath": [ "_layer" @@ -3761,7 +3876,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 127 + "__id__": 135 }, "propertyPath": [ "_layer" @@ -3777,7 +3892,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 129 + "__id__": 137 }, "propertyPath": [ "_layer" @@ -3793,7 +3908,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 131 + "__id__": 139 }, "propertyPath": [ "_layer" @@ -3809,7 +3924,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 133 + "__id__": 141 }, "propertyPath": [ "_layer" @@ -3825,7 +3940,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 135 + "__id__": 143 }, "propertyPath": [ "_layer" @@ -3845,14 +3960,14 @@ "__id__": 13 }, "_prefab": { - "__id__": 137 + "__id__": 145 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 136 + "__id__": 144 }, "asset": { "__uuid__": "fc0d2216-f356-4506-b6b4-f2c69442df2a", @@ -3860,7 +3975,7 @@ }, "fileId": "96qYAwccJO06ZvJw7OTmwr", "instance": { - "__id__": 138 + "__id__": 146 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3873,25 +3988,25 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 139 + "__id__": 147 }, { - "__id__": 141 + "__id__": 149 }, { - "__id__": 142 + "__id__": 150 }, { - "__id__": 143 + "__id__": 151 }, { - "__id__": 144 + "__id__": 152 }, { - "__id__": 145 + "__id__": 153 }, { - "__id__": 146 + "__id__": 154 } ], "removedComponents": [] @@ -3899,7 +4014,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_name" @@ -3915,7 +4030,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_lpos" @@ -3930,7 +4045,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_lrot" @@ -3946,7 +4061,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_euler" @@ -3961,7 +4076,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_active" @@ -3971,7 +4086,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 140 + "__id__": 148 }, "propertyPath": [ "_layer" @@ -3981,7 +4096,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 147 + "__id__": 155 }, "propertyPath": [ "_layer" @@ -4068,18 +4183,18 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 152 + "__id__": 160 }, "_enabled": true, "__prefab": null, "ball": { - "__id__": 220 + "__id__": 228 }, "gameManagerNode": { "__id__": 5 }, "playerNode": { - "__id__": 235 + "__id__": 243 }, "_id": "56ffZPH0RG3pvJKcWmZmSb" }, @@ -4089,20 +4204,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 153 + "__id__": 161 }, "_children": [ { - "__id__": 220 + "__id__": 228 }, { - "__id__": 235 + "__id__": 243 } ], "_active": true, "_components": [ { - "__id__": 151 + "__id__": 159 } ], "_prefab": null, @@ -4145,19 +4260,19 @@ }, "_children": [ { - "__id__": 154 - }, - { - "__id__": 208 - }, - { - "__id__": 211 + "__id__": 162 }, { "__id__": 216 }, { - "__id__": 152 + "__id__": 219 + }, + { + "__id__": 224 + }, + { + "__id__": 160 } ], "_active": true, @@ -4196,17 +4311,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 153 + "__id__": 161 }, "_prefab": { - "__id__": 155 + "__id__": 163 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 154 + "__id__": 162 }, "asset": { "__uuid__": "b96ee992-bd40-4505-acc7-93faabe4b8a0@03b03", @@ -4214,7 +4329,7 @@ }, "fileId": "06IxxnXpNVopGs1WTJEtNb", "instance": { - "__id__": 156 + "__id__": 164 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4225,23 +4340,11 @@ "prefabRootNode": null, "mountedChildren": [ { - "__id__": 157 + "__id__": 165 } ], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 171 - }, - { - "__id__": 173 - }, - { - "__id__": 175 - }, - { - "__id__": 177 - }, { "__id__": 179 }, @@ -4285,10 +4388,22 @@ "__id__": 205 }, { - "__id__": 206 + "__id__": 207 }, { - "__id__": 207 + "__id__": 209 + }, + { + "__id__": 211 + }, + { + "__id__": 213 + }, + { + "__id__": 214 + }, + { + "__id__": 215 } ], "removedComponents": [] @@ -4296,11 +4411,11 @@ { "__type__": "cc.MountedChildrenInfo", "targetInfo": { - "__id__": 158 + "__id__": 166 }, "nodes": [ { - "__id__": 159 + "__id__": 167 } ] }, @@ -4314,21 +4429,21 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 154 + "__id__": 162 }, "_prefab": { - "__id__": 160 + "__id__": 168 }, "__editorExtras__": { "mountedRoot": { - "__id__": 154 + "__id__": 162 } } }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 159 + "__id__": 167 }, "asset": { "__uuid__": "b91905ff-fb95-4680-bcd6-5603f2b07dee", @@ -4336,7 +4451,7 @@ }, "fileId": "c5/G3wUJ1HoaT+UobgHLY5", "instance": { - "__id__": 161 + "__id__": 169 }, "targetOverrides": null }, @@ -4347,26 +4462,26 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 162 - }, - { - "__id__": 164 - }, - { - "__id__": 165 - }, - { - "__id__": 166 - }, - { - "__id__": 167 - }, - { - "__id__": 168 - }, { "__id__": 170 + }, + { + "__id__": 172 + }, + { + "__id__": 173 + }, + { + "__id__": 174 + }, + { + "__id__": 175 + }, + { + "__id__": 176 + }, + { + "__id__": 178 } ], "removedComponents": [] @@ -4374,7 +4489,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 163 + "__id__": 171 }, "propertyPath": [ "_name" @@ -4390,7 +4505,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 163 + "__id__": 171 }, "propertyPath": [ "_lpos" @@ -4405,7 +4520,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 163 + "__id__": 171 }, "propertyPath": [ "_lrot" @@ -4421,7 +4536,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 163 + "__id__": 171 }, "propertyPath": [ "_euler" @@ -4436,7 +4551,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 163 + "__id__": 171 }, "propertyPath": [ "_lscale" @@ -4451,7 +4566,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 169 + "__id__": 177 }, "propertyPath": [ "_defaultClip" @@ -4471,7 +4586,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 169 + "__id__": 177 }, "propertyPath": [ "_useBakedAnimation" @@ -4481,7 +4596,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 172 + "__id__": 180 }, "propertyPath": [ "_name" @@ -4497,7 +4612,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 174 + "__id__": 182 }, "propertyPath": [ "_lpos" @@ -4518,7 +4633,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 176 + "__id__": 184 }, "propertyPath": [ "_lrot" @@ -4540,7 +4655,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 178 + "__id__": 186 }, "propertyPath": [ "_euler" @@ -4561,7 +4676,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 180 + "__id__": 188 }, "propertyPath": [ "_lscale" @@ -4582,7 +4697,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 182 + "__id__": 190 }, "propertyPath": [ "_active" @@ -4598,7 +4713,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 184 + "__id__": 192 }, "propertyPath": [ "_shadowReceivingMode" @@ -4614,7 +4729,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 186 + "__id__": 194 }, "propertyPath": [ "_shadowCastingMode" @@ -4630,7 +4745,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 188 + "__id__": 196 }, "propertyPath": [ "_shadowBias" @@ -4646,7 +4761,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 190 + "__id__": 198 }, "propertyPath": [ "_active" @@ -4662,7 +4777,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 192 + "__id__": 200 }, "propertyPath": [ "bakeSettings", @@ -4679,7 +4794,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 194 + "__id__": 202 }, "propertyPath": [ "bakeSettings", @@ -4696,7 +4811,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 196 + "__id__": 204 }, "propertyPath": [ "_active" @@ -4712,7 +4827,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 198 + "__id__": 206 }, "propertyPath": [ "_active" @@ -4728,7 +4843,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 200 + "__id__": 208 }, "propertyPath": [ "_active" @@ -4744,7 +4859,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 202 + "__id__": 210 }, "propertyPath": [ "_lscale" @@ -4765,7 +4880,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 204 + "__id__": 212 }, "propertyPath": [ "bakeSettings", @@ -4782,7 +4897,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 204 + "__id__": 212 }, "propertyPath": [ "bakeSettings", @@ -4793,7 +4908,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 204 + "__id__": 212 }, "propertyPath": [ "bakeSettings", @@ -4804,7 +4919,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 204 + "__id__": 212 }, "propertyPath": [ "_shadowCastingMode" @@ -4817,13 +4932,13 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 153 + "__id__": 161 }, "_children": [], "_active": true, "_components": [ { - "__id__": 209 + "__id__": 217 } ], "_prefab": null, @@ -4862,7 +4977,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 208 + "__id__": 216 }, "_enabled": true, "__prefab": null, @@ -4874,7 +4989,7 @@ ], "_visFlags": 0, "bakeSettings": { - "__id__": 210 + "__id__": 218 }, "_mesh": { "__uuid__": "1263d74c-8167-4928-91a6-4e2672411f47@2e76e", @@ -4917,17 +5032,17 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 153 + "__id__": 161 }, "_children": [ { - "__id__": 212 + "__id__": 220 } ], "_active": true, "_components": [ { - "__id__": 215 + "__id__": 223 } ], "_prefab": null, @@ -4966,13 +5081,13 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 211 + "__id__": 219 }, "_children": [], "_active": true, "_components": [ { - "__id__": 213 + "__id__": 221 } ], "_prefab": null, @@ -5011,7 +5126,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 212 + "__id__": 220 }, "_enabled": true, "__prefab": null, @@ -5023,7 +5138,7 @@ ], "_visFlags": 0, "bakeSettings": { - "__id__": 214 + "__id__": 222 }, "_mesh": { "__uuid__": "1263d74c-8167-4928-91a6-4e2672411f47@40ece", @@ -5066,7 +5181,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 211 + "__id__": 219 }, "_enabled": true, "__prefab": null, @@ -5078,7 +5193,7 @@ "__id__": 5 }, "opPlayerNode": { - "__id__": 159 + "__id__": 167 }, "_id": "61iMFCixpDoYjjxAKVrqAu" }, @@ -5088,16 +5203,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 153 + "__id__": 161 }, "_children": [], "_active": true, "_components": [ { - "__id__": 217 + "__id__": 225 }, { - "__id__": 219 + "__id__": 227 } ], "_prefab": null, @@ -5136,7 +5251,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 216 + "__id__": 224 }, "_enabled": true, "__prefab": null, @@ -5148,7 +5263,7 @@ ], "_visFlags": 0, "bakeSettings": { - "__id__": 218 + "__id__": 226 }, "_mesh": null, "_shadowCastingMode": 0, @@ -5188,7 +5303,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 216 + "__id__": 224 }, "_enabled": true, "__prefab": null, @@ -5212,17 +5327,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 152 + "__id__": 160 }, "_prefab": { - "__id__": 221 + "__id__": 229 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 220 + "__id__": 228 }, "asset": { "__uuid__": "33ad67a1-fa79-4804-b780-b2b4ff1c359f", @@ -5230,7 +5345,7 @@ }, "fileId": "ba9dnQ3PhKRq0JRULZl5x2", "instance": { - "__id__": 222 + "__id__": 230 }, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -5243,28 +5358,28 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 223 + "__id__": 231 }, { - "__id__": 225 - }, - { - "__id__": 226 - }, - { - "__id__": 227 - }, - { - "__id__": 228 - }, - { - "__id__": 230 - }, - { - "__id__": 232 + "__id__": 233 }, { "__id__": 234 + }, + { + "__id__": 235 + }, + { + "__id__": 236 + }, + { + "__id__": 238 + }, + { + "__id__": 240 + }, + { + "__id__": 242 } ], "removedComponents": [] @@ -5272,7 +5387,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 224 + "__id__": 232 }, "propertyPath": [ "_name" @@ -5288,7 +5403,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 224 + "__id__": 232 }, "propertyPath": [ "_lpos" @@ -5303,7 +5418,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 224 + "__id__": 232 }, "propertyPath": [ "_lrot" @@ -5319,7 +5434,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 224 + "__id__": 232 }, "propertyPath": [ "_euler" @@ -5334,7 +5449,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 229 + "__id__": 237 }, "propertyPath": [ "_materials", @@ -5354,7 +5469,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 231 + "__id__": 239 }, "propertyPath": [ "penEffect" @@ -5370,7 +5485,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 233 + "__id__": 241 }, "propertyPath": [ "_active" @@ -5386,7 +5501,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 224 + "__id__": 232 }, "propertyPath": [ "_active" @@ -5397,17 +5512,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 152 + "__id__": 160 }, "_prefab": { - "__id__": 236 + "__id__": 244 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 235 + "__id__": 243 }, "asset": { "__uuid__": "b3f0f323-ca92-4e75-a26b-c0676231f66d", @@ -5415,7 +5530,7 @@ }, "fileId": "c5/G3wUJ1HoaT+UobgHLY5", "instance": { - "__id__": 237 + "__id__": 245 }, "targetOverrides": null }, @@ -5426,18 +5541,6 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 238 - }, - { - "__id__": 240 - }, - { - "__id__": 242 - }, - { - "__id__": 244 - }, { "__id__": 246 }, @@ -5449,6 +5552,18 @@ }, { "__id__": 252 + }, + { + "__id__": 254 + }, + { + "__id__": 256 + }, + { + "__id__": 258 + }, + { + "__id__": 260 } ], "removedComponents": [] @@ -5456,7 +5571,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 239 + "__id__": 247 }, "propertyPath": [ "_name" @@ -5472,7 +5587,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 241 + "__id__": 249 }, "propertyPath": [ "_lpos" @@ -5493,7 +5608,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 243 + "__id__": 251 }, "propertyPath": [ "_lrot" @@ -5515,7 +5630,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 245 + "__id__": 253 }, "propertyPath": [ "_euler" @@ -5536,7 +5651,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 247 + "__id__": 255 }, "propertyPath": [ "_lscale" @@ -5557,7 +5672,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 249 + "__id__": 257 }, "propertyPath": [ "_defaultClip" @@ -5577,7 +5692,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 251 + "__id__": 259 }, "propertyPath": [ "_lpos" @@ -5599,7 +5714,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 249 + "__id__": 257 }, "propertyPath": [ "_useBakedAnimation" @@ -5634,49 +5749,55 @@ "instance": null, "targetOverrides": [ { - "__id__": 255 + "__id__": 263 + }, + { + "__id__": 266 } ], "nestedPrefabInstanceRoots": [ { - "__id__": 154 + "__id__": 162 }, { - "__id__": 159 + "__id__": 167 }, { - "__id__": 220 + "__id__": 228 }, { - "__id__": 235 + "__id__": 243 }, { "__id__": 74 }, { - "__id__": 107 + "__id__": 82 }, { - "__id__": 136 + "__id__": 115 + }, + { + "__id__": 144 } ] }, { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 220 + "__id__": 228 }, "sourceInfo": { - "__id__": 256 + "__id__": 264 }, "propertyPath": [ "penEffect" ], "target": { - "__id__": 220 + "__id__": 228 }, "targetInfo": { - "__id__": 257 + "__id__": 265 } }, { @@ -5691,31 +5812,53 @@ "15tFdakJBIJ4+Y6Jexjx+3" ] }, + { + "__type__": "cc.TargetOverrideInfo", + "source": { + "__id__": 12 + }, + "sourceInfo": null, + "propertyPath": [ + "timerLabel" + ], + "target": { + "__id__": 74 + }, + "targetInfo": { + "__id__": 267 + } + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "15R0OIE3tBfLBVlO7Mkd8W" + ] + }, { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 259 + "__id__": 269 }, "shadows": { - "__id__": 260 + "__id__": 270 }, "_skybox": { - "__id__": 261 + "__id__": 271 }, "fog": { - "__id__": 262 + "__id__": 272 }, "octree": { - "__id__": 263 + "__id__": 273 }, "skin": { - "__id__": 264 + "__id__": 274 }, "lightProbeInfo": { - "__id__": 265 + "__id__": 275 }, "postSettings": { - "__id__": 266 + "__id__": 276 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false diff --git a/tgx-games-client/assets/module_arean/level3/script/BallGame.ts b/tgx-games-client/assets/module_arean/level3/script/BallGame.ts index 134a1d7..e6d920b 100644 --- a/tgx-games-client/assets/module_arean/level3/script/BallGame.ts +++ b/tgx-games-client/assets/module_arean/level3/script/BallGame.ts @@ -78,8 +78,16 @@ export class BallGame extends Component { @property(Animation) startAnim: Animation = null!; + @property(Label) + timerLabel: Label = null!; // 挂载到 timerNode 下的 Label 组件 + private gameState: GameState = GameState.Playing; + private countdownDuration: number = 180; // 3分钟 = 180秒 + private countdownRemaining: number = 180; + private isCountdownStarted: boolean = false; + private startDelay: number = 5; // 开场动画结束后延迟1.5秒开始 + start() { this.initPhysics(); this.initGameState(); @@ -110,6 +118,43 @@ export class BallGame extends Component { private onStartAnimFinished() { this.PlaneNode.active = true; + + // 延迟指定秒数后开始倒计时 + this.scheduleOnce(() => { + this.startCountdown(); + }, this.startDelay); + } + + private startCountdown() { + this.isCountdownStarted = true; + this.countdownRemaining = this.countdownDuration; + this.updateTimerDisplay(); + + // 每秒更新一次 + this.schedule(this.updateCountdown, 1); + } + + private updateCountdown() { + if (!this.isCountdownStarted || this.gameState !== GameState.Playing) return; + + this.countdownRemaining--; + this.updateTimerDisplay(); + + if (this.countdownRemaining <= 0) { + // 时间到,结束游戏 + this.unschedule(this.updateCountdown); + this.setGameOver(false); // 时间到算失败 + } + } + + private updateTimerDisplay() { + if (!this.timerLabel) return; + + const minutes = Math.floor(this.countdownRemaining / 60); + const seconds = this.countdownRemaining % 60; + + // 格式化为 "xx:xx" + this.timerLabel.string = `${minutes < 10 ? '0' + minutes : minutes}:${seconds < 10 ? '0' + seconds : seconds}`; } AddBall() { @@ -119,7 +164,8 @@ export class BallGame extends Component { } } public setGameOver(isWin: boolean) { - + this.isCountdownStarted = false; // 停止倒计时 + this.unschedule(this.updateCountdown); if (!isWin) { resLoader.load(ModuleDef.Arean, 'common/prefabs/settlement', (err: Error | null, prefab: Prefab) => { @@ -214,6 +260,10 @@ export class BallGame extends Component { if (this.ballCtrl) { this.ballCtrl.resetGame(); } + + this.countdownRemaining = this.countdownDuration; + this.isCountdownStarted = false; + this.updateTimerDisplay(); } // update(deltaTime: number) { diff --git a/tgx-games-client/assets/module_basic/scripts/FrontConfig.ts b/tgx-games-client/assets/module_basic/scripts/FrontConfig.ts index 4b2f611..5586433 100644 --- a/tgx-games-client/assets/module_basic/scripts/FrontConfig.ts +++ b/tgx-games-client/assets/module_basic/scripts/FrontConfig.ts @@ -15,7 +15,8 @@ export const GameServerListFileURL = ""; //'http://192.168.0.104:7456/web-mobile */ export const GameServerURLs = [ // 'wss://chengchennet.cn:15005',//wss远程链接 - "ws://150.158.100.241:8092", //ws远程链接 + //"ws://150.158.100.241:8092", //ws远程链接 + "ws://52.221.198.126:8023", //亚马逊 ws远程链接 // "ws://127.0.0.1:8092", //ws本地连接 // 'wss://squidgameserver.gryphon.fun' ]; diff --git a/tgx-games-client/assets/start/homeBg.jpg b/tgx-games-client/assets/start/homeBg.jpg index c5f0556..fcbc499 100644 Binary files a/tgx-games-client/assets/start/homeBg.jpg and b/tgx-games-client/assets/start/homeBg.jpg differ diff --git a/tgx-games-client/assets/start/homeBg.jpg.meta b/tgx-games-client/assets/start/homeBg.jpg.meta index 10111b3..768d57f 100644 --- a/tgx-games-client/assets/start/homeBg.jpg.meta +++ b/tgx-games-client/assets/start/homeBg.jpg.meta @@ -46,10 +46,10 @@ "offsetY": 0, "trimX": 0, "trimY": 0, - "width": 2160, - "height": 1080, - "rawWidth": 2160, - "rawHeight": 1080, + "width": 1353, + "height": 675, + "rawWidth": 1353, + "rawHeight": 675, "borderTop": 0, "borderBottom": 0, "borderLeft": 0, @@ -61,17 +61,17 @@ "meshType": 0, "vertices": { "rawPosition": [ - -1080, - -540, + -676.5, + -337.5, 0, - 1080, - -540, + 676.5, + -337.5, 0, - -1080, - 540, + -676.5, + 337.5, 0, - 1080, - 540, + 676.5, + 337.5, 0 ], "indexes": [ @@ -84,12 +84,12 @@ ], "uv": [ 0, - 1080, - 2160, - 1080, + 675, + 1353, + 675, 0, 0, - 2160, + 1353, 0 ], "nuv": [ @@ -103,13 +103,13 @@ 1 ], "minPos": [ - -1080, - -540, + -676.5, + -337.5, 0 ], "maxPos": [ - 1080, - 540, + 676.5, + 337.5, 0 ] },