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
d61f5759
Commit
d61f5759
authored
May 27, 2023
by
Friends233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check
parent
8564a493
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
27 deletions
+29
-27
GameConfig.ts
assets/Script/Config/GameConfig.ts
+2
-0
GameScene.ts
assets/Script/GameScene.ts
+20
-20
blockManager.ts
assets/Script/blockManager.ts
+1
-1
index.js
build/web-mobile/assets/main/index.js
+1
-1
index.html
build/web-mobile/index.html
+3
-3
main.js
build/web-mobile/main.js
+2
-2
No files found.
assets/Script/Config/GameConfig.ts
View file @
d61f5759
...
...
@@ -38,6 +38,8 @@ export const Config = {
blockAniDelay
:
35
,
/** 方块拖拽判定放置的最大距离 */
blockMaxOffset
:
58
,
/** 拿起方块与手指直接的间隔 */
blockManagerDragOffsetY
:
0
,
/** 下方小方块间隔 */
miniBlockOffset
:
2
,
/** 小方块大小 */
...
...
assets/Script/GameScene.ts
View file @
d61f5759
...
...
@@ -80,15 +80,15 @@ export default class GameScene extends cc.Component {
cc
.
find
(
'guideWrp'
,
this
.
node
).
active
=
true
const
blocks
=
[
0
,
10
,
20
,
30
,
40
,
50
,
60
,
70
,
80
,
95
,
96
,
97
,
98
,
99
]
this
.
setDefaultBlock
(
blocks
)
this
.
allBlcokManagerNode
.
forEach
((
node
,
i
)
=>
{
this
.
allBlcokManagerNode
.
forEach
((
node
,
i
)
=>
{
const
blockManager
=
node
.
getComponent
(
'blockManager'
)
if
(
i
==
0
)
{
if
(
i
==
0
)
{
blockManager
.
refreshMiniBlock
(
false
,
Config
.
guideBlockMatrix
)
}
else
{
}
else
{
blockManager
.
setNodeState
(
1
)
}
})
}
...
...
@@ -125,7 +125,7 @@ export default class GameScene extends cc.Component {
init
:
'testInit'
,
clear
:
'setDefaultBlock'
,
radom
:
'testRadom'
,
submit
:
'gameOver'
submit
:
'gameOver'
}
testNode
.
children
.
forEach
((
n
)
=>
{
const
event
=
this
?.[
testEventMap
[
n
.
name
]]
...
...
@@ -216,31 +216,31 @@ export default class GameScene extends cc.Component {
if
(
this
.
setBlockNum
>=
3
)
{
this
.
refreshStageProps
()
}
this
.
scheduleOnce
(()
=>
{
this
.
isCheckGameOver
()
},
0.8
)
this
.
isCheckGameOver
()
if
(
this
.
isGuide
)
{
this
.
setBlockNum
--
this
.
isGuide
=
false
cc
.
find
(
'guideWrp/guide1'
,
this
.
node
).
active
=
false
cc
.
find
(
'guideWrp/guide2'
,
this
.
node
).
opacity
=
255
cc
.
find
(
'guideWrp/guide1'
,
this
.
node
).
active
=
false
cc
.
find
(
'guideWrp/guide2'
,
this
.
node
).
opacity
=
255
const
blockManager
=
this
.
allBlcokManagerNode
[
0
].
getComponent
(
'blockManager'
)
blockManager
.
refreshMiniBlock
(
true
)
exportEvent
.
fire
(
CUSTOM_EVENT
.
GUIDE_OVER
)
}
else
{
cc
.
find
(
'guideWrp'
,
this
.
node
).
active
=
false
}
else
{
cc
.
find
(
'guideWrp'
,
this
.
node
).
active
=
false
}
}
/** 检查游戏是否结束 */
isCheckGameOver
()
{
const
blockStates
=
this
.
allBlcokManagerNode
.
filter
((
node
)
=>
{
const
blockManager
=
node
.
getComponent
(
'blockManager'
)
return
!
(
blockManager
.
isDisabled
||
blockManager
.
miniBlockKey
.
length
===
0
)
})
if
(
blockStates
.
length
===
0
)
{
this
.
gameOver
()
}
this
.
scheduleOnce
(()
=>
{
const
blockStates
=
this
.
allBlcokManagerNode
.
filter
((
node
)
=>
{
const
blockManager
=
node
.
getComponent
(
'blockManager'
)
return
!
(
blockManager
.
isDisabled
||
blockManager
.
miniBlockKey
.
length
===
0
)
})
if
(
blockStates
.
length
===
0
)
{
this
.
gameOver
()
}
},
0.8
)
}
/** 检查矩阵能否放入 */
...
...
assets/Script/blockManager.ts
View file @
d61f5759
...
...
@@ -335,7 +335,7 @@ export default class BlockManager extends cc.Component {
if
(
this
.
isMove
)
{
const
pos
:
cc
.
Vec2
=
e
.
getPreviousLocation
()
const
viewW
=
this
.
viewWidth
,
viewH
=
this
.
viewHeight
this
.
node
.
setPosition
(
pos
.
x
-
(
viewW
/
2
),
pos
.
y
-
(
812
-
(
1624
-
viewH
)
/
2
))
this
.
node
.
setPosition
(
pos
.
x
-
(
viewW
/
2
),
pos
.
y
-
(
812
-
(
1624
-
viewH
)
/
2
)
+
Config
.
blockManagerDragOffsetY
)
}
},
this
)
}
...
...
build/web-mobile/assets/main/index.js
View file @
d61f5759
This diff is collapsed.
Click to expand it.
build/web-mobile/index.html
View file @
d61f5759
...
...
@@ -40,7 +40,7 @@
<!-- <script src="//yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js" crossorigin="anonymous"></script>-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
69446409
/style-mobile.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
70557277
/style-mobile.css"
/>
<style>
...
...
@@ -90,9 +90,9 @@
</div>
</div>
<script
src=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
69446409
/src/settings.js"
charset=
"utf-8"
></script>
<script
src=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
70557277
/src/settings.js"
charset=
"utf-8"
></script>
<script
src=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
69446409
/main.js"
charset=
"utf-8"
></script>
<script
src=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
70557277
/main.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
>
(
function
()
{
...
...
build/web-mobile/main.js
View file @
d61f5759
window
.
__remoteUrl__
=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
69446409
/"
;
window
.
__remoteUrl__
=
"https://yun.duiba.com.cn/db_games/ccc_game/template/16851
70557277
/"
;
window
.
__remoteAssets__
=
window
.
__remoteUrl__
+
"assets/"
;
window
.
__version__
=
16851
69446409
;
window
.
__version__
=
16851
70557277
;
window
.
__ENV__
=
"prod"
;
window
.
boot
=
function
()
{
...
...
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