Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Cocos-1010
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
等吃饭
Cocos-1010
Commits
0e112860
Commit
0e112860
authored
May 25, 2023
by
Friends233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事件处理
parent
9074f559
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
147 additions
and
239 deletions
+147
-239
Game.fire
assets/Scenes/Game.fire
+139
-236
GameScene.ts
assets/Script/GameScene.ts
+8
-3
No files found.
assets/Scenes/Game.fire
View file @
0e112860
This diff is collapsed.
Click to expand it.
assets/Script/GameScene.ts
View file @
0e112860
...
...
@@ -36,9 +36,9 @@ export default class GameScene extends cc.Component {
this
.
blockMatrix
=
cc
.
find
(
'blockMatrix'
,
this
.
node
)
const
{
maxRow
,
maxCol
}
=
this
.
gameConfig
const
testBlock
=
[]
for
(
let
i
=
0
;
i
<
maxCol
-
2
;
i
++
)
{
testBlock
.
push
(...
Array
(
6
).
fill
(
''
).
map
((
_
,
j
)
=>
j
+
1
+
(
i
+
1
)
*
maxRow
))
}
//
for (let i = 0; i < maxCol - 2; i++) {
//
testBlock.push(...Array(6).fill('').map((_, j) => j + 1 + (i + 1) * maxRow))
//
}
this
.
setDefaultBlock
(
testBlock
)
this
.
addNodeEvent
()
}
...
...
@@ -145,8 +145,11 @@ export default class GameScene extends cc.Component {
...
Config
,
...
con
}
this
.
score
=
0
this
.
setBlockNum
=
0
this
.
setLable
(
'score'
,
0
)
this
.
setLable
(
'bestScore'
,
'历史最高分:'
+
(
con
.
bestScore
||
0
))
this
.
setLable
(
'goldCoin'
,
(
con
.
goldCoin
||
0
)
+
''
)
this
.
setDefaultBlock
()
}
...
...
@@ -154,7 +157,9 @@ export default class GameScene extends cc.Component {
/** 游戏结束 */
gameOver
()
{
this
.
isGameOver
=
true
console
.
log
(
'gameOver'
)
exportEvent
.
fire
(
CUSTOM_EVENT
.
GAME_OVER
,
{
score
:
this
.
score
})
}
...
...
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