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
07960215
Commit
07960215
authored
May 10, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix slot jar when emit, fix slot drop, update debound hammer
parent
878d9177
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
10 deletions
+23
-10
BottleBreakingScreen.prefab
assets/Prefabs/BottleBreakingScreen.prefab
+1
-3
BehindFragment.ts
assets/scripts/GamePlay/BehindFragment.ts
+0
-1
BreakingJarController.ts
assets/scripts/GamePlay/BreakingJarController.ts
+7
-0
FragmentJarController.ts
assets/scripts/GamePlay/FragmentJarController.ts
+10
-6
SlotJar.ts
assets/scripts/GamePlay/SlotJar.ts
+5
-0
No files found.
assets/Prefabs/BottleBreakingScreen.prefab
View file @
07960215
...
@@ -12495,9 +12495,7 @@
...
@@ -12495,9 +12495,7 @@
},
},
"_enabled": true,
"_enabled": true,
"slotJarIndex": [
"slotJarIndex": [
1,
1
2,
4
],
],
"_id": ""
"_id": ""
},
},
...
...
assets/scripts/GamePlay/BehindFragment.ts
View file @
07960215
...
@@ -36,7 +36,6 @@ export default class BehindFragment extends cc.Component {
...
@@ -36,7 +36,6 @@ export default class BehindFragment extends cc.Component {
public
onDrop
()
{
public
onDrop
()
{
console
.
log
(
'onDrop'
,)
this
.
_isDropped
=
true
;
this
.
_isDropped
=
true
;
cc
.
tween
(
this
.
node
)
cc
.
tween
(
this
.
node
)
...
...
assets/scripts/GamePlay/BreakingJarController.ts
View file @
07960215
...
@@ -26,6 +26,7 @@ export default class BreakingJarController extends cc.Component {
...
@@ -26,6 +26,7 @@ export default class BreakingJarController extends cc.Component {
private
_behindJarChild
:
BehindFragment
[]
=
[];
private
_behindJarChild
:
BehindFragment
[]
=
[];
private
_behindJarChildPosition
:
cc
.
Vec3
[]
=
[];
private
_behindJarChildPosition
:
cc
.
Vec3
[]
=
[];
private
_hamerAvatar
:
cc
.
Sprite
=
null
;
private
_hamerAvatar
:
cc
.
Sprite
=
null
;
private
_isBreak
=
true
;
onLoad
()
{
onLoad
()
{
cc
.
director
.
getPhysicsManager
().
enabled
=
true
;
cc
.
director
.
getPhysicsManager
().
enabled
=
true
;
...
@@ -176,7 +177,13 @@ export default class BreakingJarController extends cc.Component {
...
@@ -176,7 +177,13 @@ export default class BreakingJarController extends cc.Component {
const
pos
=
event
.
getLocation
();
const
pos
=
event
.
getLocation
();
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
if
(
!
this
.
_isBreak
)
{
return
;
}
eventTarget
.
emit
(
CHECK_TOUCH
,
nodePos
);
eventTarget
.
emit
(
CHECK_TOUCH
,
nodePos
);
this
.
_isBreak
=
false
;
this
.
scheduleOnce
(()
=>
this
.
_isBreak
=
true
,
0.5
);
}
}
private
onTouchEnd
(
event
:
cc
.
Event
.
EventTouch
)
{
private
onTouchEnd
(
event
:
cc
.
Event
.
EventTouch
)
{
...
...
assets/scripts/GamePlay/FragmentJarController.ts
View file @
07960215
...
@@ -71,15 +71,16 @@ export default class FragmentJarController extends cc.Component {
...
@@ -71,15 +71,16 @@ export default class FragmentJarController extends cc.Component {
eventTarget
.
emit
(
HAMMER
,
point
);
eventTarget
.
emit
(
HAMMER
,
point
);
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
SHOW_SLOT_JAR
,
this
.
slotJarIndex
,
3
-
this
.
_numberOfBeats
);
eventTarget
.
emit
(
SHOW_SLOT_JAR
,
this
.
slotJarIndex
,
3
-
this
.
_numberOfBeats
);
this
.
node
.
scale
=
1
-
0.02
*
(
3
-
this
.
_numberOfBeats
);
},
0.5
);
if
(
this
.
_numberOfBeats
==
1
)
{
if
(
this
.
_numberOfBeats
==
1
)
{
eventTarget
.
emit
(
SHOW_FOG
,
this
.
node
.
position
);
eventTarget
.
emit
(
SHOW_FOG
,
this
.
node
.
position
);
}
}
if
(
this
.
_numberOfBeats
>
0
)
{
if
(
this
.
_numberOfBeats
>
0
)
{
cc
.
tween
(
this
.
node
)
.
to
(
0.1
,
{
scale
:
1
-
0.02
*
(
3
-
this
.
_numberOfBeats
)
})
.
start
();
return
;
return
;
}
}
...
@@ -107,6 +108,7 @@ export default class FragmentJarController extends cc.Component {
...
@@ -107,6 +108,7 @@ export default class FragmentJarController extends cc.Component {
cc
.
Tween
.
stopAllByTarget
(
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
this
.
node
);
cc
.
tween
(
this
.
node
)
cc
.
tween
(
this
.
node
)
.
delay
(
0.5
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
by
(
Global
.
getRandomTimeSkew
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTimeSkew
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTimeSkew
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
.
by
(
Global
.
getRandomTimeSkew
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
...
@@ -115,13 +117,15 @@ export default class FragmentJarController extends cc.Component {
...
@@ -115,13 +117,15 @@ export default class FragmentJarController extends cc.Component {
eventTarget
.
emit
(
PLAY_DROP_SOUND
);
eventTarget
.
emit
(
PLAY_DROP_SOUND
);
this
.
node
.
setSiblingIndex
(
-
1
);
this
.
node
.
setSiblingIndex
(
-
1
);
})
})
.
to
(
Global
.
getRandomTimeSkew
()
*
5
,
{
position
:
cc
.
v3
(
pos
.
x
,
pos
.
y
-
Global
.
getRandomTimeSkew
()
*
50
)
})
.
call
(()
=>
{
.
call
(()
=>
{
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_physicsCollider
.
enabled
=
false
;
this
.
_rg
.
gravityScale
=
15
;
this
.
_rg
.
gravityScale
=
15
;
})
})
.
delay
(
1
)
.
delay
(
0.4
)
.
call
(()
=>
this
.
_physicsCollider
.
enabled
=
true
)
.
delay
(
0.6
)
.
to
(
0
,
{
scale
:
1
})
.
to
(
0
,
{
scale
:
1
})
.
start
();
.
start
();
}
}
...
...
assets/scripts/GamePlay/SlotJar.ts
View file @
07960215
...
@@ -19,6 +19,10 @@ export default class SlotJar extends cc.Component {
...
@@ -19,6 +19,10 @@ export default class SlotJar extends cc.Component {
private
showSlotByIndex
(
indexs
:
number
[],
breakCount
:
number
):
void
{
private
showSlotByIndex
(
indexs
:
number
[],
breakCount
:
number
):
void
{
indexs
.
forEach
(
index
=>
{
indexs
.
forEach
(
index
=>
{
if
(
this
.
_slotShowder
[
index
]
>
1
){
return
;
}
this
.
_slotShowder
[
index
]
=
breakCount
;
this
.
_slotBreak1thNodes
[
index
].
active
=
true
;
this
.
_slotBreak1thNodes
[
index
].
active
=
true
;
this
.
_slotBreak2thNodes
[
index
].
active
=
breakCount
>=
2
;
this
.
_slotBreak2thNodes
[
index
].
active
=
breakCount
>=
2
;
})
})
...
@@ -32,5 +36,6 @@ export default class SlotJar extends cc.Component {
...
@@ -32,5 +36,6 @@ export default class SlotJar extends cc.Component {
private
resetSlots
():
void
{
private
resetSlots
():
void
{
this
.
_slotBreak1thNodes
.
forEach
(
node
=>
node
.
active
=
false
);
this
.
_slotBreak1thNodes
.
forEach
(
node
=>
node
.
active
=
false
);
this
.
_slotBreak2thNodes
.
map
(
node
=>
node
.
active
=
false
);
this
.
_slotBreak2thNodes
.
map
(
node
=>
node
.
active
=
false
);
this
.
_slotShowder
=
{};
}
}
}
}
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