Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy05_pintu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
hy05_pintu
Commits
b35ff84d
Commit
b35ff84d
authored
Jul 10, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
90ea4c4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
layer_back_hy05_pintu.prefab
...hy05_pintu/common/layer_back/layer_back_hy05_pintu.prefab
+3
-3
layer_ending_hy05_pintu.ts
...hy05_pintu/common/layer_ending/layer_ending_hy05_pintu.ts
+10
-1
hy05_pintu.ts
assets/hy05_pintu/scene/hy05_pintu.ts
+10
-5
No files found.
assets/hy05_pintu/common/layer_back/layer_back_hy05_pintu.prefab
View file @
b35ff84d
...
...
@@ -444,7 +444,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 150.74,
"height":
63
"height":
50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -945,7 +945,7 @@
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode":
0
,
"_N$cacheMode":
2
,
"_id": ""
},
{
...
...
@@ -961,7 +961,7 @@
"_alignFlags": 9,
"_left": 274.52700000000004,
"_right": 0,
"_top":
67.3
9999999999998,
"_top":
73.8
9999999999998,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
...
...
assets/hy05_pintu/common/layer_ending/layer_ending_hy05_pintu.ts
View file @
b35ff84d
...
...
@@ -45,15 +45,24 @@ export default class LayerEnding extends cc.Component {
onTouchNext
()
{
pg
.
view
.
visible
(
this
.
layer_center
,
false
)
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
return
console
.
log
(
"
middleLayer
"
);
if
(
!
middleLayer
)
return
this
.
log
(
"
no
middleLayer
"
);
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
const
{
index
,
length
}
=
middleLayerComponent
.
getPageInfo
();
// 返回 length:有多少页; index: 当前第几页(从0开始)
this
.
log
(
"
跳转到下一页
"
);
if
(
index
==
length
-
1
)
{
middleLayerComponent
.
goNextCross
();
// 跳转到下一关卡
}
else
{
middleLayerComponent
.
goNextPage
();
// 跳转到下一页
}
}
log
(
str
)
{
const
node
=
cc
.
find
(
'
middleLayer
'
);
if
(
node
)
{
node
.
getComponent
(
'
middleLayer
'
).
log
(
str
);
}
else
{
cc
.
log
(
str
);
}
}
}
...
...
assets/hy05_pintu/scene/hy05_pintu.ts
View file @
b35ff84d
...
...
@@ -70,6 +70,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
GameJigsaw
.
getIns
().
reset
();
this
.
cardBgs
=
[];
this
.
coin
=
0
;
this
.
roundOver
=
false
;
}
initView
()
{
...
...
@@ -308,7 +309,6 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// rightBg0.active = true;
// rightBg1.active = true;
itemBg
.
isChecked
=
true
;
this
.
playLocalAudio
(
"
right
"
);
// setTimeout(() => {
// rightBg0.active = false;
// rightBg1.active = false;
...
...
@@ -323,9 +323,11 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// itemBg.getChildByName("layer_candy").active = false;
// }, 1000);
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
if
(
this
.
checkRoundEnd
())
{
this
.
checkGameOver
();
}
});
}
else
{
this
.
playLocalAudio
(
"
error
"
);
}
...
...
@@ -361,8 +363,10 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
if
(
this
.
currentCards
.
length
!=
this
.
cards
.
length
)
return
false
;
return
this
.
currentCards
.
every
(
card
=>
!!
card
);
}
private
roundOver
;
private
checkGameOver
()
{
if
(
this
.
roundOver
)
return
;
this
.
roundOver
=
true
;
let
audio
=
GameJigsaw
.
getIns
().
getCurrentPage
().
audio
;
let
over
=
GameJigsaw
.
getIns
().
addPage
();
pg
.
audio
.
playAudioByUrl
(
audio
).
then
(
async
()
=>
{
...
...
@@ -373,6 +377,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
pg
.
event
.
once
(
'
layer_right_show_excellent_end
'
,
()
=>
{
this
.
coin
+=
3
;
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
this
.
coin
)
//1 2 3硬币数量
this
.
roundOver
=
false
;
})
pg
.
event
.
emit
(
"
layer_right_show_excellent
"
);
}
...
...
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