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
994e312f
Commit
994e312f
authored
May 09, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update slot when break jar fragment
parent
ac5fbaf3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
BehindFragment.ts
assets/scripts/GamePlay/BehindFragment.ts
+3
-2
BreakingJarController.ts
assets/scripts/GamePlay/BreakingJarController.ts
+0
-1
FragmentJarController.ts
assets/scripts/GamePlay/FragmentJarController.ts
+10
-5
Global.ts
assets/scripts/Global.ts
+1
-1
No files found.
assets/scripts/GamePlay/BehindFragment.ts
View file @
994e312f
...
@@ -36,12 +36,13 @@ export default class BehindFragment extends cc.Component {
...
@@ -36,12 +36,13 @@ 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
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
by
(
Global
.
getRandomTime
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTime
Skew
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTime
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
.
by
(
Global
.
getRandomTime
Skew
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
)
)
.
start
();
.
start
();
...
...
assets/scripts/GamePlay/BreakingJarController.ts
View file @
994e312f
...
@@ -185,7 +185,6 @@ export default class BreakingJarController extends cc.Component {
...
@@ -185,7 +185,6 @@ export default class BreakingJarController extends cc.Component {
}
}
private
onTouchStart
(
event
:
cc
.
Event
.
EventTouch
)
{
private
onTouchStart
(
event
:
cc
.
Event
.
EventTouch
)
{
console
.
log
(
'onTouchStart'
,
1
)
eventTarget
.
emit
(
STOP_GUILD_TAP
);
eventTarget
.
emit
(
STOP_GUILD_TAP
);
const
pos
=
event
.
getLocation
();
const
pos
=
event
.
getLocation
();
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
...
...
assets/scripts/GamePlay/FragmentJarController.ts
View file @
994e312f
...
@@ -96,6 +96,9 @@ export default class FragmentJarController extends cc.Component {
...
@@ -96,6 +96,9 @@ export default class FragmentJarController extends cc.Component {
}
}
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
;
}
}
...
@@ -117,20 +120,22 @@ export default class FragmentJarController extends cc.Component {
...
@@ -117,20 +120,22 @@ export default class FragmentJarController extends cc.Component {
this
.
isDropped
=
true
;
this
.
isDropped
=
true
;
const
pos
=
this
.
node
.
position
;
const
pos
=
this
.
node
.
position
;
eventTarget
.
emit
(
CHECK_FRAGMENT
,
this
.
node
);
eventTarget
.
emit
(
CHECK_FRAGMENT
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
this
.
node
);
cc
.
tween
(
this
.
node
)
cc
.
tween
(
this
.
node
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
repeat
(
4
,
cc
.
tween
(
this
.
node
)
.
by
(
Global
.
getRandomTime
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTime
Skew
(),
{
position
:
cc
.
v3
(
-
5
,
-
5
)
})
.
by
(
Global
.
getRandomTime
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
.
by
(
Global
.
getRandomTime
Skew
(),
{
position
:
cc
.
v3
(
5
,
5
)
})
)
)
.
to
(
Global
.
getRandomTime
()
*
5
,
{
scale
:
1.1
})
.
call
(()
=>
{
.
call
(()
=>
{
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
(()
=>
{
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_rg
.
gravityScale
=
1
0
;
this
.
_rg
.
gravityScale
=
1
5
;
})
})
.
delay
(
1
)
.
delay
(
1
)
.
to
(
0
,
{
scale
:
1
})
.
to
(
0
,
{
scale
:
1
})
...
...
assets/scripts/Global.ts
View file @
994e312f
export
class
Global
{
export
class
Global
{
public
static
tool
:
number
=
0
;
public
static
tool
:
number
=
0
;
public
static
getRandomTime
()
{
public
static
getRandomTime
Skew
()
{
return
Math
.
random
()
*
0.05
+
0.03
;
return
Math
.
random
()
*
0.05
+
0.03
;
}
}
}
}
\ No newline at end of file
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