diff --git a/assets/_Game/Prefabs/Ball.prefab b/assets/_Game/Prefabs/Ball.prefab index 15967a2..1dbc8f1 100644 --- a/assets/_Game/Prefabs/Ball.prefab +++ b/assets/_Game/Prefabs/Ball.prefab @@ -1130,7 +1130,7 @@ "fileId": "9crXsAtjdEQIcD0a2IceFl" }, { - "__type__": "4630aSZqwlFqb6BUtrii+tV", + "__type__": "2b7c2ePr+dMuYseum/QYECs", "_name": "", "_objFlags": 0, "node": { @@ -1161,6 +1161,10 @@ "__uuid__": "6a432293-3852-4267-be19-c671f36fe9f0", "__expectedType__": "cc.AudioClip" }, + "_ballThrowSound": { + "__uuid__": "97c8a166-c717-41bd-837f-bd1733e2ee1c", + "__expectedType__": "cc.AudioClip" + }, "_jumpCurve": { "__id__": 79 }, @@ -1168,7 +1172,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "43eN1N3HRBEa/ox7tb7ZPo" + "fileId": "97rCl9CwBAEoDnKUvzZjGu" }, { "__type__": "cc.AnimationCurve", @@ -1188,9 +1192,9 @@ "interpolationMode": 2, "tangentWeightMode": 0, "value": 0, - "rightTangent": 5.537037037037036, + "rightTangent": 7.298245614035088, "rightTangentWeight": 1, - "leftTangent": 5.537037037037036, + "leftTangent": 7.298245614035088, "leftTangentWeight": 1, "easingMethod": 0, "__editorExtras__": null @@ -1200,9 +1204,9 @@ "interpolationMode": 2, "tangentWeightMode": 0, "value": 0, - "rightTangent": -2.148148148148149, + "rightTangent": -0.9629629629629626, "rightTangentWeight": 1, - "leftTangent": -2.148148148148149, + "leftTangent": -0.9629629629629626, "leftTangentWeight": 1, "easingMethod": 0, "__editorExtras__": null diff --git a/assets/_Game/Prefabs/Goal Particle.prefab b/assets/_Game/Prefabs/Goal Particle.prefab index c3e0374..fbc1fb7 100644 --- a/assets/_Game/Prefabs/Goal Particle.prefab +++ b/assets/_Game/Prefabs/Goal Particle.prefab @@ -163,9 +163,9 @@ "__id__": 22 }, "duration": 1.5, - "loop": true, + "loop": false, "simulationSpeed": 1, - "playOnAwake": true, + "playOnAwake": false, "gravityModifier": { "__id__": 23 }, diff --git a/assets/_Game/Prefabs/box.prefab b/assets/_Game/Prefabs/box.prefab index 7031f86..86594cf 100644 --- a/assets/_Game/Prefabs/box.prefab +++ b/assets/_Game/Prefabs/box.prefab @@ -318,7 +318,10 @@ "__id__": 16 }, "_score": 10, - "_flySpeed": 1000, + "_hitSound": { + "__uuid__": "1f602e14-2769-4903-b4d2-b0977eeaf36b", + "__expectedType__": "cc.AudioClip" + }, "_id": "" }, { diff --git a/assets/_Game/Scenes/EndLessScene.scene b/assets/_Game/Scenes/EndLessScene.scene index 097a90e..440eaff 100644 --- a/assets/_Game/Scenes/EndLessScene.scene +++ b/assets/_Game/Scenes/EndLessScene.scene @@ -17,12 +17,15 @@ "_children": [ { "__id__": 2 + }, + { + "__id__": 474 } ], "_active": true, "_components": [], "_prefab": { - "__id__": 474 + "__id__": 517 }, "_lpos": { "__type__": "cc.Vec3", @@ -53,7 +56,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 475 + "__id__": 518 }, "_id": "82e6ef2e-3f9c-4d4e-ab02-dc963e925b88" }, @@ -5086,7 +5089,7 @@ "_id": "11xnlfOFhLcY7kWV/ol9ry" }, { - "__type__": "ba908POixlMbJi93jqckYwu", + "__type__": "1f970S32ylOnofatPpSgI1Z", "_name": "", "_objFlags": 0, "node": { @@ -5103,7 +5106,7 @@ "__id__": 126 } ], - "_id": "4dvh/aIppAf6DVreFrkial" + "_id": "dddTNOdPZBp5+GzdCqTj+4" }, { "__type__": "cc.ClickEvent", @@ -5111,12 +5114,12 @@ "__id__": 121 }, "component": "", - "_componentId": "db626j2jW1On6kI8MY4hdFX", + "_componentId": "3ff782hitRJTLFTAp7W/Lcq", "handler": "close", "customEventData": "" }, { - "__type__": "db626j2jW1On6kI8MY4hdFX", + "__type__": "3ff782hitRJTLFTAp7W/Lcq", "_name": "", "_objFlags": 0, "node": { @@ -5127,7 +5130,7 @@ "_gate": { "__id__": 111 }, - "_id": "54M3IsP4ZH8pOlUeqzBmip" + "_id": "00Ldk/0aNGqolG9iyPolny" }, { "__type__": "cc.Node", @@ -5272,7 +5275,7 @@ "_id": "50OeUDM7xIBZFOXguBu5eZ" }, { - "__type__": "ba908POixlMbJi93jqckYwu", + "__type__": "1f970S32ylOnofatPpSgI1Z", "_name": "", "_objFlags": 0, "node": { @@ -5289,7 +5292,7 @@ "__id__": 133 } ], - "_id": "14f3UniDRPoqL8dboN1Pl3" + "_id": "aaHIInYm5JObxLnkcinp6i" }, { "__type__": "cc.ClickEvent", @@ -5297,12 +5300,12 @@ "__id__": 128 }, "component": "", - "_componentId": "db626j2jW1On6kI8MY4hdFX", + "_componentId": "3ff782hitRJTLFTAp7W/Lcq", "handler": "close", "customEventData": "" }, { - "__type__": "db626j2jW1On6kI8MY4hdFX", + "__type__": "3ff782hitRJTLFTAp7W/Lcq", "_name": "", "_objFlags": 0, "node": { @@ -5313,7 +5316,7 @@ "_gate": { "__id__": 106 }, - "_id": "34upA9vcVJzpqOdrWx1FXz" + "_id": "76xsNMba5J9ZsJx29+0/Mm" }, { "__type__": "cc.Node", @@ -6071,7 +6074,7 @@ "_id": "66yKMgTD5HXZ2YEmqy93qQ" }, { - "__type__": "5339aFXLPVCHaqpbHfNBayd", + "__type__": "ce7b7e0d6BHlaRFoKBZN0h/", "_name": "", "_objFlags": 0, "node": { @@ -6083,7 +6086,15 @@ "__id__": 147 }, "_score": 100, - "_id": "45a2kFqElD+6MQQgE6eBbo" + "_goalFx": { + "__uuid__": "f54a7c19-37d5-4255-9336-f6df0e956be7", + "__expectedType__": "cc.Prefab" + }, + "_goalSound": { + "__uuid__": "b8e26fea-3d75-4254-8fe6-4a57c40d6121", + "__expectedType__": "cc.AudioClip" + }, + "_id": "depU8qmkxCaJIJsMIq3jv4" }, { "__type__": "cc.Node", @@ -6348,7 +6359,7 @@ "_id": "f3wvpG4utA44J/SgE4kad6" }, { - "__type__": "02952omKEJIoK809JlyYK3Z", + "__type__": "e3b5fa7tUtAbK3rQJ/G2Rox", "_name": "", "_objFlags": 0, "node": { @@ -6365,7 +6376,7 @@ "_portRight": { "__id__": 152 }, - "_id": "b8ISgv+ulAWYWFrkoGNcKP" + "_id": "cf4OeeWmpFIouLcLflIG+0" }, { "__type__": "cc.Node", @@ -6811,7 +6822,7 @@ "_id": "5aXYxmrtNPBYpfAg4Gkf81" }, { - "__type__": "c394bc4BeRBjaBHKz301Iaq", + "__type__": "bed15fuvPJLIp1O3BWg43ad", "_name": "", "_objFlags": 0, "node": { @@ -6838,7 +6849,7 @@ "__id__": 171 }, "_multiplierCurve": 90, - "_id": "19lrdkw9lKsYOYkUJPsOAQ" + "_id": "9cJaywMb9Fr4Z0zlx1Pdcb" }, { "__type__": "cc.AnimationCurve", @@ -6849,7 +6860,7 @@ { "__type__": "cc.RealCurve", "_times": [ - 0.00012145164795756374, + 0, 1 ], "_values": [ @@ -6857,10 +6868,10 @@ "__type__": "cc.RealKeyframeValue", "interpolationMode": 2, "tangentWeightMode": 0, - "value": -0.0000403614071011487, - "rightTangent": -3.8155136268343823, + "value": 0, + "rightTangent": -3.8915712265701936, "rightTangentWeight": 1, - "leftTangent": -3.8155136268343823, + "leftTangent": -3.8915712265701936, "leftTangentWeight": 1, "easingMethod": 0, "__editorExtras__": null @@ -6870,9 +6881,9 @@ "interpolationMode": 2, "tangentWeightMode": 0, "value": 0, - "rightTangent": 4.111111111111112, + "rightTangent": 4.0305559132334166, "rightTangentWeight": 1, - "leftTangent": 4.111111111111112, + "leftTangent": 4.0305559132334166, "leftTangentWeight": 1, "easingMethod": 0, "__editorExtras__": null @@ -7434,7 +7445,7 @@ "_id": "ce6BIEMllOCrkTeCoYehH+" }, { - "__type__": "c394bc4BeRBjaBHKz301Iaq", + "__type__": "bed15fuvPJLIp1O3BWg43ad", "_name": "", "_objFlags": 0, "node": { @@ -7461,7 +7472,7 @@ "__id__": 190 }, "_multiplierCurve": 100, - "_id": "36Kj6TpJlIbbYq/l0aX6x+" + "_id": "f2+Qohf8JAhZ3Xqi9g9xV1" }, { "__type__": "cc.AnimationCurve", @@ -8057,7 +8068,7 @@ "_id": "4f2IYDJzJGPJwceFFVPOGU" }, { - "__type__": "c394bc4BeRBjaBHKz301Iaq", + "__type__": "bed15fuvPJLIp1O3BWg43ad", "_name": "", "_objFlags": 0, "node": { @@ -8078,13 +8089,13 @@ "__id__": 205 }, "_speed": 50, - "_requireGoal": 7, + "_requireGoal": 6, "_curveY": false, "_patrolCurve": { "__id__": 209 }, "_multiplierCurve": 100, - "_id": "3chjRD4PZLIJbQYUbpvd0E" + "_id": "99Yu77Ej9N4JRBZjD+OE2I" }, { "__type__": "cc.AnimationCurve", @@ -8680,7 +8691,7 @@ "_id": "c2KFWisGtBTr1xYF0ZRDd6" }, { - "__type__": "c394bc4BeRBjaBHKz301Iaq", + "__type__": "bed15fuvPJLIp1O3BWg43ad", "_name": "", "_objFlags": 0, "node": { @@ -8700,14 +8711,14 @@ "_patrolPoint2": { "__id__": 224 }, - "_speed": 50, - "_requireGoal": 5, + "_speed": 100, + "_requireGoal": 9, "_curveY": false, "_patrolCurve": { "__id__": 228 }, "_multiplierCurve": 100, - "_id": "80WQZr7yxE/bZ7kTVjUign" + "_id": "2bedVMe25Ou4KcU4DmnB4q" }, { "__type__": "cc.AnimationCurve", @@ -9082,7 +9093,7 @@ "_id": "08JpJhOjVFGYctYs3Lk/Dc" }, { - "__type__": "87072tPLDxIsIapfR3BenUO", + "__type__": "85a1du42gFMrIHUG6qev0l/", "_name": "", "_objFlags": 0, "node": { @@ -9096,7 +9107,7 @@ "_motorSpeedActive": -10000, "_motorSpeedDeActive": 10000, "side": 0, - "_id": "4dBro20TBPo4YboWOnvbJi" + "_id": "dbyGJf4ZlNuqnbz9gSPD7E" }, { "__type__": "cc.Node", @@ -9430,7 +9441,7 @@ "_id": "2az6WrLkxO74/iMWEYCPhe" }, { - "__type__": "87072tPLDxIsIapfR3BenUO", + "__type__": "85a1du42gFMrIHUG6qev0l/", "_name": "", "_objFlags": 0, "node": { @@ -9444,7 +9455,7 @@ "_motorSpeedActive": 10000, "_motorSpeedDeActive": -10000, "side": 1, - "_id": "d8QaNYQ4hKcoTuAkepV+wQ" + "_id": "c2LBQkbqpMS7ebeAdAWNd2" }, { "__type__": "cc.Node", @@ -9778,7 +9789,7 @@ "_id": "68mZN2dmROn575XnMss0Bn" }, { - "__type__": "87072tPLDxIsIapfR3BenUO", + "__type__": "85a1du42gFMrIHUG6qev0l/", "_name": "", "_objFlags": 0, "node": { @@ -9792,7 +9803,7 @@ "_motorSpeedActive": -10000, "_motorSpeedDeActive": 10000, "side": 0, - "_id": "60xS4uQqBFcZSwJiwu4nw2" + "_id": "b2E6XlkHJMxahWtRGd6aeN" }, { "__type__": "cc.Node", @@ -10126,7 +10137,7 @@ "_id": "d3hvosyClFxKSN37hHE48f" }, { - "__type__": "87072tPLDxIsIapfR3BenUO", + "__type__": "85a1du42gFMrIHUG6qev0l/", "_name": "", "_objFlags": 0, "node": { @@ -10140,7 +10151,7 @@ "_motorSpeedActive": 10000, "_motorSpeedDeActive": -10000, "side": 1, - "_id": "ca62fxYd5D9Lk3dcysf6WP" + "_id": "6dr9V2E3hPHbF4rTwDJHLl" }, { "__type__": "cc.Node", @@ -11553,7 +11564,7 @@ "_id": "98zDTZnlhAOYrrE1sIfU+t" }, { - "__type__": "bbe27U01MJNHL05B8JgXjGc", + "__type__": "ca8a0x4KJRGNJFfMRlEhSED", "_name": "", "_objFlags": 0, "node": { @@ -11564,7 +11575,7 @@ "_collider": { "__id__": 300 }, - "_id": "7bnuQxWEJJi4wFd7HXrIcx" + "_id": "63rfzsm3REkprs+s68PCRK" }, { "__type__": "cc.Node", @@ -17752,6 +17763,14 @@ "z": 0 }, "_balls": 3, + "_startSound": { + "__uuid__": "6452248b-259c-4844-b0e1-70f47d69955e", + "__expectedType__": "cc.AudioClip" + }, + "_backgroundMusic": { + "__uuid__": "fc66df28-6c8c-4915-adbd-5a3da652cfc6", + "__expectedType__": "cc.AudioClip" + }, "_id": "94qg9r7nVDkbO1S3Aid8/t" }, { @@ -17887,6 +17906,1503 @@ "_lockFlags": 0, "_id": "c5V1EV8IpMtrIvY1OE9t2u" }, + { + "__type__": "cc.Node", + "_name": "Canvas-UI", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 475 + } + ], + "_active": true, + "_components": [ + { + "__id__": 514 + }, + { + "__id__": 515 + }, + { + "__id__": 516 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 540, + "y": 1170, + "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": "7dhkTOPQ1NkYMPz/XjB0GS" + }, + { + "__type__": "cc.Node", + "_name": "UI", + "_objFlags": 0, + "_parent": { + "__id__": 474 + }, + "_children": [ + { + "__id__": 476 + }, + { + "__id__": 480 + }, + { + "__id__": 484 + }, + { + "__id__": 488 + }, + { + "__id__": 497 + } + ], + "_active": true, + "_components": [ + { + "__id__": 511 + }, + { + "__id__": 512 + }, + { + "__id__": 513 + } + ], + "_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": "30hqP0RmNJxbOP4LDWiaw9" + }, + { + "__type__": "cc.Node", + "_name": "Score", + "_objFlags": 0, + "_parent": { + "__id__": 475 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 477 + }, + { + "__id__": 478 + }, + { + "__id__": 479 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -490, + "y": 1057, + "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": "744OsjVN1AnaYr+1LWPe+M" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 476 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 372.41, + "height": 126 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "e38Vc4/9NI+o6RKyCrAcRF" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 476 + }, + "_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": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "f5byB1+jNCNqjN+Tt3NUoI" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 476 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 9, + "_target": null, + "_left": 50, + "_right": 0, + "_top": 50, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "e37J6uf4NM4af50cDcjaxU" + }, + { + "__type__": "cc.Node", + "_name": "Ball", + "_objFlags": 0, + "_parent": { + "__id__": 475 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 481 + }, + { + "__id__": 482 + }, + { + "__id__": 483 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -490, + "y": 907, + "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": "3d7Lq5e9hBN5iK2oWwoGfg" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 480 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 277.93, + "height": 126 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_id": "7fCGPL1/FLW6u/SIb9TVwk" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 480 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Ball: 3", + "_horizontalAlign": 0, + "_verticalAlign": 2, + "_actualFontSize": 100, + "_fontSize": 100, + "_fontFamily": "Arial", + "_lineHeight": 100, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "02X+gDdV5EZadTIG3pQIhB" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 480 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 9, + "_target": null, + "_left": 50, + "_right": 0, + "_top": 200, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "3b3bueiCxEtpaxlfKPdrMA" + }, + { + "__type__": "cc.Node", + "_name": "Goal", + "_objFlags": 0, + "_parent": { + "__id__": 475 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 485 + }, + { + "__id__": 486 + }, + { + "__id__": 487 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 490, + "y": 1057, + "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": "5cOj3eTL9FLa8G7OYSIzil" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 484 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 322.36, + "height": 126 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 1, + "y": 0.5 + }, + "_id": "ddzwwLu1JHU5qn1c9yRiVy" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 484 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "Goal !!!", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 100, + "_fontSize": 100, + "_fontFamily": "Arial", + "_lineHeight": 100, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "f9v7293dRFq4t2NzaL5CLg" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 484 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 33, + "_target": null, + "_left": 0, + "_right": 50, + "_top": 50, + "_bottom": -76.00000000000001, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 252, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "31Fx2973dAt4puJYDiv8Pp" + }, + { + "__type__": "cc.Node", + "_name": "StartPanel", + "_objFlags": 0, + "_parent": { + "__id__": 475 + }, + "_children": [ + { + "__id__": 489 + } + ], + "_active": false, + "_components": [ + { + "__id__": 494 + }, + { + "__id__": 495 + }, + { + "__id__": 496 + } + ], + "_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": "2cjr2qZLBDcK89R4kFuVvO" + }, + { + "__type__": "cc.Node", + "_name": "StartButton", + "_objFlags": 0, + "_parent": { + "__id__": 488 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 490 + }, + { + "__id__": 491 + }, + { + "__id__": 492 + } + ], + "_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": "e8XiYaBZFP9JAI3TvQoyfu" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 489 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 478, + "height": 194 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "0aQjip13tMVqx+vV1ChL4y" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 489 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "ff046972-01bd-4d20-b27d-92120e050ca3@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "b1MwEsekZLMo94dt1J3sX+" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 489 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [ + { + "__id__": 493 + } + ], + "_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__": "ff046972-01bd-4d20-b27d-92120e050ca3@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__": 489 + }, + "_id": "b5HEsyyjZJ8Yb2u2q1fD82" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 5 + }, + "component": "", + "_componentId": "85b9aaRsZBAn5sUxS5RQ3EF", + "handler": "play", + "customEventData": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 488 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "e2YSPIRWJGTbkL82XwXB5u" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 488 + }, + "_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": "00An3TpTNKqr89iXn/teRX" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 488 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 512, + "_originalHeight": 512, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "bbyTGWsiROZodmIf4oALBm" + }, + { + "__type__": "cc.Node", + "_name": "OverPanel", + "_objFlags": 0, + "_parent": { + "__id__": 475 + }, + "_children": [ + { + "__id__": 498 + }, + { + "__id__": 503 + } + ], + "_active": false, + "_components": [ + { + "__id__": 508 + }, + { + "__id__": 509 + }, + { + "__id__": 510 + } + ], + "_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": "32U5t0W4lLL5VRRhwa68Ab" + }, + { + "__type__": "cc.Node", + "_name": "RestartButton", + "_objFlags": 0, + "_parent": { + "__id__": 497 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 499 + }, + { + "__id__": 500 + }, + { + "__id__": 501 + } + ], + "_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": "64PKLRMElOWZOdqoFW26Zp" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 498 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 478, + "height": 194 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "c1uDG/dplBWL/iMKi4S+rW" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 498 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "ff046972-01bd-4d20-b27d-92120e050ca3@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "559jlgpPBPXI83ZrZP1LD4" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 498 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [ + { + "__id__": 502 + } + ], + "_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__": "ff046972-01bd-4d20-b27d-92120e050ca3@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__": 498 + }, + "_id": "a8Mg86ufxIhZPm+HYCnlf2" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 5 + }, + "component": "", + "_componentId": "85b9aaRsZBAn5sUxS5RQ3EF", + "handler": "restart", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "Result", + "_objFlags": 0, + "_parent": { + "__id__": 497 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 504 + }, + { + "__id__": 505 + }, + { + "__id__": 506 + }, + { + "__id__": 507 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 400, + "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__": 503 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 402.63, + "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__": 503 + }, + "_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": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": true, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "38UGDLbQpHtpYpXS8nu7ZP" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 503 + }, + "_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__": 503 + }, + "_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__": 497 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "b9STOCNJ5JZZIBxY8k4/3s" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 497 + }, + "_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": "06qItQe1RInYc+fra5viAT" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 497 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 512, + "_originalHeight": 512, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "1eaaPIoxtAkLvoRrUOy3Js" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 475 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "84T4RuoqJLl7+Ao24Ct3oN" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 475 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "c0NJXybJpG3b9xDKk1cCDU" + }, + { + "__type__": "ecf07La1rNA8YjY0h97yfWf", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 475 + }, + "_enabled": true, + "__prefab": null, + "_scoreLabel": { + "__id__": 478 + }, + "_ballLabel": { + "__id__": 482 + }, + "_goalLabel": { + "__id__": 486 + }, + "_resultLabel": { + "__id__": 505 + }, + "_startPanel": { + "__id__": 488 + }, + "_overPanel": { + "__id__": 497 + }, + "_id": "449hzGcyZL+Lsj/r1gnEMe" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 474 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "93xpxoWTdGroiao2b8kojq" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 474 + }, + "_enabled": true, + "__prefab": null, + "_cameraComponent": { + "__id__": 4 + }, + "_alignCanvasWithScreen": true, + "_id": "c06RqjvopJU73+8s8tYJfg" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 474 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "31rzggbdxK0a873vbaeK3h" + }, { "__type__": "cc.PrefabInfo", "root": null, @@ -17898,22 +19414,22 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 476 + "__id__": 519 }, "shadows": { - "__id__": 477 + "__id__": 520 }, "_skybox": { - "__id__": 478 + "__id__": 521 }, "fog": { - "__id__": 479 + "__id__": 522 }, "octree": { - "__id__": 480 + "__id__": 523 }, "lightProbeInfo": { - "__id__": 481 + "__id__": 524 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false diff --git a/assets/_Game/Scripts/Environments/ScoreObject.ts b/assets/_Game/Scripts/Environments/ScoreObject.ts index 84a2669..2af1458 100644 --- a/assets/_Game/Scripts/Environments/ScoreObject.ts +++ b/assets/_Game/Scripts/Environments/ScoreObject.ts @@ -1,6 +1,7 @@ import { _decorator, Animation, + AudioClip, CCFloat, CCInteger, Collider2D, @@ -18,6 +19,7 @@ import ObjectPool from '../Pool/ObjectPool'; import Utilities from '../Utilities'; import { EventManger } from '../Manager/EventManger'; import GameEvent from '../Events/GameEvent'; +import { SoundManager } from '../Manager/SoundManager'; const { ccclass, property, float } = _decorator; @ccclass('ScoreObject') @@ -28,6 +30,8 @@ export class ScoreObject extends Component implements IPoolable { private _sprite: Sprite; @property({ type: Animation, visible: true }) private _spawnAnimation: Animation; + @property({ type: AudioClip, visible: true }) + private _hitSound: AudioClip; @property({ type: CCInteger, visible: true }) private _score: number; @@ -67,6 +71,7 @@ export class ScoreObject extends Component implements IPoolable { private onContactBegin(selfCollider: Collider2D, otherCollider: Collider2D) { if (this._isHit) return; + SoundManager.instance.playSfx(this._hitSound); this._collider.enabled = false; let center = this.node.getWorldPosition(); let other = otherCollider.node.getWorldPosition(); @@ -78,7 +83,7 @@ export class ScoreObject extends Component implements IPoolable { this._flySpeed = otherCollider.getComponent(RigidBody2D).linearVelocity.length(); this.node.setSiblingIndex(this.node.parent.children.length - 1); if (this._score > 0) { - GameManager.instance.destroyEnviromentsObject(this._score, this.node.getWorldPosition()); + GameManager.instance.destroyEnvironmentObject(this._score, this.node.getWorldPosition()); } } diff --git a/assets/_Game/Scripts/Events/GameEvent.ts b/assets/_Game/Scripts/Events/GameEvent.ts index afadc63..029a5a1 100644 --- a/assets/_Game/Scripts/Events/GameEvent.ts +++ b/assets/_Game/Scripts/Events/GameEvent.ts @@ -12,7 +12,7 @@ enum GameEvent { export interface GameEventCallbackMap { [GameEvent.Score]: (score: number, type?: ScoreType) => void; - [GameEvent.BallOut]: () => void; + [GameEvent.BallOut]: (ball: number) => void; [GameEvent.MultiBall]: (active: boolean) => void; [GameEvent.GameStateChange]: (state: GameState) => void; [GameEvent.ScoreObjectRelease]: (obj: Node) => void; @@ -20,7 +20,7 @@ export interface GameEventCallbackMap { export interface GameEventArgMap { [GameEvent.Score]: [number, ScoreType]; - [GameEvent.BallOut]: null; + [GameEvent.BallOut]: number; [GameEvent.MultiBall]: boolean; [GameEvent.GameStateChange]: GameState; [GameEvent.ScoreObjectRelease]: Node; diff --git a/assets/_Game/Scripts/GamePlay/Cannon.ts b/assets/_Game/Scripts/GamePlay/Cannon.ts index f67c62d..165322a 100644 --- a/assets/_Game/Scripts/GamePlay/Cannon.ts +++ b/assets/_Game/Scripts/GamePlay/Cannon.ts @@ -1,6 +1,6 @@ import { _decorator, CCInteger, Collider2D, Component, Contact2DType, EventHandler, tween, Vec2 } from 'cc'; -import { Ball } from './Ball'; import Utilities from '../Utilities'; +import { Ball } from './Ball'; const { ccclass, property } = _decorator; @ccclass('Cannon') diff --git a/assets/_Game/Scripts/GamePlay/Cannon.ts.meta b/assets/_Game/Scripts/GamePlay/Cannon.ts.meta index eae9320..57743ba 100644 --- a/assets/_Game/Scripts/GamePlay/Cannon.ts.meta +++ b/assets/_Game/Scripts/GamePlay/Cannon.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "ba9083ce-8b19-4c6c-98bd-de3a9c918c2e", + "uuid": "1f9704b7-db29-4e9e-87da-b4fa52808d59", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/GamePlay/Enemy.ts.meta b/assets/_Game/Scripts/GamePlay/Enemy.ts.meta index a03b354..4c5babf 100644 --- a/assets/_Game/Scripts/GamePlay/Enemy.ts.meta +++ b/assets/_Game/Scripts/GamePlay/Enemy.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "c394b738-05e4-418d-a047-2b3df4d486aa", + "uuid": "bed157ee-bcf2-4b22-9d4e-dc15a0e3769d", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/GamePlay/Gate.ts.meta b/assets/_Game/Scripts/GamePlay/Gate.ts.meta index 8e73c82..e3da28e 100644 --- a/assets/_Game/Scripts/GamePlay/Gate.ts.meta +++ b/assets/_Game/Scripts/GamePlay/Gate.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "db6268f6-8d6d-4e9f-a908-f0c63885d157", + "uuid": "3ff78da1-8ad4-494c-b153-029ed6fcb72a", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/GamePlay/Goal.ts b/assets/_Game/Scripts/GamePlay/Goal.ts index 2533835..a2b47cb 100644 --- a/assets/_Game/Scripts/GamePlay/Goal.ts +++ b/assets/_Game/Scripts/GamePlay/Goal.ts @@ -1,9 +1,20 @@ -import { _decorator, CCInteger, Collider2D, Component, Contact2DType, Node, RigidBody2D } from 'cc'; +import { + _decorator, + AudioClip, + CCInteger, + Collider2D, + Component, + Contact2DType, + Node, + ParticleSystem, + Prefab, +} from 'cc'; import { GameManager } from '../Manager/GameManager'; import Utilities from '../Utilities'; import ObjectPool from '../Pool/ObjectPool'; import { Ball } from './Ball'; -const { ccclass, property, float } = _decorator; +import { SoundManager } from '../Manager/SoundManager'; +const { ccclass, property } = _decorator; @ccclass('Goal') export class Goal extends Component { @@ -11,9 +22,16 @@ export class Goal extends Component { private _collider: Collider2D; @property({ type: CCInteger, visible: true }) private _score: number; + @property({ type: Prefab, visible: true }) + private _goalFx: Prefab; + @property({ type: AudioClip, visible: true }) + private _goalSound: AudioClip; + + private _goalFxPool: ObjectPool; protected onLoad(): void { this._collider.on(Contact2DType.BEGIN_CONTACT, this.onContactBegin, this); + this._goalFxPool = new ObjectPool(this._goalFx, 5, false); } private async onContactBegin(selfCollider: Collider2D, otherCollider: Collider2D) { @@ -21,8 +39,16 @@ export class Goal extends Component { if (ball) { GameManager.instance.goal(this._score, ball.node.getWorldPosition()); ball.setActiveRigi(false); + const fx = this._goalFxPool.get(this.node, ParticleSystem); + const pos = ball.node.getWorldPosition(); + pos.z = 10; + fx.node.setWorldPosition(pos); + fx.play(); + SoundManager.instance.playSfx(this._goalSound); await Utilities.delay(1000); ObjectPool.release(ball.node); + await Utilities.waitUntil(() => fx.isStopped); + this._goalFxPool.release(fx.node); } } } diff --git a/assets/_Game/Scripts/GamePlay/Goal.ts.meta b/assets/_Game/Scripts/GamePlay/Goal.ts.meta index 6d01ad7..9a2a2bb 100644 --- a/assets/_Game/Scripts/GamePlay/Goal.ts.meta +++ b/assets/_Game/Scripts/GamePlay/Goal.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "5339a157-2cf5-421d-aaa9-6c77cd05ac9d", + "uuid": "ce7b77b4-77a0-4795-a445-a0a05937487f", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/GamePlay/MutilBall.ts.meta b/assets/_Game/Scripts/GamePlay/MutilBall.ts.meta index adab745..11a599e 100644 --- a/assets/_Game/Scripts/GamePlay/MutilBall.ts.meta +++ b/assets/_Game/Scripts/GamePlay/MutilBall.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "02952a26-2842-48a0-af34-f4997260add9", + "uuid": "e3b5f6bb-b54b-406c-adeb-409fc6d91a31", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/Gameplay.meta b/assets/_Game/Scripts/Gameplay.meta index f75a6c5..9b592ab 100644 --- a/assets/_Game/Scripts/Gameplay.meta +++ b/assets/_Game/Scripts/Gameplay.meta @@ -2,7 +2,7 @@ "ver": "1.1.0", "importer": "directory", "imported": true, - "uuid": "7ccc8c31-3541-418f-98a0-c2b46990d9d2", + "uuid": "6f3c79a3-69f3-449e-8b6e-1c4028c2f7f3", "files": [], "subMetas": {}, "userData": { diff --git a/assets/_Game/Scripts/Gameplay/Ball.ts b/assets/_Game/Scripts/Gameplay/Ball.ts index aa753d1..7d50cc4 100644 --- a/assets/_Game/Scripts/Gameplay/Ball.ts +++ b/assets/_Game/Scripts/Gameplay/Ball.ts @@ -42,6 +42,8 @@ export class Ball extends Component implements IPoolable { private _collider: CircleCollider2D; @property({ type: AudioClip, visible: true }) private _hitSound: AudioClip; + @property({ type: AudioClip, visible: true }) + private _ballThrowSound: AudioClip; @property({ type: geometry.AnimationCurve, visible: true }) private _jumpCurve: geometry.AnimationCurve = new geometry.AnimationCurve(); @@ -91,7 +93,6 @@ export class Ball extends Component implements IPoolable { ) { if (this._isHit) return; this._isHit = true; - console.log(contact.getTangentSpeed()); if (this._rigidBody.linearVelocity.length() >= 5) { let hitPoint = contact.getWorldManifold().points[0]; @@ -128,6 +129,7 @@ export class Ball extends Component implements IPoolable { } public throwBall(force: Vec2) { + SoundManager.instance.playSfx(this._ballThrowSound); this._collider.group = PhysicsGroup.BALL_THROWING; this._rigidBody.group = PhysicsGroup.BALL_THROWING; this._rigidBody.applyLinearImpulseToCenter(force, true); diff --git a/assets/_Game/Scripts/Gameplay/Ball.ts.meta b/assets/_Game/Scripts/Gameplay/Ball.ts.meta index 5f36b3d..48d18a5 100644 --- a/assets/_Game/Scripts/Gameplay/Ball.ts.meta +++ b/assets/_Game/Scripts/Gameplay/Ball.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "4630a499-ab09-45a9-be81-52dae28beb55", + "uuid": "2b7c278f-afe7-4cb9-8b1e-ba6fd06040ac", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/Gameplay/Flipper.ts.meta b/assets/_Game/Scripts/Gameplay/Flipper.ts.meta index 6fc1f5d..53caa4f 100644 --- a/assets/_Game/Scripts/Gameplay/Flipper.ts.meta +++ b/assets/_Game/Scripts/Gameplay/Flipper.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "87072b4f-2c3c-48b0-86a9-7d1dc17a750e", + "uuid": "85a1dbb8-da01-4cac-81d4-1baa9ebf497f", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/Gameplay/Outer.ts.meta b/assets/_Game/Scripts/Gameplay/Outer.ts.meta index 1c0219b..8460e7f 100644 --- a/assets/_Game/Scripts/Gameplay/Outer.ts.meta +++ b/assets/_Game/Scripts/Gameplay/Outer.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "bbe27534-d4c2-4d1c-bd39-07c2605e319c", + "uuid": "ca8a0c78-2894-4634-915f-311944852103", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/_Game/Scripts/Manager/GameManager.ts b/assets/_Game/Scripts/Manager/GameManager.ts index 9a5ba65..94a3078 100644 --- a/assets/_Game/Scripts/Manager/GameManager.ts +++ b/assets/_Game/Scripts/Manager/GameManager.ts @@ -1,4 +1,16 @@ -import { _decorator, Component, Node, Prefab, Vec2, Vec3, randomRangeInt, CCInteger } from 'cc'; +import { + _decorator, + Component, + Node, + Prefab, + Vec2, + Vec3, + randomRangeInt, + CCInteger, + Director, + director, + AudioClip, +} from 'cc'; import ObjectPool from '../Pool/ObjectPool'; import { Ball } from '../GamePlay/Ball'; import Utilities from '../Utilities'; @@ -7,6 +19,7 @@ import { EventManger } from './EventManger'; import GameEvent from '../Events/GameEvent'; import ScoreType from '../Enum/ScoreType'; import { FloatingText } from '../Environments/FloatingText'; +import { SoundManager } from './SoundManager'; const { ccclass, property } = _decorator; @ccclass('GameManager') @@ -27,12 +40,18 @@ export class GameManager extends Component { private _ballSpawnPosition: Vec3; @property({ type: CCInteger, visible: true }) private _balls = 3; + @property({ type: AudioClip, visible: true }) + private _startSound: AudioClip; + @property({ type: AudioClip, visible: true }) + private _backgroundMusic: AudioClip; private _ballPool: ObjectPool; private _FloatingScorePool: ObjectPool; - private _gameState = GameState.Init; + private _gameState: GameState; - public highestStreak: number; + public get balls() { + return this._balls; + } private _score = 0; private _isMultiBall = false; private _currentBallInGame = 0; @@ -47,9 +66,8 @@ export class GameManager extends Component { this._FloatingScorePool = new ObjectPool(this._floatingScoreText, 10, true); } - protected start() { - this.spawnBall(true); - this.play(); + protected start(): void { + this.changeGameState(GameState.Init); } private changeGameState(state: GameState) { @@ -82,6 +100,7 @@ export class GameManager extends Component { } public spawnBall(throwBall: boolean): Ball { + SoundManager.instance.playSfx(this._startSound); this.setCurrentBallInGame(1); const ball = this._ballPool.get(this.node, Ball); ball.node.setPosition(this._ballSpawnPosition); @@ -99,8 +118,9 @@ export class GameManager extends Component { this.setCurrentBallInGame(-1); if (this._currentBallInGame <= 0) { this._balls--; - EventManger.instance.emit(GameEvent.BallOut, null); + EventManger.instance.emit(GameEvent.BallOut, this._balls); if (this._balls === 0) { + await Utilities.delay(1000); this.changeGameState(GameState.GameOver); return; } @@ -118,12 +138,25 @@ export class GameManager extends Component { } } - public destroyEnviromentsObject(bonusScore: number, position: Vec3) { + public destroyEnvironmentObject(bonusScore: number, position: Vec3) { this.addScore(bonusScore, ScoreType.DestroyObject, position); } - public play() { + public async play() { + SoundManager.instance.playBGM(this._backgroundMusic, 0.5); this.changeGameState(GameState.Playing); + await Utilities.delay(1000); + this.spawnBall(true); + } + + public async restart() { + this._balls = 3; + this._score = 0; + this._currentBallInGame = 0; + this._isMultiBall = false; + this.changeGameState(GameState.Playing); + await Utilities.delay(1000); + this.spawnBall(true); } public onRevive() { diff --git a/assets/_Game/Scripts/Manager/SoundManager.ts b/assets/_Game/Scripts/Manager/SoundManager.ts index 3044cab..72867f9 100644 --- a/assets/_Game/Scripts/Manager/SoundManager.ts +++ b/assets/_Game/Scripts/Manager/SoundManager.ts @@ -68,7 +68,7 @@ export class SoundManager extends Component { } public playBGM(audio: AudioClip, volume = 1, loop = true) { - if (this._audioSourceBgm) { + if (!this._audioSourceBgm) { this._audioSourceBgm = new SoundSource(); this._audioSourceBgm.source = new AudioSource('audioSourceBgm'); this._audioSourceBgm.source.playOnAwake = false; diff --git a/assets/_Game/Scripts/UI/EndGameUIController.ts b/assets/_Game/Scripts/UI/EndGameUIController.ts index fa94f17..3deaafe 100644 --- a/assets/_Game/Scripts/UI/EndGameUIController.ts +++ b/assets/_Game/Scripts/UI/EndGameUIController.ts @@ -76,7 +76,7 @@ export class EndGameUIController extends Component { switch (this.currentState) { case PanelState.CompareScore: this.TurnOffAllPanels(this.compareScorePnl); - var totalScore = GameManager.instance.score + GameManager.instance.highestStreak * 2; + var totalScore = GameManager.instance.score; this.yourScoreTxt.string = 'Your score: ' + totalScore; /// Todo: set top score here diff --git a/assets/_Game/Scripts/UI/UIController.ts b/assets/_Game/Scripts/UI/UIController.ts index e8a88e6..39fa0df 100644 --- a/assets/_Game/Scripts/UI/UIController.ts +++ b/assets/_Game/Scripts/UI/UIController.ts @@ -1,14 +1,65 @@ -import { _decorator, Component, Node } from 'cc'; +import { _decorator, Component, Label, Node, tween } from 'cc'; +import { EventManger } from '../Manager/EventManger'; +import GameEvent from '../Events/GameEvent'; +import ScoreType from '../Enum/ScoreType'; +import Utilities from '../Utilities'; +import GameState from '../Enum/GameState'; +import { GameManager } from '../Manager/GameManager'; const { ccclass, property } = _decorator; @ccclass('UIController') export class UIController extends Component { - start() { + @property({ type: Label, visible: true }) + private _scoreLabel: Label; + @property({ type: Label, visible: true }) + private _ballLabel: Label; + @property({ type: Label, visible: true }) + private _goalLabel: Label; + @property({ type: Label, visible: true }) + private _resultLabel: Label; + @property({ type: Node, visible: true }) + private _startPanel: Node; + @property({ type: Node, visible: true }) + private _overPanel: Node; + protected onLoad(): void { + EventManger.instance.on(GameEvent.Score, this.onScore, this); + EventManger.instance.on(GameEvent.BallOut, this.onBallOut, this); + EventManger.instance.on(GameEvent.GameStateChange, this.onGameStateChange, this); + this._goalLabel.string = ''; } - update(deltaTime: number) { - + private async onScore(score: number, type: ScoreType) { + this._scoreLabel.string = `Score: ${score}`; + if (type == ScoreType.Goal) { + this._goalLabel.string = 'Goal!!'; + await Utilities.delay(1000); + this._goalLabel.string = ''; + } + } + + private async onBallOut(balls: number) { + this._ballLabel.string = `Ball ${balls}`; + this._goalLabel.string = 'Ball Out!!'; + await Utilities.delay(1000); + this._goalLabel.string = ''; + } + + private onGameStateChange(state: GameState) { + switch (state) { + case GameState.Init: + this._startPanel.active = true; + break; + case GameState.Playing: + this._scoreLabel.string = 'Score: 0'; + this._ballLabel.string = `Ball: ${GameManager.instance.balls}`; + this._startPanel.active = false; + this._overPanel.active = false; + break; + case GameState.GameOver: + this._overPanel.active = true; + this._resultLabel.string = this._scoreLabel.string; + break; + } } } - diff --git a/assets/_Game/Sounds/MS_BG_ingame.mp3 b/assets/_Game/Sounds/MS_BG_ingame.mp3 new file mode 100644 index 0000000..310b8cc Binary files /dev/null and b/assets/_Game/Sounds/MS_BG_ingame.mp3 differ diff --git a/assets/_Game/Sounds/MS_BG_ingame.mp3.meta b/assets/_Game/Sounds/MS_BG_ingame.mp3.meta new file mode 100644 index 0000000..54bbd4d --- /dev/null +++ b/assets/_Game/Sounds/MS_BG_ingame.mp3.meta @@ -0,0 +1,14 @@ +{ + "ver": "1.0.0", + "importer": "audio-clip", + "imported": true, + "uuid": "fc66df28-6c8c-4915-adbd-5a3da652cfc6", + "files": [ + ".json", + ".mp3" + ], + "subMetas": {}, + "userData": { + "downloadMode": 0 + } +} diff --git a/assets/_Game/Sounds/SFX_score.mp3 b/assets/_Game/Sounds/SFX_score.mp3 new file mode 100644 index 0000000..73b2555 Binary files /dev/null and b/assets/_Game/Sounds/SFX_score.mp3 differ diff --git a/assets/_Game/Sounds/SFX_score.mp3.meta b/assets/_Game/Sounds/SFX_score.mp3.meta new file mode 100644 index 0000000..7b4a720 --- /dev/null +++ b/assets/_Game/Sounds/SFX_score.mp3.meta @@ -0,0 +1,14 @@ +{ + "ver": "1.0.0", + "importer": "audio-clip", + "imported": true, + "uuid": "1f602e14-2769-4903-b4d2-b0977eeaf36b", + "files": [ + ".json", + ".mp3" + ], + "subMetas": {}, + "userData": { + "downloadMode": 0 + } +} diff --git a/assets/_Game/Sprites/goal.png.meta b/assets/_Game/Sprites/goal.png.meta index 687f942..3a47b46 100644 --- a/assets/_Game/Sprites/goal.png.meta +++ b/assets/_Game/Sprites/goal.png.meta @@ -11,7 +11,7 @@ "6c48a": { "importer": "texture", "uuid": "3edb092d-e894-4a3f-8a19-d1dcb1c80ff8@6c48a", - "displayName": "Goal", + "displayName": "goal", "id": "6c48a", "name": "texture", "userData": { @@ -35,7 +35,7 @@ "f9941": { "importer": "sprite-frame", "uuid": "3edb092d-e894-4a3f-8a19-d1dcb1c80ff8@f9941", - "displayName": "Goal", + "displayName": "goal", "id": "f9941", "name": "spriteFrame", "userData": {