feat: update effect

main
tiendat3699 2024-02-28 18:25:11 +07:00
parent 720b8ebfc2
commit 013d8d3d7e
37 changed files with 4057 additions and 1379 deletions

17
.prettierrc Normal file
View File

@ -0,0 +1,17 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}

12
assets/Animations.meta Normal file
View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "8670cb90-7797-4574-b557-379a46b2bc37",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

210
assets/Animations/goal.anim Normal file
View File

@ -0,0 +1,210 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "goal",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 60,
"speed": 1,
"wrapMode": 1,
"enableTrsBlending": false,
"_duration": 0.25,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": []
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channels": [
{
"__id__": 4
},
{
"__id__": 6
},
{
"__id__": 8
},
{
"__id__": 10
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 3
},
"position"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "Sprite"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 5
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.03333333333333333,
0.08333333333333333,
0.15,
0.2,
0.25
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -10,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -2,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 10,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -3,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 7
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 9
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 11
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "e0cda13a-c026-4d67-82c4-54acfe00f72d",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "goal"
}
}

BIN
assets/Assets/P4P_BG-01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.25",
"importer": "image",
"imported": true,
"uuid": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@6c48a",
"displayName": "P4P_BG-01",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@f9941",
"displayName": "P4P_BG-01",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 512,
"height": 512,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-256,
-256,
0,
256,
-256,
0,
-256,
256,
0,
256,
256,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
512,
512,
512,
0,
0,
512,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-256,
-256,
0
],
"maxPos": [
256,
256,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@6c48a",
"atlasUuid": ""
},
"ver": "1.0.11",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": true,
"hasAlpha": true,
"redirect": "98ce9fe6-ed8c-477d-96ba-d283b6ac387a@f9941"
}
}

BIN
assets/Assets/streak.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -0,0 +1,43 @@
{
"ver": "1.0.25",
"importer": "image",
"imported": true,
"uuid": "d2e7191d-3d2d-41b9-9714-e81a24fbb176",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"ver": "1.0.22",
"importer": "texture",
"uuid": "d2e7191d-3d2d-41b9-9714-e81a24fbb176@6c48a",
"imported": true,
"files": [
".json"
],
"subMetas": {},
"userData": {
"wrapModeS": "repeat",
"wrapModeT": "repeat",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"premultiplyAlpha": false,
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "d2e7191d-3d2d-41b9-9714-e81a24fbb176",
"visible": true
},
"displayName": "streak",
"id": "6c48a",
"name": "texture"
}
},
"userData": {
"type": "texture",
"redirect": "d2e7191d-3d2d-41b9-9714-e81a24fbb176@6c48a",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false
}
}

12
assets/Materials.meta Normal file
View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "ac37de03-472a-4f50-b416-d69ec65dad2f",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,37 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "d1346436-ac96-4271-b863-1f4fdead95b0",
"__expectedType__": "cc.EffectAsset"
},
"_techIdx": 0,
"_defines": [
{}
],
"_states": [
{
"stage": 200,
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
}
],
"_props": [
{
"tintColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
}
]
}

View File

@ -0,0 +1,11 @@
{
"ver": "1.0.20",
"importer": "material",
"imported": true,
"uuid": "601118ed-3a55-4d36-9364-79083615a5d6",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,37 @@
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "17debcc3-0a6b-4b8a-b00b-dc58b885581e",
"__expectedType__": "cc.EffectAsset"
},
"_techIdx": 0,
"_defines": [
{}
],
"_states": [
{
"stage": 200,
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
}
],
"_props": [
{
"tintColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
}
]
}

View File

@ -0,0 +1,11 @@
{
"ver": "1.0.20",
"importer": "material",
"imported": true,
"uuid": "4ffbb8e9-885f-46a7-9c2e-dc3b9ed9f7e2",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -16,27 +16,31 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 2
"__id__": 61
},
{
"__id__": 4
"__id__": 63
},
{
"__id__": 6
"__id__": 65
},
{
"__id__": 8
"__id__": 67
},
{
"__id__": 10
"__id__": 69
}
],
"_prefab": {
"__id__": 12
"__id__": 71
},
"_lpos": {
"__type__": "cc.Vec3",
@ -53,8 +57,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.3,
"y": 0.3,
"x": 0.2,
"y": 0.2,
"z": 1
},
"_mobility": 0,
@ -67,6 +71,762 @@
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Trail",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 60
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 10
},
"_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": ""
},
{
"__type__": "cc.ParticleSystem",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_materials": [
{
"__uuid__": "ea7478b0-408d-4052-b703-f0d2355e095f",
"__expectedType__": "cc.Material"
},
null
],
"_visFlags": 0,
"startColor": {
"__id__": 5
},
"scaleSpace": 1,
"startSize3D": false,
"startSizeX": {
"__id__": 6
},
"startSize": {
"__id__": 6
},
"startSizeY": {
"__id__": 7
},
"startSizeZ": {
"__id__": 8
},
"startSpeed": {
"__id__": 9
},
"startRotation3D": false,
"startRotationX": {
"__id__": 10
},
"startRotationY": {
"__id__": 11
},
"startRotationZ": {
"__id__": 12
},
"startRotation": {
"__id__": 12
},
"startDelay": {
"__id__": 13
},
"startLifetime": {
"__id__": 14
},
"duration": 1,
"loop": true,
"simulationSpeed": 1,
"playOnAwake": true,
"gravityModifier": {
"__id__": 15
},
"rateOverTime": {
"__id__": 16
},
"rateOverDistance": {
"__id__": 17
},
"bursts": [],
"_renderCulling": false,
"_cullingMode": 0,
"_aabbHalfX": 0,
"_aabbHalfY": 0,
"_aabbHalfZ": 0,
"_dataCulling": false,
"enableCulling": false,
"_colorOverLifetimeModule": {
"__id__": 18
},
"_shapeModule": {
"__id__": 20
},
"_sizeOvertimeModule": {
"__id__": 22
},
"_velocityOvertimeModule": {
"__id__": 27
},
"_forceOvertimeModule": {
"__id__": 32
},
"_limitVelocityOvertimeModule": {
"__id__": 36
},
"_rotationOvertimeModule": {
"__id__": 41
},
"_textureAnimationModule": {
"__id__": 45
},
"_noiseModule": {
"__id__": 49
},
"_trailModule": {
"__id__": 50
},
"renderer": {
"__id__": 59
},
"_prewarm": true,
"_capacity": 1,
"_simulationSpace": 1,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "46cV34eRFEJo7sL1+RIesi"
},
{
"__type__": "cc.GradientRange",
"_mode": 0,
"color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 30,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 1000,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 1,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.ColorOvertimeModule",
"_enable": false,
"color": {
"__id__": 19
}
},
{
"__type__": "cc.GradientRange",
"_mode": 0,
"color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
},
{
"__type__": "cc.ShapeModule",
"_enable": false,
"_shapeType": 2,
"shapeType": 2,
"emitFrom": 0,
"alignToDirection": false,
"randomDirectionAmount": 0,
"sphericalDirectionAmount": 0,
"randomPositionAmount": 0,
"radius": 1,
"radiusThickness": 1,
"arcMode": 0,
"arcSpread": 0,
"arcSpeed": {
"__id__": 21
},
"length": 5,
"boxThickness": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_position": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_rotation": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_arc": 6.283185307179586,
"_angle": 0.4363323129985824
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 1,
"multiplier": 1
},
{
"__type__": "cc.SizeOvertimeModule",
"_enable": false,
"separateAxes": false,
"size": {
"__id__": 23
},
"x": {
"__id__": 24
},
"y": {
"__id__": 25
},
"z": {
"__id__": 26
}
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.VelocityOvertimeModule",
"_enable": false,
"x": {
"__id__": 28
},
"y": {
"__id__": 29
},
"z": {
"__id__": 30
},
"speedModifier": {
"__id__": 31
},
"space": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 1,
"multiplier": 1
},
{
"__type__": "cc.ForceOvertimeModule",
"_enable": false,
"x": {
"__id__": 33
},
"y": {
"__id__": 34
},
"z": {
"__id__": 35
},
"space": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.LimitVelocityOvertimeModule",
"_enable": false,
"limitX": {
"__id__": 37
},
"limitY": {
"__id__": 38
},
"limitZ": {
"__id__": 39
},
"limit": {
"__id__": 40
},
"dampen": 3,
"separateAxes": false,
"space": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.RotationOvertimeModule",
"_enable": false,
"_separateAxes": false,
"x": {
"__id__": 42
},
"y": {
"__id__": 43
},
"z": {
"__id__": 44
}
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.TextureAnimationModule",
"_enable": false,
"_numTilesX": 0,
"numTilesX": 0,
"_numTilesY": 0,
"numTilesY": 0,
"_mode": 0,
"animation": 0,
"frameOverTime": {
"__id__": 46
},
"startFrame": {
"__id__": 48
},
"cycleCount": 0,
"_flipU": 0,
"_flipV": 0,
"_uvChannelMask": -1,
"randomRow": false,
"rowIndex": 0
},
{
"__type__": "cc.CurveRange",
"mode": 1,
"spline": {
"__id__": 47
},
"multiplier": 1
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
1
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 2,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 2,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 0,
"leftTangent": 0,
"leftTangentWeight": 0,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.NoiseModule",
"_enable": false,
"_strengthX": 10,
"_strengthY": 10,
"_strengthZ": 10,
"_noiseSpeedX": 0,
"_noiseSpeedY": 0,
"_noiseSpeedZ": 0,
"_noiseFrequency": 1,
"_remapX": 0,
"_remapY": 0,
"_remapZ": 0,
"_octaves": 1,
"_octaveMultiplier": 0.5,
"_octaveScale": 2
},
{
"__type__": "cc.TrailModule",
"_enable": true,
"mode": 0,
"lifeTime": {
"__id__": 51
},
"_minParticleDistance": 0.1,
"existWithParticles": true,
"textureMode": 0,
"widthFromParticle": true,
"widthRatio": {
"__id__": 52
},
"colorFromParticle": false,
"colorOverTrail": {
"__id__": 54
},
"colorOvertime": {
"__id__": 58
},
"_space": 0,
"_particleSystem": {
"__id__": 3
}
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 0.2,
"multiplier": 1
},
{
"__type__": "cc.CurveRange",
"mode": 1,
"spline": {
"__id__": 53
},
"multiplier": 1
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.29,
1
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 2,
"tangentWeightMode": 0,
"value": 1,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 2,
"tangentWeightMode": 0,
"value": 0.42592592592592593,
"rightTangent": -1.0937886661717398,
"rightTangentWeight": 0.10006138082593509,
"leftTangent": -1.0937886661717398,
"leftTangentWeight": 0.0047293447293447295,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 2,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.GradientRange",
"_mode": 1,
"gradient": {
"__id__": 55
}
},
{
"__type__": "cc.Gradient",
"colorKeys": [],
"alphaKeys": [
{
"__id__": 56
},
{
"__id__": 57
}
],
"mode": 0
},
{
"__type__": "cc.AlphaKey",
"alpha": 255,
"time": 0
},
{
"__type__": "cc.AlphaKey",
"alpha": 0,
"time": 1
},
{
"__type__": "cc.GradientRange",
"_mode": 0,
"color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
},
{
"__type__": "cc.ParticleSystemRenderer",
"_renderMode": 0,
"_velocityScale": 1,
"_lengthScale": 1,
"_mesh": null,
"_cpuMaterial": {
"__uuid__": "ea7478b0-408d-4052-b703-f0d2355e095f",
"__expectedType__": "cc.Material"
},
"_gpuMaterial": null,
"_mainTexture": {
"__uuid__": "b5b27ab1-e740-4398-b407-848fc2b2c897@6c48a",
"__expectedType__": "cc.Texture2D"
},
"_useGPU": false,
"_alignSpace": 2
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "74Oi+ZAplPMoqFJ0+Pm+/N",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -77,7 +837,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 3
"__id__": 62
},
"_contentSize": {
"__type__": "cc.Size",
@ -105,7 +865,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 5
"__id__": 64
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@ -150,13 +910,13 @@
},
"_enabled": true,
"__prefab": {
"__id__": 7
"__id__": 66
},
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": false,
"_friction": 0,
"_friction": 2,
"_restitution": 0.5,
"_offset": {
"__type__": "cc.Vec2",
@ -180,7 +940,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 9
"__id__": 68
},
"enabledContactListener": true,
"bullet": true,
@ -188,9 +948,9 @@
"_group": 1,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_gravityScale": 2,
"_linearDamping": 0,
"_angularDamping": 0,
"_angularDamping": 0.05,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
@ -208,19 +968,23 @@
"__type__": "cad12cEubBIXb2NvvCon5Ge",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
"__id__": 70
},
"maxSpeed": 2,
"maxSpeed": 70,
"rigidbody": {
"__id__": 8
"__id__": 67
},
"collider": {
"__id__": 6
"__id__": 65
},
"trail": {
"__id__": 3
},
"_id": ""
},
@ -238,30 +1002,6 @@
},
"fileId": "ecwvc2xHdIf6kSfbLqrETl",
"instance": null,
"targetOverrides": [
{
"__id__": 13
}
]
},
{
"__type__": "cc.TargetOverrideInfo",
"source": {
"__id__": 10
},
"sourceInfo": null,
"propertyPath": [
"goalParticle"
],
"target": null,
"targetInfo": {
"__id__": 14
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"74gD9Y10BHHIFl8LKXE/Rx"
]
"targetOverrides": null
}
]

View File

@ -24,7 +24,7 @@
}
],
"_prefab": {
"__id__": 59
"__id__": 62
},
"_lpos": {
"__type__": "cc.Vec3",
@ -79,53 +79,57 @@
"scaleSpace": 1,
"startSize3D": true,
"startSizeX": {
"__id__": 9
},
"startSize": {
"__id__": 9
},
"startSizeY": {
"__id__": 10
},
"startSizeZ": {
"startSize": {
"__id__": 10
},
"startSizeY": {
"__id__": 11
},
"startSpeed": {
"startSizeZ": {
"__id__": 12
},
"startSpeed": {
"__id__": 13
},
"startRotation3D": true,
"startRotationX": {
"__id__": 13
},
"startRotationY": {
"__id__": 14
},
"startRotationY": {
"__id__": 15
},
"startRotationZ": {
"__id__": 15
},
"startRotation": {
"__id__": 15
},
"startDelay": {
"__id__": 16
},
"startLifetime": {
"startRotation": {
"__id__": 16
},
"startDelay": {
"__id__": 17
},
"startLifetime": {
"__id__": 18
},
"duration": 1.5,
"loop": false,
"loop": true,
"simulationSpeed": 1,
"playOnAwake": true,
"gravityModifier": {
"__id__": 18
},
"rateOverTime": {
"__id__": 19
},
"rateOverDistance": {
"rateOverTime": {
"__id__": 20
},
"bursts": [],
"rateOverDistance": {
"__id__": 21
},
"bursts": [
{
"__id__": 22
}
],
"_renderCulling": false,
"_cullingMode": 0,
"_aabbHalfX": 0,
@ -134,37 +138,37 @@
"_dataCulling": false,
"enableCulling": false,
"_colorOverLifetimeModule": {
"__id__": 21
"__id__": 24
},
"_shapeModule": {
"__id__": 23
"__id__": 26
},
"_sizeOvertimeModule": {
"__id__": 25
"__id__": 28
},
"_velocityOvertimeModule": {
"__id__": 30
"__id__": 33
},
"_forceOvertimeModule": {
"__id__": 35
"__id__": 38
},
"_limitVelocityOvertimeModule": {
"__id__": 39
"__id__": 42
},
"_rotationOvertimeModule": {
"__id__": 44
"__id__": 47
},
"_textureAnimationModule": {
"__id__": 48
"__id__": 51
},
"_noiseModule": {
"__id__": 52
"__id__": 55
},
"_trailModule": {
"__id__": 53
"__id__": 56
},
"renderer": {
"__id__": 58
"__id__": 61
},
"_prewarm": false,
"_capacity": 100,
@ -177,7 +181,7 @@
},
{
"__type__": "cc.GradientRange",
"_mode": 1,
"_mode": 4,
"gradient": {
"__id__": 5
}
@ -195,7 +199,11 @@
"__id__": 8
}
],
"alphaKeys": [],
"alphaKeys": [
{
"__id__": 9
}
],
"mode": 0
},
{
@ -231,6 +239,11 @@
},
"time": 0.75
},
{
"__type__": "cc.AlphaKey",
"alpha": 255,
"time": 0
},
{
"__type__": "cc.CurveRange",
"mode": 3,
@ -310,11 +323,26 @@
"constant": 0,
"multiplier": 1
},
{
"__type__": "cc.Burst",
"_time": 0.05,
"_repeatCount": 1,
"repeatInterval": 0.01,
"count": {
"__id__": 23
}
},
{
"__type__": "cc.CurveRange",
"mode": 0,
"constant": 100,
"multiplier": 1
},
{
"__type__": "cc.ColorOvertimeModule",
"_enable": false,
"color": {
"__id__": 22
"__id__": 25
}
},
{
@ -343,7 +371,7 @@
"arcMode": 0,
"arcSpread": 0,
"arcSpeed": {
"__id__": 24
"__id__": 27
},
"length": 5,
"boxThickness": {
@ -384,16 +412,16 @@
"_enable": false,
"separateAxes": false,
"size": {
"__id__": 26
"__id__": 29
},
"x": {
"__id__": 27
"__id__": 30
},
"y": {
"__id__": 28
"__id__": 31
},
"z": {
"__id__": 29
"__id__": 32
}
},
{
@ -424,16 +452,16 @@
"__type__": "cc.VelocityOvertimeModule",
"_enable": false,
"x": {
"__id__": 31
"__id__": 34
},
"y": {
"__id__": 32
"__id__": 35
},
"z": {
"__id__": 33
"__id__": 36
},
"speedModifier": {
"__id__": 34
"__id__": 37
},
"space": 1
},
@ -465,13 +493,13 @@
"__type__": "cc.ForceOvertimeModule",
"_enable": false,
"x": {
"__id__": 36
"__id__": 39
},
"y": {
"__id__": 37
"__id__": 40
},
"z": {
"__id__": 38
"__id__": 41
},
"space": 1
},
@ -497,16 +525,16 @@
"__type__": "cc.LimitVelocityOvertimeModule",
"_enable": false,
"limitX": {
"__id__": 40
"__id__": 43
},
"limitY": {
"__id__": 41
"__id__": 44
},
"limitZ": {
"__id__": 42
"__id__": 45
},
"limit": {
"__id__": 43
"__id__": 46
},
"dampen": 3,
"separateAxes": false,
@ -541,13 +569,13 @@
"_enable": false,
"_separateAxes": false,
"x": {
"__id__": 45
"__id__": 48
},
"y": {
"__id__": 46
"__id__": 49
},
"z": {
"__id__": 47
"__id__": 50
}
},
{
@ -578,10 +606,10 @@
"_mode": 0,
"animation": 0,
"frameOverTime": {
"__id__": 49
"__id__": 52
},
"startFrame": {
"__id__": 51
"__id__": 54
},
"cycleCount": 0,
"_flipU": 0,
@ -594,7 +622,7 @@
"__type__": "cc.CurveRange",
"mode": 1,
"spline": {
"__id__": 50
"__id__": 53
},
"multiplier": 1
},
@ -661,21 +689,21 @@
"_enable": false,
"mode": 0,
"lifeTime": {
"__id__": 54
"__id__": 57
},
"_minParticleDistance": 0.1,
"existWithParticles": true,
"textureMode": 0,
"widthFromParticle": true,
"widthRatio": {
"__id__": 55
"__id__": 58
},
"colorFromParticle": false,
"colorOverTrail": {
"__id__": 56
"__id__": 59
},
"colorOvertime": {
"__id__": 57
"__id__": 60
},
"_space": 0,
"_particleSystem": {
@ -743,6 +771,7 @@
"__id__": 0
},
"fileId": "65yusfkDBDE68dh4sqPVS4",
"instance": null,
"targetOverrides": null
}
]

View File

@ -27,23 +27,23 @@
"__id__": 6
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 22
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 39
},
{
"__id__": 32
"__id__": 41
}
],
"_prefab": {
"__id__": 34
"__id__": 43
},
"_lpos": {
"__type__": "cc.Vec3",
@ -230,6 +230,12 @@
},
{
"__id__": 13
},
{
"__id__": 14
},
{
"__id__": 16
}
],
"removedComponents": []
@ -296,6 +302,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -303,14 +335,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 15
"__id__": 18
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 17
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -318,7 +350,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 16
"__id__": 19
},
"targetOverrides": null
},
@ -331,17 +363,23 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 20
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 23
},
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 27
}
],
"removedComponents": []
@ -349,7 +387,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_name"
@ -365,7 +403,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lpos"
@ -380,7 +418,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lrot"
@ -396,7 +434,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_euler"
@ -408,6 +446,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -415,14 +479,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 23
"__id__": 29
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 22
"__id__": 28
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -430,7 +494,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 24
"__id__": 30
},
"targetOverrides": null
},
@ -444,16 +508,22 @@
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 25
"__id__": 31
},
{
"__id__": 27
"__id__": 33
},
{
"__id__": 28
"__id__": 34
},
{
"__id__": 29
"__id__": 35
},
{
"__id__": 36
},
{
"__id__": 38
}
],
"removedComponents": []
@ -461,7 +531,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_name"
@ -477,7 +547,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lpos"
@ -492,7 +562,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lrot"
@ -508,7 +578,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_euler"
@ -520,6 +590,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -529,7 +625,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 31
"__id__": 40
},
"_contentSize": {
"__type__": "cc.Size",
@ -556,17 +652,17 @@
},
"_enabled": true,
"__prefab": {
"__id__": 33
"__id__": 42
},
"targets": [
{
"__id__": 6
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 22
"__id__": 28
}
],
"waypoints": [
@ -598,10 +694,10 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 22
"__id__": 28
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 6

View File

@ -27,23 +27,23 @@
"__id__": 6
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 22
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 39
},
{
"__id__": 32
"__id__": 41
}
],
"_prefab": {
"__id__": 34
"__id__": 43
},
"_lpos": {
"__type__": "cc.Vec3",
@ -230,6 +230,12 @@
},
{
"__id__": 13
},
{
"__id__": 14
},
{
"__id__": 16
}
],
"removedComponents": []
@ -296,6 +302,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -303,14 +335,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 15
"__id__": 18
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 17
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -318,7 +350,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 16
"__id__": 19
},
"targetOverrides": null
},
@ -331,17 +363,23 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 20
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 23
},
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 27
}
],
"removedComponents": []
@ -349,7 +387,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_name"
@ -365,7 +403,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lpos"
@ -380,7 +418,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lrot"
@ -396,7 +434,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_euler"
@ -408,6 +446,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -415,14 +479,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 23
"__id__": 29
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 22
"__id__": 28
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -430,7 +494,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 24
"__id__": 30
},
"targetOverrides": null
},
@ -444,16 +508,22 @@
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 25
"__id__": 31
},
{
"__id__": 27
"__id__": 33
},
{
"__id__": 28
"__id__": 34
},
{
"__id__": 29
"__id__": 35
},
{
"__id__": 36
},
{
"__id__": 38
}
],
"removedComponents": []
@ -461,7 +531,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_name"
@ -477,7 +547,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lpos"
@ -492,7 +562,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lrot"
@ -508,7 +578,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_euler"
@ -520,6 +590,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -529,7 +625,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 31
"__id__": 40
},
"_contentSize": {
"__type__": "cc.Size",
@ -556,7 +652,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 33
"__id__": 42
},
"targets": [],
"waypoints": [
@ -588,10 +684,10 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 22
"__id__": 28
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 6

View File

@ -27,23 +27,23 @@
"__id__": 6
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 22
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 39
},
{
"__id__": 32
"__id__": 41
}
],
"_prefab": {
"__id__": 34
"__id__": 43
},
"_lpos": {
"__type__": "cc.Vec3",
@ -230,6 +230,12 @@
},
{
"__id__": 13
},
{
"__id__": 14
},
{
"__id__": 16
}
],
"removedComponents": []
@ -296,6 +302,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 15
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -303,14 +335,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 15
"__id__": 18
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 14
"__id__": 17
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -318,7 +350,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 16
"__id__": 19
},
"targetOverrides": null
},
@ -331,17 +363,23 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 20
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 23
},
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 27
}
],
"removedComponents": []
@ -349,7 +387,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_name"
@ -365,7 +403,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lpos"
@ -380,7 +418,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_lrot"
@ -396,7 +434,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 18
"__id__": 21
},
"propertyPath": [
"_euler"
@ -408,6 +446,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.Node",
"_objFlags": 0,
@ -415,14 +479,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 23
"__id__": 29
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 22
"__id__": 28
},
"asset": {
"__uuid__": "f49ff774-8d49-42fd-81de-aeb7f53d03f5",
@ -430,7 +494,7 @@
},
"fileId": "a0kYAhzm5AAa3h8r/fe/j5",
"instance": {
"__id__": 24
"__id__": 30
},
"targetOverrides": null
},
@ -444,16 +508,22 @@
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 25
"__id__": 31
},
{
"__id__": 27
"__id__": 33
},
{
"__id__": 28
"__id__": 34
},
{
"__id__": 29
"__id__": 35
},
{
"__id__": 36
},
{
"__id__": 38
}
],
"removedComponents": []
@ -461,7 +531,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_name"
@ -477,7 +547,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lpos"
@ -492,7 +562,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_lrot"
@ -508,7 +578,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 26
"__id__": 32
},
"propertyPath": [
"_euler"
@ -520,6 +590,32 @@
"z": -90
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_restitution"
],
"value": 0.3
},
{
"__type__": "cc.TargetInfo",
"localID": [
"7egu3Zm5tHjb52E6fmax1G"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 37
},
"propertyPath": [
"_friction"
],
"value": 2
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -529,7 +625,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 31
"__id__": 40
},
"_contentSize": {
"__type__": "cc.Size",
@ -556,11 +652,11 @@
},
"_enabled": true,
"__prefab": {
"__id__": 33
"__id__": 42
},
"targets": [
{
"__id__": 14
"__id__": 17
}
],
"waypoints": [
@ -592,10 +688,10 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 22
"__id__": 28
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 6

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,10 @@
import { _decorator } from 'cc';
import * as CryptoES from "crypto-es";
import * as CryptoES from 'crypto-es';
import { GameplayController } from './GameplayController';
export let CryptoESDefault = CryptoES.default;
const { ccclass, property } = _decorator;
@ccclass('BEConnector')
export default class BEConnector {
public static _instance: BEConnector = null;
@ -21,7 +20,7 @@ export default class BEConnector {
public maxScore: number;
private mileStone: string;
private gameURL: string = "";
private gameURL: string = '';
public static get instance() {
if (null == this._instance) {
@ -37,52 +36,52 @@ export default class BEConnector {
public getGameData() {
let url = new URLSearchParams(window.location.search);
this.token = url.get('token')
this.skinId = url.get('skinId')
this.tournamentId = url.get('tournamentId')
this.deviceInfo = url.get('deviceInfo')
this.token = url.get('token');
this.skinId = url.get('skinId');
this.tournamentId = url.get('tournamentId');
this.deviceInfo = url.get('deviceInfo');
this.numberTicket = parseInt(url.get('numberTicket'));
this.maxScore = parseInt(url.get('maxScore'));
this.mileStone = url.get("mileStone");
this.mileStone = url.get('mileStone');
this.gameURL = ENV_CONFIG[url.get('env')];
}
public async authenticate() {
await fetch(`${this.gameURL}/promotions/authenticate-tournament?token=${this.token}&tournamentId=${this.tournamentId}&skinId=${this.skinId}&deviceInfo=${this.deviceInfo}`)
await fetch(
`${this.gameURL}/promotions/authenticate-tournament?token=${this.token}&tournamentId=${this.tournamentId}&skinId=${this.skinId}&deviceInfo=${this.deviceInfo}`,
)
.then((response) => {
if (response.ok) {
return response.json();
}
})
.then(data => {
.then((data) => {
if (data.ResultCode == 1) {
this.key = data.Data.Key;
console.log("authen success", this.key);
}
else {
throw new Error("");
console.log('authen success', this.key);
} else {
throw new Error('');
}
})
.catch(err => console.log("authen failed"));
.catch((err) => console.log('authen failed'));
}
public ticketMinus(type: "auth" | "revive") {
let numberTicket = type === "auth" ? 1 : this.getTicketCanBeMinus();
public ticketMinus(type: 'auth' | 'revive') {
let numberTicket = type === 'auth' ? 1 : this.getTicketCanBeMinus();
let dataEncrypted: string = this.getDataEncrypted({ type: type, total: numberTicket });
fetch(`${this.gameURL}/promotions/ticket-minus/${this.tournamentId}/${this.skinId}?cocos=1`, {
headers: {
'Accept': 'application/json',
Accept: 'application/json',
'Content-Type': 'application/json',
'x-access-refactor-token': this.token,
},
method: "POST",
body: JSON.stringify({ data: dataEncrypted })
})
.then(() => {
this.numberTicket -= numberTicket;
})
method: 'POST',
body: JSON.stringify({ data: dataEncrypted }),
}).then(() => {
this.numberTicket -= numberTicket;
});
}
public calculatingTicketToContinue(scoreRange: object, yourScore: number) {
@ -96,22 +95,22 @@ export default class BEConnector {
const minValue = Math.min(...Object.values(scoreRange));
closestMilestone = minValue;
}
return closestMilestone
return closestMilestone;
}
public async checkGameScoreTicket() {
let totalScore: number = GameplayController.Instance().score;
let dataEncrypted: string = this.getDataEncrypted({ score: totalScore, ticket: this.getTicketCanBeMinus() })
let dataEncrypted: string = this.getDataEncrypted({ score: totalScore, ticket: this.getTicketCanBeMinus() });
await fetch(`${this.gameURL}/promotions/check-game-score-ticket/${this.tournamentId}/${this.skinId}?cocos=1`, {
headers: {
'Accept': 'application/json',
Accept: 'application/json',
'Content-Type': 'application/json',
'x-access-refactor-token': this.token,
},
method: "POST",
body: JSON.stringify({ data: dataEncrypted })
})
method: 'POST',
body: JSON.stringify({ data: dataEncrypted }),
});
}
public postMessage() {
@ -126,38 +125,40 @@ export default class BEConnector {
// "*"
// );
setTimeout(() => {
BEConnector.instance.numberTicket += 5
BEConnector.instance.numberTicket += 5;
GameplayController.Instance().OnRevive();
}, 2000);
}
public postScoreToServer(score: number) {
let dataEncrypted: string = this.getDataEncrypted({ Score: score, TournamentId: this.tournamentId, SkinId: this.skinId });
let dataEncrypted: string = this.getDataEncrypted({
Score: score,
TournamentId: this.tournamentId,
SkinId: this.skinId,
});
fetch(`${this.gameURL}/promotions/store-score-tournament?tournamentId=${this.tournamentId}&skinId=${this.skinId}&cocos=1`, {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'x-access-refactor-token': this.token,
fetch(
`${this.gameURL}/promotions/store-score-tournament?tournamentId=${this.tournamentId}&skinId=${this.skinId}&cocos=1`,
{
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'x-access-refactor-token': this.token,
},
method: 'POST',
body: JSON.stringify({ data: dataEncrypted }),
},
method: "POST",
body: JSON.stringify({ data: dataEncrypted })
})
.catch(err => console.log(err));
console.log("send score to server: " + score);
).catch((err) => console.log(err));
console.log('send score to server: ' + score);
window.parent.postMessage(
JSON.stringify({
error: false,
message: "Hello World",
message: 'Hello World',
score: score,
type: "game_tournament",
type: 'game_tournament',
}),
"*"
'*',
);
}
@ -165,7 +166,7 @@ export default class BEConnector {
return CryptoESDefault.AES.encrypt(JSON.stringify(data), this.key, {
iv: CryptoESDefault.enc.Utf8.parse('16'),
mode: CryptoESDefault.mode.CBC,
padding: CryptoESDefault.pad.Pkcs7
padding: CryptoESDefault.pad.Pkcs7,
}).toString();
}
@ -179,12 +180,10 @@ export default class BEConnector {
public canRelive() {
return this.numberTicket > this.getTicketCanBeMinus();
}
}
const ENV_CONFIG = {
"development": "http://192.168.1.144:3009/api",
"staging": "https://api.play4promote.com/api",
"production": "https://api.play4promo.com/api"
}
development: 'http://192.168.1.144:3009/api',
staging: 'https://api.play4promote.com/api',
production: 'https://api.play4promo.com/api',
};

View File

@ -1,4 +1,18 @@
import { _decorator, CCFloat, Collider, Collider2D, Component, Contact2DType, director, EventTarget, IPhysics2DContact, ParticleSystem, RigidBody2D, Vec2, } from 'cc';
import {
_decorator,
Animation,
CCFloat,
Collider2D,
Component,
Contact2DType,
Director,
director,
EventTarget,
IPhysics2DContact,
ParticleSystem,
RigidBody2D,
Vec2,
} from 'cc';
import { GameplayController } from './GameplayController';
import { SoundManager } from './SoundManager';
const { ccclass, property } = _decorator;
@ -11,22 +25,20 @@ export class Ball extends Component {
public rigidbody: RigidBody2D;
@property(Collider2D)
public collider: Collider2D;
@property(ParticleSystem)
private trail: ParticleSystem;
public isActive: boolean;
public eventHitObstacle = new EventTarget();
public eventGoal = new EventTarget();
protected start(): void {
protected onLoad(): void {
if (this.getComponent(Collider2D)) {
this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
this.collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
}
}
protected update(dt: number): void {
// if (this.rigidbody.linearVelocity.length() > this.maxSpeed) {
// //this.rigidbody.linearVelocity.set(this.rigidbody.linearVelocity.normalize().multiplyScalar(this.maxSpeed));
// this.rigidbody.applyLinearImpulseToCenter(this.rigidbody.linearVelocity.normalize().multiplyScalar(this.maxSpeed), true);
// }
director.on(Director.EVENT_AFTER_PHYSICS, this.setMaxVelocity, this);
}
private onBeginContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
@ -41,26 +53,39 @@ export class Ball extends Component {
// Hit goal
if (otherCollider.tag == 2) {
otherCollider.getComponent(Animation)?.play();
this.node.active = false;
GameplayController.Instance().AddScore(1);
// GameplayController.Instance().SpawnBallInTime(1);
SoundManager.Instance().PlayOneShot(SoundManager.Instance().goal);
this.eventGoal.emit("Goal");
this.eventGoal.emit('Goal');
return;
}
// Hit obstacle
if (otherCollider.tag == 3) {
this.eventHitObstacle.emit("HitObstacle", otherCollider.node);
this.eventHitObstacle.emit('HitObstacle', otherCollider.node);
return;
}
SoundManager.Instance().PlayOneShot(SoundManager.Instance().hitPlayer);
if (this.rigidbody.linearVelocity.length() >= 2) {
SoundManager.Instance().PlayOneShot(SoundManager.Instance().hitPlayer);
}
}
private setMaxVelocity() {
if (this.rigidbody.linearVelocity.length() > this.maxSpeed) {
this.rigidbody.linearVelocity = this.rigidbody.linearVelocity.normalize().multiplyScalar(this.maxSpeed);
}
}
private onEndContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// console.log(otherCollider.tag, otherCollider.node.name);
}
}
public resetTrail() {
this.trail.clear();
}
}

View File

@ -1,4 +1,4 @@
import { _decorator, bezier, Button, CCInteger, Component, EventTarget, Label, log, Node, EventTouch } from 'cc';
import { _decorator, Button, CCInteger, Component, EventTarget, Label, Node, EventTouch } from 'cc';
import { GameplayController } from './GameplayController';
import BEConnector from './BEConnector';
const { ccclass, property } = _decorator;
@ -7,7 +7,7 @@ export enum PanelState {
NotShowing,
CompareScore,
Continue,
ShowResult
ShowResult,
}
@ccclass('EndGameUIController')
export class EndGameUIController extends Component {
@ -65,10 +65,8 @@ export class EndGameUIController extends Component {
//#endregion
private Setup(): void {
if (this.isContinuable)
this.ChangeState(PanelState.CompareScore);
else
this.ChangeState(PanelState.ShowResult);
if (this.isContinuable) this.ChangeState(PanelState.CompareScore);
else this.ChangeState(PanelState.ShowResult);
}
private ChangeState(newState: PanelState): void {
@ -79,7 +77,7 @@ export class EndGameUIController extends Component {
case PanelState.CompareScore:
this.TurnOffAllPanels(this.compareScorePnl);
var totalScore = GameplayController.Instance().score + GameplayController.Instance().highestStreak * 2;
this.yourScoreTxt.string = "Your score: " + totalScore;
this.yourScoreTxt.string = 'Your score: ' + totalScore;
/// Todo: set top score here
break;
@ -88,10 +86,9 @@ export class EndGameUIController extends Component {
var ticket = BEConnector.instance.numberTicket;
if (ticket >= BEConnector.instance.getTicketCanBeMinus()) {
this.continueTxt.string = "To continue playing, you will be deducted " + ticket +
" Extras. Do you want to proceed?";
}
else {
this.continueTxt.string =
'To continue playing, you will be deducted ' + ticket + ' Extras. Do you want to proceed?';
} else {
this.continueTxt.string =
"You don't have enough Extras to continue playing. Would you like to buy more tickets?";
}
@ -110,39 +107,31 @@ export class EndGameUIController extends Component {
this.compareScorePnl.active = false;
this.continuePnl.active = false;
this.finalResultPnl.active = false;
if (activePnl != null)
activePnl.active = true;
if (activePnl != null) activePnl.active = true;
}
public YesNoClick(e: EventTouch, yesNoString: string): void {
var isYesClick = true;
if (yesNoString == "true")
isYesClick = true;
if (yesNoString == 'true') isYesClick = true;
else isYesClick = false;
switch (this.currentState) {
case PanelState.CompareScore:
if (isYesClick)
this.ChangeState(PanelState.Continue);
else
this.ChangeState(PanelState.ShowResult);
if (isYesClick) this.ChangeState(PanelState.Continue);
else this.ChangeState(PanelState.ShowResult);
break;
case PanelState.Continue:
if (isYesClick) {
var ticket = BEConnector.instance.getTicketCanBeMinus();
if (BEConnector.instance.numberTicket >= ticket) {
GameplayController.Instance().OnRevive();
BEConnector.instance.ticketMinus("revive");
BEConnector.instance.ticketMinus('revive');
this.isContinuable = false;
}
else
BEConnector.instance.postMessage();
}
else {
} else BEConnector.instance.postMessage();
} else {
this.ChangeState(PanelState.CompareScore);
}
break;
}
}
}
}

View File

@ -1,10 +1,10 @@
export enum EventType {
MainMenu = "MainMenu",
StartGame = "StartGame",
PlayGame = "Playgame",
UpdateScore = "SendScore",
UpdateStreak = "UpdateSteak",
UpdateHighestStreak = "UpdateHighestStreak",
UpdateBall = "UpdateBall",
EndGame = "EndGame"
}
MainMenu = 'MainMenu',
StartGame = 'StartGame',
PlayGame = 'Playgame',
UpdateScore = 'SendScore',
UpdateStreak = 'UpdateSteak',
UpdateHighestStreak = 'UpdateHighestStreak',
UpdateBall = 'UpdateBall',
EndGame = 'EndGame',
}

View File

@ -9,7 +9,7 @@ export class Flipper extends Component {
public _motorSpeedActive: number;
@property({ visible: true, type: CCFloat })
public _motorSpeedDeActive: number;
public ActiveFlipper(): void {
this._hingeJoint.motorSpeed = this._motorSpeedActive;
}
@ -17,5 +17,3 @@ export class Flipper extends Component {
this._hingeJoint.motorSpeed = this._motorSpeedDeActive;
}
}

View File

@ -1,4 +1,14 @@
import { _decorator, Component, EventKeyboard, EventMouse, EventTouch, Input, input, KeyCode, log, Node, view } from 'cc';
import {
_decorator,
Component,
EventKeyboard,
EventMouse,
EventTouch,
Input,
input,
KeyCode,
screen as Screen,
} from 'cc';
import { Flipper } from './Flipper';
const { ccclass, property } = _decorator;
@ -24,8 +34,7 @@ export class FlipperController extends Component {
}
//#region Handle mouse/touch input
private HandleFlipperActive(params: EventMouse): void {
if (params.getLocationX() > screen.width / 2)
this.rFlipper.ActiveFlipper();
if (params.getLocationX() > screen.width / 2) this.rFlipper.ActiveFlipper();
else this.lFlipper.ActiveFlipper();
}
private HandleFlipperDeActive(params: EventMouse): void {
@ -33,13 +42,11 @@ export class FlipperController extends Component {
this.lFlipper.DeActiveFlipper();
}
private HandleFlipperActiveTouch(params: EventTouch): void {
if (params.getLocationX() > view.getFrameSize().x) {
console.log("right");
if (params.getLocationX() > Screen.windowSize.x / 2) {
console.log('right');
this.rFlipper.ActiveFlipper();
}
else {
console.log("left");
} else {
console.log('left');
this.lFlipper.ActiveFlipper();
}
}
@ -51,9 +58,11 @@ export class FlipperController extends Component {
private OnKeyDown(event: EventKeyboard) {
switch (event.keyCode) {
case KeyCode.ARROW_LEFT:
case KeyCode.KEY_A:
this.lFlipper.ActiveFlipper();
break;
case KeyCode.ARROW_RIGHT:
case KeyCode.KEY_D:
this.rFlipper.ActiveFlipper();
break;
@ -61,14 +70,14 @@ export class FlipperController extends Component {
}
private OnKeyUp(event: EventKeyboard) {
switch (event.keyCode) {
case KeyCode.ARROW_LEFT:
case KeyCode.KEY_A:
this.lFlipper.DeActiveFlipper();
break;
case KeyCode.ARROW_RIGHT:
case KeyCode.KEY_D:
this.rFlipper.DeActiveFlipper();
break;
}
}
}

View File

@ -1,27 +1,43 @@
import { _decorator, CCInteger, Component, Enum, EventTarget, instantiate, Node, ParticleSystem2D, Prefab, randomRange, randomRangeInt, RigidBody2D, Vec2 } from 'cc';
import {
_decorator,
CCInteger,
Component,
Enum,
EventTarget,
instantiate,
Node,
ParticleSystem,
ParticleSystem2D,
Prefab,
randomRangeInt,
RigidBody2D,
Vec2,
} from 'cc';
import { Ball } from './Ball';
import { EventType } from './Enums';
import { SoundManager } from './SoundManager';
import BEConnector from './BEConnector';
import { UIController } from './UIController';
import { LevelController } from './LevelController';
import Utilities from './Utilities/Utilities';
const { ccclass, property } = _decorator;
window.addEventListener("message", (data) => {
const { data: res } = data
const objectRes = JSON.parse(res)
const { type, value } = objectRes
if (type === "newTicket") {
BEConnector.instance.numberTicket += value
GameplayController.Instance().OnRevive();
window.addEventListener('message', (data) => {
const { data: res } = data;
const objectRes = Utilities.getJson(res);
if (objectRes) {
const { type, value } = objectRes;
if (type === 'newTicket') {
BEConnector.instance.numberTicket += value;
GameplayController.Instance().OnRevive();
}
}
})
});
export enum GameState {
MainMenu,
StartGame,
PlayGame,
EndGame
EndGame,
}
@ccclass('GameplayController')
export class GameplayController extends Component {
@ -65,8 +81,8 @@ export class GameplayController extends Component {
@property({ type: Enum(GameState) })
public currentGameState: GameState = GameState.MainMenu;
@property(ParticleSystem2D)
public particle: ParticleSystem2D = null;
@property(ParticleSystem)
public particle: ParticleSystem = null;
@property(CCInteger)
public startGameCountDown: number = 3;
@ -88,7 +104,6 @@ export class GameplayController extends Component {
protected start(): void {
BEConnector.instance.authenticate();
this.ChangeGameState(GameState.MainMenu);
}
private SpawnBall(): void {
@ -101,17 +116,20 @@ export class GameplayController extends Component {
let randonPos = randomRangeInt(0, this.startPositions.length);
this.controllingBall.setPosition(this.startPositions[randonPos].x, this.startPositions[randonPos].y, 0);
this.controllingBall.active = true;
this.controllingBall.getComponent(Ball).eventHitObstacle.on("HitObstacle", this.ObstacleHitControl, this);
this.controllingBall.getComponent(Ball).eventGoal.on("Goal", this.GoalControl, this);
const ball = this.controllingBall.getComponent(Ball);
ball.eventHitObstacle.on('HitObstacle', this.ObstacleHitControl, this);
ball.getComponent(Ball).eventGoal.on('Goal', this.GoalControl, this);
return;
} else {
this.controllingBall.getComponent(RigidBody2D).linearVelocity = Vec2.ZERO;
const rigi = this.controllingBall.getComponent(RigidBody2D);
rigi.angularVelocity = 0;
rigi.linearVelocity = Vec2.ZERO.clone();
let randonPos = randomRangeInt(0, this.startPositions.length);
this.controllingBall.parent = this.node;
this.controllingBall.setPosition(this.startPositions[randonPos].x, this.startPositions[randonPos].y, 0);
this.controllingBall.active = true;
this.controllingBall.getComponent(Ball).resetTrail();
}
SoundManager.Instance().PlayOneShot(SoundManager.Instance().whistle);
}
@ -148,8 +166,7 @@ export class GameplayController extends Component {
SoundManager.Instance().PlayOneShot(SoundManager.Instance().sfxGoal);
if (this.ball <= 0)
this.ChangeGameState(GameState.EndGame);
if (this.ball <= 0) this.ChangeGameState(GameState.EndGame);
else this.SpawnBallInTime(1);
}
public LoseStreak(): void {
@ -157,10 +174,8 @@ export class GameplayController extends Component {
this.eventUpdateStreak.emit(EventType.UpdateStreak, this.streak);
this.ball--;
this.eventUpdateBall.emit(EventType.UpdateBall, this.ball);
if (this.ball <= 0)
this.ChangeGameState(GameState.EndGame);
if (this.ball <= 0) this.ChangeGameState(GameState.EndGame);
else this.SpawnBallInTime(1);
}
public ChangeGameState(newState: GameState): void {
if (this.currentGameState == newState) return;
@ -175,12 +190,11 @@ export class GameplayController extends Component {
break;
case GameState.StartGame:
this.eventStartGame.emit(EventType.StartGame);
this.SpawnBallInTime(this.startGameCountDown);
this.levelController.LevelUp();
BEConnector.instance.ticketMinus("auth");
BEConnector.instance.ticketMinus('auth');
break;
case GameState.PlayGame:
this.eventUpdateBall.emit(EventType.UpdateBall, this.ball);
@ -199,11 +213,9 @@ export class GameplayController extends Component {
}
//#endregion
private SetupObstacle(): void {
if (this.score < this.scoreToSpawnObstacle + 2)
return;
this.eventSpawnObstacle.emit("SpawnObstacle");
if (this.score < this.scoreToSpawnObstacle + 2) return;
this.eventSpawnObstacle.emit('SpawnObstacle');
// this.harderObstacle.active = true;
}
private ObstacleHitControl(node: Node): void {
@ -213,8 +225,10 @@ export class GameplayController extends Component {
}, 3);
}
private GoalControl(): void {
this.particle.node.setPosition(this.controllingBall.position);
this.particle.resetSystem();
const pos = this.controllingBall.position.clone();
pos.z = this.particle.node.position.z;
this.particle.node.setPosition(pos);
this.particle.play();
}
public OnRevive(): void {
@ -223,4 +237,4 @@ export class GameplayController extends Component {
this.eventUpdateBall.emit(EventType.UpdateBall, this.ball);
this.SpawnBallInTime(1);
}
}
}

View File

@ -18,7 +18,7 @@ export class LevelController extends Component {
private isLeveledUp: boolean = false;
protected start(): void {
this.maxLevel=5;
this.maxLevel = 5;
GameplayController.Instance().eventUpdateScore.on(EventType.UpdateScore, this.HandleLevelUp, this);
}
@ -30,11 +30,10 @@ export class LevelController extends Component {
}
}
if (this.currentLevel >= this.maxLevel) {
console.log("Current level is: " + this.currentLevel + " while max level is: " + this.maxLevel);
console.log('Current level is: ' + this.currentLevel + ' while max level is: ' + this.maxLevel);
}
this.scoreToLevelUp.forEach(scoreCheck => {
this.scoreToLevelUp.forEach((scoreCheck) => {
if (score == scoreCheck) return;
this.isLeveledUp = false;
});
@ -48,7 +47,7 @@ export class LevelController extends Component {
this.ObstacleControl();
GameplayController.Instance().uiController.currentLevelTxt.string = "Level: " + this.currentLevel;
GameplayController.Instance().uiController.currentLevelTxt.string = 'Level: ' + this.currentLevel;
}
public GetCurrentLevel(): number {
return this.currentLevel;
@ -57,24 +56,24 @@ export class LevelController extends Component {
private ObstacleControl(): void {
switch (this.currentLevel) {
case 1:
this.levelObstacles.forEach(obstacle => {
this.levelObstacles.forEach((obstacle) => {
obstacle.active = false;
});
break;
case 2:
this.levelObstacles.forEach(obstacle => {
this.levelObstacles.forEach((obstacle) => {
obstacle.active = false;
});
this.levelObstacles[0].active = true;
break;
case 3:
this.levelObstacles.forEach(obstacle => {
this.levelObstacles.forEach((obstacle) => {
obstacle.active = false;
});
this.levelObstacles[1].active = true;
break;
case 4:
this.levelObstacles.forEach(obstacle => {
this.levelObstacles.forEach((obstacle) => {
obstacle.active = false;
});
this.levelObstacles[2].active = true;
@ -87,10 +86,10 @@ export class LevelController extends Component {
private RandomSetObstacle(): void {
setTimeout(() => {
let random = randomRangeInt(0, this.levelObstacles.length);
this.levelObstacles.forEach(element => {
this.levelObstacles.forEach((element) => {
element.active = false;
});
this.levelObstacles[random].active = true;
}, 200);
}
}
}

View File

@ -1,4 +1,4 @@
import { _decorator, CCFloat, Component, log, Node, randomRange, Tween, tween, Vec2, Vec3 } from 'cc';
import { _decorator, CCFloat, Component, Node, tween } from 'cc';
const { ccclass, property, float } = _decorator;
@ccclass('ObstacleController')
@ -10,22 +10,21 @@ export class ObstacleController extends Component {
@property(CCFloat)
private speed: number = 0;
protected start() {
protected start() {
//if (this.target !== null)
this.target.setPosition(this.waypoints[this.waypoints.length - 1].position);
this.followPath();
}
private followPath() {
private followPath() {
const tweenPath = tween(this.target);
for (let i = 0; i < this.waypoints.length; i++) {
let a = tween(this.target).to(this.speed,{position: this.waypoints[i].getPosition()})
tweenPath.then(a)
let a = tween(this.target).to(this.speed, { position: this.waypoints[i].getPosition() });
tweenPath.then(a);
}
// tweenPath.union().repeat(10)
tweenPath.union().repeatForever()
tweenPath.union().repeatForever();
tweenPath.start();
}
}
}

View File

@ -15,7 +15,6 @@ export class SoundManager extends Component {
SoundManager.instance = this;
}
@property(AudioSource)
private audioSource: AudioSource;
@property(AudioClip)
@ -35,4 +34,3 @@ export class SoundManager extends Component {
this.audioSource.playOneShot(clip);
}
}

View File

@ -3,7 +3,6 @@ const { ccclass, property } = _decorator;
@ccclass('Test')
export class Test extends Component {
@property(Prefab)
private someThing: Prefab;
@ -19,12 +18,10 @@ export class Test extends Component {
this.someNode.parent = this.node;
this.someNode.setPosition(0, 0, 0);
}
else this.someNode.active = true;
} else this.someNode.active = true;
}
private DeActiveNode(): void {
this.someNode.active = false;
}
}

View File

@ -1,4 +1,4 @@
import { _decorator, Button, Component, director, Label, log, Node, view, View } from 'cc';
import { _decorator, Button, Component, director, Label, Node } from 'cc';
import { GameplayController, GameState } from './GameplayController';
import { EventType } from './Enums';
import { SoundManager } from './SoundManager';
@ -6,7 +6,6 @@ const { ccclass, property } = _decorator;
@ccclass('UIController')
export class UIController extends Component {
@property(Node)
private mainMenuPnl: Node;
@property(Button)
@ -56,7 +55,11 @@ export class UIController extends Component {
GameplayController.Instance().eventUpdateScore.on(EventType.UpdateScore, this.UpdateScore, this);
GameplayController.Instance().eventUpdateStreak.on(EventType.UpdateStreak, this.UpdateStreak, this);
GameplayController.Instance().eventUpdateHighestStreak.on(EventType.UpdateHighestStreak, this.UpdateHighestStreak, this);
GameplayController.Instance().eventUpdateHighestStreak.on(
EventType.UpdateHighestStreak,
this.UpdateHighestStreak,
this,
);
GameplayController.Instance().eventUpdateBall.on(EventType.UpdateBall, this.UpdateBall, this);
}
@ -87,29 +90,28 @@ export class UIController extends Component {
this.inGamePnl.active = true;
}
private UpdateScore(score: number): void {
console.log("Score: " + score);
console.log('Score: ' + score);
this.score = score;
this.goalTxt.string = "Goal: " + score.toString();
this.goalTxt.string = 'Goal: ' + score.toString();
}
private UpdateStreak(streak: number): void {
console.log("Streak: " + streak);
this.currentStreakTxt.string = "Streak: " + streak.toString();
console.log('Streak: ' + streak);
this.currentStreakTxt.string = 'Streak: ' + streak.toString();
}
private UpdateHighestStreak(streak: number): void {
console.log("Highest Streak: " + streak);
console.log('Highest Streak: ' + streak);
this.hStreak = streak;
this.highestStreakTxt.string = "Highest Streak: " + streak.toString();
this.highestStreakTxt.string = 'Highest Streak: ' + streak.toString();
}
private UpdateBall(ball: number): void {
console.log("Ball: " + ball);
this.ballTxt.string = "Ball: " + ball.toString();
console.log('Ball: ' + ball);
this.ballTxt.string = 'Ball: ' + ball.toString();
}
private EndGameEvent(): void {
this.inGamePnl.active = false;
this.endGamePnl.active = true;
if ((this.score + this.hStreak * 2) > 0)
this.yourScoreTxt.string = (this.score + this.hStreak * 2).toString();
else this.yourScoreTxt.string = "0";
if (this.score + this.hStreak * 2 > 0) this.yourScoreTxt.string = (this.score + this.hStreak * 2).toString();
else this.yourScoreTxt.string = '0';
}
public ShutEndPnl(): void {
this.endGamePnl.active = false;
@ -122,6 +124,6 @@ export class UIController extends Component {
SoundManager.Instance().PlayOneShot(SoundManager.Instance().menuTap);
}
private RestartClicked(): void {
director.loadScene(director.getScene().name)
director.loadScene(director.getScene().name);
}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "98007d4c-5f1f-4bf2-a5fa-ad07f4be4471",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,15 @@
import { Vec3 } from 'cc';
export default class Utilities {
public static delay(time: number): Promise<any> {
return new Promise((resolve) => setTimeout(resolve, time));
}
public static getJson(json: string): any {
try {
return JSON.parse(json);
} catch (error) {
return false;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "d70404b0-c2fe-4a29-9dcc-8cf6586ec85f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,5 +1,5 @@
{
"__version__": "3.0.7",
"__version__": "3.0.5",
"game": {
"name": "UNKNOW GAME",
"app_id": "UNKNOW",

View File

@ -0,0 +1,23 @@
{
"__version__": "1.0.0",
"information": {
"customSplash": {
"id": "customSplash",
"label": "customSplash",
"enable": false,
"customSplash": {
"complete": false,
"form": "https://creator-api.cocos.com/api/form/show?"
}
},
"removeSplash": {
"id": "removeSplash",
"label": "removeSplash",
"enable": false,
"removeSplash": {
"complete": false,
"form": "https://creator-api.cocos.com/api/form/show?"
}
}
}
}

View File

@ -2,15 +2,16 @@
"__version__": "1.0.4",
"general": {
"designResolution": {
"width": 1920,
"height": 1440,
"width": 1440,
"height": 1080,
"fitHeight": true
}
},
"physics": {
"gravity": {
"y": -9.81
}
},
"fixedTimeStep": 0.016667
},
"custom_joint_texture_layouts": []
}