Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
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
钱根
DuibaGameTemplate
Commits
29f6bbcc
Commit
29f6bbcc
authored
Mar 23, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
999fd2d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
ResJson.ts
src/ResJson.ts
+1
-1
IndexScene.ts
src/scenes/IndexScene.ts
+16
-6
No files found.
src/ResJson.ts
View file @
29f6bbcc
...
@@ -377,5 +377,5 @@ export const ResJson = {
...
@@ -377,5 +377,5 @@ export const ResJson = {
}
}
],
],
// eslint-disable-next-line
// eslint-disable-next-line
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/164
6963505
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/164
7225387
/resource/"
}
}
\ No newline at end of file
src/scenes/IndexScene.ts
View file @
29f6bbcc
...
@@ -49,6 +49,13 @@ class CountDownBoard extends FYGE.Container {
...
@@ -49,6 +49,13 @@ class CountDownBoard extends FYGE.Container {
// this._countDownText = UI.Txt(this, this._initCountDownNum + '', 30, '#fff', FYGE.TEXT_ALIGN.RIGHT, 200, 200, 30)
// this._countDownText = UI.Txt(this, this._initCountDownNum + '', 30, '#fff', FYGE.TEXT_ALIGN.RIGHT, 200, 200, 30)
}
}
/**
* 初始化 倒计时
*/
initCountDownNum
()
{
this
.
_countDownText
.
text
=
this
.
_initCountDownNum
+
''
}
public
restart
()
{
public
restart
()
{
this
.
stopCountDown
()
this
.
stopCountDown
()
this
.
countDown
=
this
.
_initCountDownNum
this
.
countDown
=
this
.
_initCountDownNum
...
@@ -501,6 +508,7 @@ export default class IndexScene extends Scene {
...
@@ -501,6 +508,7 @@ export default class IndexScene extends Scene {
this
.
musicStatus
=
Tools
.
PAGE
.
musicStatus
this
.
musicStatus
=
Tools
.
PAGE
.
musicStatus
this
.
recoverGameEles
()
this
.
recoverGameEles
()
this
.
onInitGamer
()
this
.
onInitGamer
()
this
.
CountDownCont
.
initCountDownNum
()
}
}
/**
/**
...
@@ -519,12 +527,14 @@ export default class IndexScene extends Scene {
...
@@ -519,12 +527,14 @@ export default class IndexScene extends Scene {
/**
/**
* 游戏结束
* 游戏结束
*/
*/
onGameOver
()
{
onGameOver
(
isDelay
:
boolean
=
false
)
{
this
.
GameStatus
=
0
this
.
GameStatus
=
0
this
.
CountDownCont
.
stopCountDown
()
this
.
CountDownCont
.
stopCountDown
()
GDispatcher
.
dispatchEvent
(
GameEvent
.
GAME_OVER
,
{
setTimeout
(()
=>
{
score
:
this
.
score
GDispatcher
.
dispatchEvent
(
GameEvent
.
GAME_OVER
,
{
})
score
:
this
.
score
})
},
isDelay
?
500
:
0
)
}
}
/**
/**
...
@@ -546,9 +556,9 @@ export default class IndexScene extends Scene {
...
@@ -546,9 +556,9 @@ export default class IndexScene extends Scene {
const
curr
=
this
.
currGameEleResource
const
curr
=
this
.
currGameEleResource
const
currResource
:
GameEleResource
=
curr
.
resource
const
currResource
:
GameEleResource
=
curr
.
resource
const
currGameELe
=
GPool
.
takeOut
<
GameEleSprit
>
(
currResource
)
||
this
.
addChild
(
new
GameEleSprit
(
currResource
,
curr
.
score
))
const
currGameELe
=
GPool
.
takeOut
<
GameEleSprit
>
(
currResource
)
||
this
.
addChild
(
new
GameEleSprit
(
currResource
,
curr
.
score
))
currGameELe
.
position
.
set
(
randomNum
(
this
.
axisX
[
0
],
this
.
axisX
[
1
]),
layers
.
stageOffsetY
-
100
)
currGameELe
.
visible
=
true
currGameELe
.
visible
=
true
this
.
gameElesList
.
push
(
currGameELe
)
this
.
gameElesList
.
push
(
currGameELe
)
currGameELe
.
position
.
set
(
randomNum
(
this
.
axisX
[
0
],
this
.
axisX
[
1
]),
layers
.
stageOffsetY
)
if
(
!
currGameELe
.
pythicCont
)
{
if
(
!
currGameELe
.
pythicCont
)
{
const
debug
=
false
const
debug
=
false
if
(
currResource
===
'bellSprit.png'
)
{
if
(
currResource
===
'bellSprit.png'
)
{
...
@@ -662,7 +672,7 @@ export default class IndexScene extends Scene {
...
@@ -662,7 +672,7 @@ export default class IndexScene extends Scene {
// console.log(item)
// console.log(item)
if
(
item
.
score
==
0
)
{
if
(
item
.
score
==
0
)
{
console
.
log
(
'boom'
,
item
)
console
.
log
(
'boom'
,
item
)
this
.
onGameOver
()
this
.
onGameOver
(
true
)
}
}
this
.
score
+=
item
.
score
this
.
score
+=
item
.
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