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
00772bb5
Commit
00772bb5
authored
Apr 02, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hammer
parent
8035a4db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
BreakingBottleController.ts
assets/scripts/GamePlay/BreakingBottleController.ts
+4
-8
FragmentController.ts
assets/scripts/GamePlay/FragmentController.ts
+1
-1
No files found.
assets/scripts/GamePlay/BreakingBottleController.ts
View file @
00772bb5
import
{
BEAT_GUILD
,
CHECK_FRAGMENT
,
CHECK_TOUCH
,
eventTarget
,
HAMMER
,
RESET_BOTTLE
,
RESET_FRAGMENT
,
SHOW_CARD_POPUP
,
STOP_GUILD_TAP
}
from
"../Events"
;
import
{
Global
}
from
"../Global"
;
import
FragmentController
from
"./FragmentController"
;
import
TheController
from
"./TheController"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -39,7 +38,6 @@ export default class BreakingBottleController extends cc.Component {
this
.
_fragmentsPosition
=
this
.
_fragmentsNode
.
map
(
item
=>
item
.
position
.
clone
());
}
private
beatGuild
()
{
this
.
onHammer
(
cc
.
v2
(
100
));
}
...
...
@@ -60,16 +58,13 @@ export default class BreakingBottleController extends cc.Component {
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
cc
.
Tween
.
stopAllByTarget
(
this
.
hammerNode
);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
this
.
hammerNode
.
active
=
true
;
cc
.
tween
(
this
.
hammerNode
)
.
to
(
0
,
{
active
:
false
})
.
to
(
0
,
{
active
:
true
})
.
to
(
0
,
{
position
:
cc
.
v3
(
newPos
.
x
,
newPos
.
y
,
0
),
active
:
false
})
.
to
(
0
,
{
active
:
true
})
.
to
(
0.5
,
{
position
:
cc
.
v3
(
newPos
.
x
,
newPos
.
y
,
0
)
})
.
delay
(
1
)
.
to
(
0.5
,
{
position
:
cc
.
v3
(
300
)
}
)
.
call
(()
=>
this
.
hammerNode
.
active
=
false
)
.
start
();
}
...
...
@@ -95,6 +90,7 @@ export default class BreakingBottleController extends cc.Component {
private
resetHammer
()
{
this
.
hammerNode
.
position
=
cc
.
v3
(
300
);
this
.
hammerNode
.
active
=
false
;
}
...
...
assets/scripts/GamePlay/FragmentController.ts
View file @
00772bb5
...
...
@@ -54,7 +54,7 @@ export default class FragmentController extends cc.Component {
.
call
(()
=>
{
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_rg
.
gravityScale
=
5
;
this
.
_rg
.
gravityScale
=
10
;
})
.
delay
(
1
)
.
to
(
0
,
{
scale
:
1
})
...
...
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