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
a28c58d7
Commit
a28c58d7
authored
May 07, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update hamer no spine
parent
ca188e38
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
170 deletions
+79
-170
main.fire
assets/main.fire
+32
-42
sprite2.png
assets/resources/sprite2.png
+0
-0
sprite2.png.meta
assets/resources/sprite2.png.meta
+38
-0
BehindFragment.ts
assets/scripts/GamePlay/BehindFragment.ts
+0
-1
BreakingJarController.ts
assets/scripts/GamePlay/BreakingJarController.ts
+9
-8
BuaController.ts
assets/scripts/GamePlay/BuaController.ts
+0
-105
BuaController.ts.meta
assets/scripts/GamePlay/BuaController.ts.meta
+0
-10
ActionScreen.ts
assets/scripts/UI/ActionScreen.ts
+0
-4
No files found.
assets/main.fire
View file @
a28c58d7
...
...
@@ -8129,7 +8129,7 @@
"__id__": 180
}
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [],
"_prefab": null,
"_opacity": 255,
...
...
@@ -8142,8 +8142,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
4
00,
"height":
6
00
"width":
3
00,
"height":
4
00
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -8181,7 +8181,7 @@
},
{
"__type__": "cc.Node",
"_name": "
Bua
",
"_name": "
sprite2
",
"_objFlags": 0,
"_parent": {
"__id__": 179
...
...
@@ -8204,27 +8204,27 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 4
62.01
,
"height": 5
40.78
"width": 4
47
,
"height": 5
29
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x":
0.5
,
"y": 0
.5
"x":
1
,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
20
0
,
-1
50
,
20
3.733
,
-1
22.061
,
0,
0,
0,
0,
1,
1
,
1
,
0.7
,
0.7
,
1
]
},
...
...
@@ -8239,10 +8239,10 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "
55waGUsdFLKoZUlgvQto8N
"
"_id": "
e9wF5M37dP9IOn6qKpCrRV
"
},
{
"__type__": "
sp.Skeleton
",
"__type__": "
cc.Sprite
",
"_name": "",
"_objFlags": 0,
"node": {
...
...
@@ -8251,37 +8251,27 @@
"_enabled": true,
"_materials": [
{
"__uuid__": "
7afd064b-113f-480e-b793-8817d19f63c3
"
"__uuid__": "
eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432
"
}
],
"paused": false,
"defaultSkin": "Bua",
"defaultAnimation": "Idle",
"_preCacheMode": 0,
"_cacheMode": 0,
"loop": false,
"premultipliedAlpha": true,
"timeScale": 1,
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_skeletonCache": null,
"_animationName": "Idle",
"_animationQueue": [],
"_headAniInfo": null,
"_playTimes": 1,
"_isAniComplete": true,
"_N$skeletonData": {
"__uuid__": "a5d5b5a3-7ac9-4207-a35a-9fd1ce088b83"
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b860551f-9495-4e82-9762-f612f7edc8af"
},
"_N$_defaultCacheMode": 0,
"_N$debugSlots": false,
"_N$debugBones": false,
"_N$debugMesh": false,
"_N$useTint": false,
"_N$enableBatch": false,
"_id": "1aE3N4xspBUqI/yFdTvs1G"
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "cf2CMGcCpFL4r6z9Ih3qOw"
},
{
"__type__": "cc.Node",
...
...
assets/resources/sprite2.png
0 → 100644
View file @
a28c58d7
102 KB
assets/resources/sprite2.png.meta
0 → 100644
View file @
a28c58d7
{
"ver": "2.3.7",
"uuid": "044ac248-1050-4422-b27a-2f434c532718",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 447,
"height": 529,
"platformSettings": {},
"subMetas": {
"sprite2": {
"ver": "1.0.6",
"uuid": "b860551f-9495-4e82-9762-f612f7edc8af",
"importer": "sprite-frame",
"rawTextureUuid": "044ac248-1050-4422-b27a-2f434c532718",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 447,
"height": 529,
"rawWidth": 447,
"rawHeight": 529,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/scripts/GamePlay/BehindFragment.ts
View file @
a28c58d7
...
...
@@ -23,7 +23,6 @@ export default class BehindFragment extends cc.Component {
if
(
this
.
_isDropped
)
{
return
;
}
console
.
log
(
'shakeFragment'
,
1
)
cc
.
tween
(
this
.
node
)
.
repeat
(
2
,
cc
.
tween
(
this
.
node
)
...
...
assets/scripts/GamePlay/BreakingJarController.ts
View file @
a28c58d7
...
...
@@ -20,8 +20,6 @@ export default class BreakingJarController extends cc.Component {
@
property
(
cc
.
Node
)
private
mask
:
cc
.
Node
=
null
;
private
_spine
:
sp
.
Skeleton
=
null
;
private
_skins
=
[
"Ga"
,
"Gai_lung"
,
"Gay"
,
"Bua"
,];
private
_countFragment
=
0
;
private
_fragmentsPosition
:
cc
.
Vec3
[]
=
[];
...
...
@@ -30,6 +28,7 @@ export default class BreakingJarController extends cc.Component {
private
_isEnd
=
false
;
private
_behindJarChild
:
BehindFragment
[]
=
[];
private
_behindJarChildPosition
:
cc
.
Vec3
[]
=
[];
private
_hamerAvatar
:
cc
.
Sprite
=
null
;
onLoad
()
{
...
...
@@ -38,8 +37,6 @@ export default class BreakingJarController extends cc.Component {
// cc.PhysicsManager.DrawBits.e_jointBit |
// cc.PhysicsManager.DrawBits.e_shapeBit;
this
.
_spine
=
this
.
hammerNode
.
getComponentInChildren
(
sp
.
Skeleton
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
...
...
@@ -53,6 +50,7 @@ export default class BreakingJarController extends cc.Component {
this
.
_fragmentsPosition
=
this
.
_fontFragments
.
map
(
item
=>
item
.
position
.
clone
());
this
.
_behindJarChild
=
this
.
behindJar
.
children
.
map
(
item
=>
item
.
getComponent
(
BehindFragment
));
this
.
_behindJarChildPosition
=
this
.
behindJar
.
children
.
map
(
item
=>
item
.
position
.
clone
());
this
.
_hamerAvatar
=
this
.
hammerNode
.
getComponentInChildren
(
cc
.
Sprite
);
this
.
initFog
();
}
...
...
@@ -131,7 +129,7 @@ export default class BreakingJarController extends cc.Component {
}
private
beatGuild
()
{
// this.onHammer(cc.v2(10
0));
this
.
onHammer
(
cc
.
v2
(
-
50
,
-
5
0
));
}
protected
start
():
void
{
...
...
@@ -141,7 +139,6 @@ export default class BreakingJarController extends cc.Component {
private
resetBottle
()
{
this
.
_countFragment
=
0
;
this
.
_bodyFragments
=
[];
this
.
_spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
this
.
_fontFragments
.
forEach
((
node
,
index
)
=>
{
node
.
position
=
this
.
_fragmentsPosition
[
index
];
...
...
@@ -160,7 +157,6 @@ export default class BreakingJarController extends cc.Component {
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
this
.
hammerNode
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
this
.
hammerNode
);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
cc
.
tween
(
this
.
hammerNode
)
.
to
(
0.5
,
{
position
:
cc
.
v3
(
newPos
.
x
,
newPos
.
y
,
0
)
})
...
...
@@ -169,6 +165,12 @@ export default class BreakingJarController extends cc.Component {
.
to
(
0.2
,
{
position
:
cc
.
v3
(
400
,
-
400
)
})
.
call
(()
=>
this
.
hammerNode
.
active
=
false
)
.
start
();
cc
.
tween
(
this
.
_hamerAvatar
.
node
)
.
delay
(
0.2
)
.
to
(
0.2
,
{
angle
:
-
90
})
.
to
(
0.05
,
{
angle
:
0
})
.
start
();
}
private
shakeNode
()
{
...
...
@@ -186,7 +188,6 @@ export default class BreakingJarController extends cc.Component {
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
eventTarget
.
emit
(
CHECK_TOUCH
,
nodePos
);
this
.
_spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
}
private
onTouchEnd
(
event
:
cc
.
Event
.
EventTouch
)
{
...
...
assets/scripts/GamePlay/BuaController.ts
deleted
100644 → 0
View file @
ca188e38
import
{
BEAT_GUILD
,
eventTarget
,
PLAY_ANIM_NUT1
,
PLAY_ANIM_NUT2
,
PLAY_ANIM_NUT3
,
PLAY_ANIM_NUT4
,
PLAY_BREAKING_SOUND
,
PLAY_DROP_SOUND
,
SHOW_CARD_POPUP
,
STOP_GUILD_TAP
}
from
"../Events"
;
import
{
Global
}
from
"../Global"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
BuaController
extends
cc
.
Component
{
private
spine
:
sp
.
Skeleton
=
null
;
private
_count
=
0
;
private
_actions
:
Function
[]
=
[];
private
_skins
=
[
"Ga"
,
"Gai_lung"
,
"Gay"
,
"Bua"
,];
private
_isPlay
=
false
;
protected
onLoad
():
void
{
this
.
spine
=
this
.
node
.
getComponentInChildren
(
sp
.
Skeleton
);
this
.
spine
.
setSkin
(
'Bua'
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
this
.
_actions
=
[
this
.
playAnimationDap1
,
this
.
playAnimationDap2
,
this
.
playAnimationDap3
,
this
.
playAnimationDap4
];
eventTarget
.
on
(
BEAT_GUILD
,
this
.
beatGuild
,
this
);
}
private
beatGuild
()
{
this
.
spine
.
setAnimation
(
0
,
"Dap2"
,
false
);
this
.
spine
.
timeScale
=
1.3
;
}
public
onSetTool
()
{
this
.
spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
this
.
node
.
position
=
cc
.
v3
(
0
,
0
,
0
);
this
.
_isPlay
=
true
;
}
private
onTouchEnd
():
void
{
if
(
this
.
_count
+
Global
.
tool
>
3
)
{
this
.
_count
=
0
;
}
}
private
onTouchStart
():
void
{
eventTarget
.
emit
(
STOP_GUILD_TAP
);
if
(
!
this
.
_isPlay
)
{
return
;
}
this
.
_actions
[
Global
.
tool
+
this
.
_count
].
bind
(
this
)();
this
.
_count
++
;
if
(
Global
.
tool
+
this
.
_count
>
3
)
{
this
.
_isPlay
=
false
;
}
}
private
playAnimationDap1
():
void
{
this
.
spine
.
setAnimation
(
0
,
"Dap1"
,
false
);
this
.
spine
.
timeScale
=
1
;
this
.
playSound
();
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
PLAY_ANIM_NUT1
);
},
0.5
)
}
private
playAnimationDap2
():
void
{
this
.
spine
.
setAnimation
(
0
,
"Dap2"
,
false
);
this
.
spine
.
timeScale
=
1.2
;
this
.
playSound
();
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
PLAY_ANIM_NUT2
);
},
0.4
)
}
private
playAnimationDap3
():
void
{
this
.
spine
.
setAnimation
(
0
,
"Dap3"
,
false
);
this
.
spine
.
timeScale
=
1.4
;
this
.
playSound
();
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
PLAY_ANIM_NUT3
);
},
0.3
)
}
private
playAnimationDap4
():
void
{
this
.
spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
this
.
spine
.
timeScale
=
1.6
;
this
.
playSound
();
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
PLAY_ANIM_NUT4
);
eventTarget
.
emit
(
PLAY_BREAKING_SOUND
);
},
0.2
)
cc
.
tween
(
this
.
node
)
.
delay
(
0.2
)
.
by
(
0.5
,
{
position
:
cc
.
v3
(
0
,
-
1500
)
})
.
delay
(
0.5
)
.
call
(()
=>
{
eventTarget
.
emit
(
SHOW_CARD_POPUP
);
})
.
start
();
}
private
playSound
()
{
eventTarget
.
emit
(
PLAY_DROP_SOUND
);
}
}
assets/scripts/GamePlay/BuaController.ts.meta
deleted
100644 → 0
View file @
ca188e38
{
"ver": "1.1.0",
"uuid": "fa954246-a361-4f4c-84bf-a3471c3f7902",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/scripts/UI/ActionScreen.ts
View file @
a28c58d7
import
{
eventTarget
,
PLAY_ANIM_NUT1
,
PLAY_ANIM_NUT2
,
PLAY_ANIM_NUT3
,
PLAY_ANIM_NUT4
,
SHOW_ACTION_SCREEN
,
SHOW_START_SCREEN
}
from
"../Events"
;
import
BuaController
from
"../GamePlay/BuaController"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -10,7 +9,6 @@ export default class ActionScreen extends cc.Component {
@
property
(
cc
.
Node
)
private
bottleAction
:
cc
.
Node
=
null
;
private
_buaController
:
BuaController
=
null
;
private
_spine
:
sp
.
Skeleton
=
null
;
onLoad
()
{
...
...
@@ -20,7 +18,6 @@ export default class ActionScreen extends cc.Component {
eventTarget
.
on
(
PLAY_ANIM_NUT2
,
this
.
hideBottle
,
this
);
eventTarget
.
on
(
PLAY_ANIM_NUT3
,
this
.
hideBottle
,
this
);
eventTarget
.
on
(
PLAY_ANIM_NUT4
,
this
.
hideBottle
,
this
);
this
.
_buaController
=
this
.
getComponentInChildren
(
BuaController
);
this
.
_spine
=
this
.
bottleIdle
.
getComponent
(
sp
.
Skeleton
);
}
...
...
@@ -35,7 +32,6 @@ export default class ActionScreen extends cc.Component {
this
.
_spine
.
setAnimation
(
0
,
'Idle'
,
true
);
this
.
node
.
active
=
true
;
this
.
_buaController
.
onSetTool
();
this
.
node
.
position
=
cc
.
v3
();
}
...
...
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