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
6e6b468c
Commit
6e6b468c
authored
Mar 31, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update main logic, hide hammer when show card
parent
22254b11
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
274 deletions
+161
-274
main.fire
assets/main.fire
+139
-260
BuaController.ts
assets/scripts/GamePlay/BuaController.ts
+8
-4
HuController.ts
assets/scripts/GamePlay/HuController.ts
+5
-7
ActionScreen.ts
assets/scripts/UI/ActionScreen.ts
+7
-2
CardPopup.ts
assets/scripts/UI/CardPopup.ts
+2
-1
No files found.
assets/main.fire
View file @
6e6b468c
This diff is collapsed.
Click to expand it.
assets/scripts/GamePlay/BuaController.ts
View file @
6e6b468c
...
...
@@ -27,7 +27,8 @@ export default class BuaController extends cc.Component {
}
public
onSetTool
()
{
this
.
spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
])
this
.
spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
this
.
node
.
position
=
cc
.
v3
(
0
,
0
,
0
);
}
private
onTouchStart
():
void
{
...
...
@@ -62,9 +63,12 @@ export default class BuaController extends cc.Component {
this
.
playSound
();
this
.
_chumCtrl
.
playAnimationNut4
();
this
.
scheduleOnce
(()
=>
{
eventTarget
.
emit
(
SHOW_CARD_POPUP
);
},
0.5
)
cc
.
tween
(
this
.
node
)
.
by
(
0.5
,
{
position
:
cc
.
v3
(
300
,)
})
.
call
(()
=>
{
eventTarget
.
emit
(
SHOW_CARD_POPUP
);
})
.
start
();
}
private
playSound
()
{
...
...
assets/scripts/GamePlay/HuController.ts
View file @
6e6b468c
...
...
@@ -28,20 +28,18 @@ export default class HuController extends cc.Component {
}
protected
start
():
void
{
this
.
scheduleOnce
(()
=>
this
.
testDevice
,
1
);
console
.
log
(
'testDevice'
,)
this
.
scheduleOnce
(()
=>
this
.
testDevice
,
3
);
}
private
testDevice
()
{
this
.
text
.
string
=
'testDevice'
;
console
.
log
(
'testDevice'
,)
window
.
addEventListener
(
"devicemotion"
,
(
event
)
=>
{
if
(
!
event
.
accelerationIncludingGravity
)
{
return
;
}
this
.
text
.
string
=
`
x:
${
event
.
accelerationIncludingGravity
.
x
}
,
y:
${
event
.
accelerationIncludingGravity
.
y
}
,
z:
${
event
.
accelerationIncludingGravity
.
z
}
`
;
this
.
text
.
string
=
`lac`
;
const
x
=
event
.
accelerationIncludingGravity
.
x
;
const
y
=
event
.
accelerationIncludingGravity
.
y
;
const
z
=
event
.
accelerationIncludingGravity
.
z
;
...
...
assets/scripts/UI/ActionScreen.ts
View file @
6e6b468c
import
{
eventTarget
,
SHOW_ACTION_SCREEN
,
SHOW_CARD_POPUP
}
from
"../Events"
;
import
{
eventTarget
,
SHOW_ACTION_SCREEN
,
SHOW_CARD_POPUP
,
SHOW_START_SCREEN
}
from
"../Events"
;
import
BuaController
from
"../GamePlay/BuaController"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -11,7 +11,8 @@ export default class ActionScreen extends cc.Component {
onLoad
()
{
this
.
node
.
position
=
cc
.
v3
();
this
.
node
.
active
=
false
;
eventTarget
.
on
(
SHOW_ACTION_SCREEN
,
this
.
showScreen
,
this
);
eventTarget
.
on
(
SHOW_ACTION_SCREEN
,
this
.
showScreen
,
this
);
eventTarget
.
on
(
SHOW_START_SCREEN
,
this
.
hideScreen
,
this
);
this
.
_buaController
=
this
.
getComponentInChildren
(
BuaController
);
}
...
...
@@ -20,4 +21,8 @@ export default class ActionScreen extends cc.Component {
this
.
_buaController
.
onSetTool
();
}
private
hideScreen
()
{
this
.
node
.
active
=
false
;
}
}
assets/scripts/UI/CardPopup.ts
View file @
6e6b468c
import
{
eventTarget
,
SHOW_CARD_POPUP
,
STOP_ANIM_CHUM
}
from
"../Events"
;
import
{
eventTarget
,
SHOW_CARD_POPUP
,
S
HOW_START_SCREEN
,
S
TOP_ANIM_CHUM
}
from
"../Events"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -25,6 +25,7 @@ export default class CardPopup extends cc.Component {
private
onReplayBtnClick
()
{
this
.
node
.
active
=
false
;
eventTarget
.
emit
(
SHOW_START_SCREEN
);
eventTarget
.
emit
(
STOP_ANIM_CHUM
);
}
}
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