Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dap-hu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Gia Vương
dap-hu
Commits
7468ecbc
Commit
7468ecbc
authored
Apr 28, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hammer , collider fragment
parent
99f7e199
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
137 deletions
+177
-137
main.fire
assets/main.fire
+176
-136
BreakingBottleController.ts
assets/scripts/GamePlay/BreakingBottleController.ts
+1
-0
FragmentJarController.ts
assets/scripts/GamePlay/FragmentJarController.ts
+0
-1
No files found.
assets/main.fire
View file @
7468ecbc
...
@@ -2967,12 +2967,12 @@
...
@@ -2967,12 +2967,12 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -12.
3
,
"x": -12.
2
,
"y": -73
.5
"y": -73
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 7
8
,
"x": 7
7.6
,
"y": -73.6
"y": -73.6
},
},
{
{
...
@@ -2982,43 +2982,43 @@
...
@@ -2982,43 +2982,43 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 15
5.
1,
"x": 15
4.6
1,
"y": 55.
6
"y": 55.
99
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 168.
2
,
"x": 168.
01
,
"y": 75.
7
"y": 75.
8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 158.
9
,
"x": 158.
71
,
"y": 112.
8
"y": 112.
61
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 81.
9
,
"x": 81.
8
,
"y": 144.
8
"y": 144.
51
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 60.
7
,
"x": 60.
89
,
"y": 124.4
"y": 124.4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 51.
5
,
"x": 51.
69
,
"y": 87.
9
"y": 87.
8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -5.
5
,
"x": -5.
31
,
"y": 43.
9
"y": 43.
71
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -50.
4
,
"x": -50.
98
,
"y": 5
6.2
"y": 5
5.71
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3032,8 +3032,13 @@
...
@@ -3032,8 +3032,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -170.4,
"x": -168.9,
"y": -49
"y": -49.8
},
{
"__type__": "cc.Vec2",
"x": -98.1,
"y": -86.1
}
}
],
],
"_id": "79mvxrrW1O0oNGfg5khgek"
"_id": "79mvxrrW1O0oNGfg5khgek"
...
@@ -3132,13 +3137,13 @@
...
@@ -3132,13 +3137,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 11
9.1
,
"x": 11
8.2
,
"y":
5.7
"y":
6.4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 1
43
,
"x": 1
37.6
,
"y":
60
.2
"y":
51
.2
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3152,8 +3157,8 @@
...
@@ -3152,8 +3157,8 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -1
46.8
,
"x": -1
38.3
,
"y": -9
0.5
"y": -9
2.4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3530,8 +3535,8 @@
...
@@ -3530,8 +3535,8 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 41.
2
,
"x": 41.
4
,
"y": -97
.2
"y": -97
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3540,8 +3545,8 @@
...
@@ -3540,8 +3545,8 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 172.
6
,
"x": 172.
2
,
"y": -6
7.6
"y": -6
6.3
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3560,13 +3565,13 @@
...
@@ -3560,13 +3565,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -148.
6
,
"x": -148.
5
,
"y": 7
8.4
"y": 7
7.7
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -17
3
,
"x": -17
2.6
,
"y": 54.
2
"y": 54.
4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4026,17 +4031,17 @@
...
@@ -4026,17 +4031,17 @@
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -32.8,
"x": -32.8,
"y": -5
3.6
"y": -5
2.8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 55.1,
"x": 55.1,
"y": -74
.7
"y": -74
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 93.
1
,
"x": 93.
2
,
"y": -12
2
.5
"y": -12
1
.5
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4045,43 +4050,53 @@
...
@@ -4045,43 +4050,53 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 8
7.3
,
"x": 8
6.5
,
"y": -3
8.7
"y": -3
9.8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
34
.2,
"x":
66
.2,
"y":
43
"y":
-11.9
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
-8.5
,
"x":
33.9
,
"y":
51.5
"y":
42.54
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
37.3
,
"x": -
9.1
,
"y":
105.6
"y":
50.7
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
110.2
,
"x": -
37.7
,
"y": 1
27
.8
"y": 1
04
.8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -139.3,
"x": -110.3,
"y": 126.8
},
{
"__type__": "cc.Vec2",
"x": -138.78,
"y": 26.5
"y": 26.5
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -113.
8
,
"x": -113.
52
,
"y": -32.
8
"y": -32.
94
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -117.4,
"x": -117.26,
"y": -37.5
"y": -36.73
},
{
"__type__": "cc.Vec2",
"x": -100,
"y": -51.1
}
}
],
],
"_id": "dfUZAuiFRHaaZifPZotCuG"
"_id": "dfUZAuiFRHaaZifPZotCuG"
...
@@ -4166,22 +4181,22 @@
...
@@ -4166,22 +4181,22 @@
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -67.1,
"x": -67.1,
"y": -
6.3
"y": -
5.5
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -2
5.4
,
"x": -2
4.8
,
"y": -1
5.2
"y": -1
4.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 2
7.9
,
"x": 2
8.4
,
"y": -96.
9
"y": -96.
3
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 79.5,
"x": 79.5,
"y": -10
9.1
"y": -10
8.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4195,27 +4210,27 @@
...
@@ -4195,27 +4210,27 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 44.
6
,
"x": 44.
3
,
"y": 10
7
"y": 10
6.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 21.
6
,
"x": 21.
3
,
"y": 75.
6
"y": 75.
3
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -89.
2
,
"x": -89.
3
,
"y": 75.
8
"y": 75.
4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -121.9,
"x": -121.9,
"y": 110.
7
"y": 110.
4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -110
.4
,
"x": -110,
"y": 73.8
"y": 73.8
}
}
],
],
...
@@ -4665,8 +4680,8 @@
...
@@ -4665,8 +4680,8 @@
"points": [
"points": [
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -9
8.9
,
"x": -9
9.5
,
"y": -7
8.5
"y": -7
9.2
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4675,13 +4690,13 @@
...
@@ -4675,13 +4690,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 31.
7
,
"x": 31.
21
,
"y": -12
3.5
"y": -12
2.84
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 3
5.8
,
"x": 3
4.81
,
"y": -119.
6
"y": -119.
02
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4695,13 +4710,13 @@
...
@@ -4695,13 +4710,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 1
10.7
,
"x": 1
08.9
,
"y": 19.
4
"y": 19.
7
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 96.
8
,
"x": 96.
2
,
"y": 47.
9
"y": 47.
8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4710,13 +4725,13 @@
...
@@ -4710,13 +4725,13 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 58
.2
,
"x": 58,
"y": 11
3.1
"y": 11
2.4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -2.4,
"x": -2.4,
"y": 11
1.5
"y": 11
0.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4725,18 +4740,23 @@
...
@@ -4725,18 +4740,23 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -20.5,
"x": -20.2,
"y": 109.2
"y": 109
},
{
"__type__": "cc.Vec2",
"x": -110.48,
"y": 45.56
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
110.6
,
"x": -
98.4
,
"y":
45.8
"y":
-12.5
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
90.7
,
"x": -
89.9
,
"y": -73.
9
"y": -73.
6
}
}
],
],
"_id": "e8fb+xiEBPApeeB08wcyGC"
"_id": "e8fb+xiEBPApeeB08wcyGC"
...
@@ -4820,38 +4840,48 @@
...
@@ -4820,38 +4840,48 @@
"points": [
"points": [
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -8
2.
9,
"x": -8
3.5
9,
"y": -6
8.7
"y": -6
6.72
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
21.1
,
"x":
-58.3
,
"y": -5
6.4
"y": -5
9.8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 122.8,
"x": 19.8,
"y": -0.9
"y": -56
},
{
"__type__": "cc.Vec2",
"x": 122.5,
"y": -0.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 115.3,
"x": 115.3,
"y": 5
2.1
"y": 5
1.95
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 2
7
,
"x": 2
6.84
,
"y": 52.
7
"y": 52.
45
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
-0.1
,
"x":
0.06
,
"y":
3.4
"y":
2.41
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -131.8,
"x": -61.6,
"y": 75.4
"y": 39.2
},
{
"__type__": "cc.Vec2",
"x": -130.73,
"y": 75.11
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -5218,23 +5248,28 @@
...
@@ -5218,23 +5248,28 @@
"points": [
"points": [
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -58.
1
,
"x": -58.
5
,
"y": -8
8.7
"y": -8
7.9
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
19.8
,
"x": -
20.2
,
"y": -5
7.1
"y": -5
6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
60.2
,
"x":
59.4
,
"y": -5
5.3
"y": -5
4.7
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 73.6,
"x": 73,
"y": -15.6
"y": -15
},
{
"__type__": "cc.Vec2",
"x": 141.2,
"y": 6.3
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -5243,38 +5278,38 @@
...
@@ -5243,38 +5278,38 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 16
6.3
,
"x": 16
5.2
,
"y":
30
"y":
29.4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 10
5
,
"x": 10
3.4
,
"y": 83
.8
"y": 83
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 16.3,
"x": 16.3,
"y": 8
9.7
"y": 8
8.6
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -74.
7
,
"x": -74.
5
,
"y": 39
.6
"y": 39
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -155.
1
,
"x": -155.
3
,
"y": 35.
9
"y": 35.
4
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -18
7
,
"x": -18
6.9
,
"y": 26.
9
"y": 26.
2
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -12
1.1
,
"x": -12
3
,
"y": -7
5.7
"y": -7
1.2
}
}
],
],
"_id": "94iB2JXGBJC5Ydofx4LAfT"
"_id": "94iB2JXGBJC5Ydofx4LAfT"
...
@@ -5451,43 +5486,48 @@
...
@@ -5451,43 +5486,48 @@
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 2
10.1
,
"x": 2
08.3
,
"y": -1.
3
"y": -1.
8
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 1
70.2
,
"x": 1
69.4
,
"y": 47.
5
"y": 47.
2
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 8
3.3
,
"x": 8
2.5
,
"y": 68
.5
"y": 68
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
-8
,
"x":
27.2
,
"y": 4
5.4
"y": 4
7.3
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -
77
,
"x": -
4.8
,
"y":
23.4
"y":
44.9
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -89.4,
"x": -76.2,
"y": -15.6
"y": 22.9
},
{
"__type__": "cc.Vec2",
"x": -88.9,
"y": -16.1
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -170.
6
,
"x": -170.
1
,
"y": -17.
2
"y": -17.
5
},
},
{
{
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": -20
9.5
,
"x": -20
7.9
,
"y": -50.
7
"y": -50.
4
}
}
],
],
"_id": "deRBw/8d9KT5+8KuKjJlaa"
"_id": "deRBw/8d9KT5+8KuKjJlaa"
...
...
assets/scripts/GamePlay/BreakingBottleController.ts
View file @
7468ecbc
...
@@ -21,6 +21,7 @@ export default class BreakingBottleController extends cc.Component {
...
@@ -21,6 +21,7 @@ export default class BreakingBottleController extends cc.Component {
onLoad
()
{
onLoad
()
{
return
;
cc
.
director
.
getPhysicsManager
().
enabled
=
true
;
cc
.
director
.
getPhysicsManager
().
enabled
=
true
;
// cc.director.getPhysicsManager().debugDrawFlags = cc.PhysicsManager.DrawBits.e_aabbBit |
// cc.director.getPhysicsManager().debugDrawFlags = cc.PhysicsManager.DrawBits.e_aabbBit |
// cc.PhysicsManager.DrawBits.e_jointBit |
// cc.PhysicsManager.DrawBits.e_jointBit |
...
...
assets/scripts/GamePlay/FragmentJarController.ts
View file @
7468ecbc
...
@@ -54,7 +54,6 @@ export default class FragmentJarController extends cc.Component {
...
@@ -54,7 +54,6 @@ export default class FragmentJarController extends cc.Component {
if
(
this
.
_physicsColliderFragmentLink
)
{
if
(
this
.
_physicsColliderFragmentLink
)
{
const
posFragmentLink
=
point
.
clone
().
subtract
(
cc
.
v2
(
this
.
fragmentLink
.
position
.
x
,
this
.
fragmentLink
.
position
.
y
));
const
posFragmentLink
=
point
.
clone
().
subtract
(
cc
.
v2
(
this
.
fragmentLink
.
position
.
x
,
this
.
fragmentLink
.
position
.
y
));
isInsideFragmentLink
=
cc
.
Intersection
.
pointInPolygon
(
posFragmentLink
,
this
.
_physicsColliderFragmentLink
.
points
);
isInsideFragmentLink
=
cc
.
Intersection
.
pointInPolygon
(
posFragmentLink
,
this
.
_physicsColliderFragmentLink
.
points
);
console
.
log
(
'isInside'
,
isInside
,
isInsideFragmentLink
,
this
.
node
.
name
,
this
.
_physicsColliderFragmentLink
.
points
.
length
)
}
}
if
(
!
isInside
&&
!
isInsideFragmentLink
)
{
if
(
!
isInside
&&
!
isInsideFragmentLink
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment