Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interactiveGames_Level
Project
Project
Details
Activity
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
xuxing@jiuaoedu.com
interactiveGames_Level
Commits
0cb38e09
Commit
0cb38e09
authored
Feb 11, 2022
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间到了强行关闭游戏,解决提交问题
parent
cac515e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
16 deletions
+49
-16
VHFillNum_1.scene
assets/sceneBundle/games/VHFillNum/scene/VHFillNum_1.scene
+1
-1
VHFillNumCtr.ts
assets/sceneBundle/games/VHFillNum/script/VHFillNumCtr.ts
+25
-8
RingSumCtr.ts
assets/sceneBundle/games/ringSum/script/RingSumCtr.ts
+23
-7
No files found.
assets/sceneBundle/games/VHFillNum/scene/VHFillNum_1.scene
View file @
0cb38e09
...
@@ -1981,7 +1981,7 @@
...
@@ -1981,7 +1981,7 @@
"__id__": 78
"__id__": 78
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 83
"__id__": 83
...
...
assets/sceneBundle/games/VHFillNum/script/VHFillNumCtr.ts
View file @
0cb38e09
...
@@ -75,7 +75,7 @@ export class VHFillNumCtr extends Component {
...
@@ -75,7 +75,7 @@ export class VHFillNumCtr extends Component {
}
}
onCloseGameDescView
()
{
onCloseGameDescView
()
{
this
.
gameState
=
GAME_STATE
.
RUN
;
//
this.gameState = GAME_STATE.RUN;
}
}
setGameData
(
resData
:
object
)
{
setGameData
(
resData
:
object
)
{
...
@@ -104,13 +104,14 @@ export class VHFillNumCtr extends Component {
...
@@ -104,13 +104,14 @@ export class VHFillNumCtr extends Component {
director
.
on
(
"VHFM_click"
,
this
.
onItemClick
,
this
);
director
.
on
(
"VHFM_click"
,
this
.
onItemClick
,
this
);
director
.
on
(
"begin_countdown_end"
,
()
=>
{
director
.
on
(
"begin_countdown_end"
,
()
=>
{
//引导
//引导
if
(
!
this
.
isShowGameDescViewOnce
)
{
// if (!this.isShowGameDescViewOnce) {
this
.
gameState
=
GAME_STATE
.
PAUSE
;
// this.gameState = GAME_STATE.PAUSE;
this
.
showGameDescView
();
// this.showGameDescView();
}
// }
else
{
// else {
this
.
gameState
=
GAME_STATE
.
RUN
;
// this.gameState = GAME_STATE.RUN;
}
// }
this
.
gameState
=
GAME_STATE
.
RUN
;
},
this
);
},
this
);
director
.
on
(
"game_desc_close"
,
this
.
onCloseGameDescView
,
this
);
director
.
on
(
"game_desc_close"
,
this
.
onCloseGameDescView
,
this
);
this
.
gameStart
();
this
.
gameStart
();
...
@@ -125,6 +126,22 @@ export class VHFillNumCtr extends Component {
...
@@ -125,6 +126,22 @@ export class VHFillNumCtr extends Component {
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
return
;
return
;
}
}
// 在视频中运行则到时间直接关闭
if
(
Utils
.
getValueFromHref
(
"gameEndTime"
))
{
let
gameEndTime
=
Number
(
Utils
.
getValueFromHref
(
"gameEndTime"
));
if
(
!
this
.
isPlayCountdownMus
&&
(
gameEndTime
-
new
Date
().
getTime
())
/
1000
<
3.5
+
3
)
{
this
.
isPlayCountdownMus
=
true
;
AudioMgr
.
playEffect
(
countdownMus
);
}
if
((
gameEndTime
-
new
Date
().
getTime
())
/
1000
<=
0
+
3
)
{
console
.
log
(
`游戏时间到`
);
this
.
gameEnd
(
false
);
return
;
}
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
gameEndTime
-
new
Date
().
getTime
());
return
;
}
//
this
.
costTime
+=
dt
;
this
.
costTime
+=
dt
;
if
(
!
this
.
isPlayCountdownMus
&&
this
.
totalTime
-
this
.
costTime
<
3.5
)
{
if
(
!
this
.
isPlayCountdownMus
&&
this
.
totalTime
-
this
.
costTime
<
3.5
)
{
this
.
isPlayCountdownMus
=
true
;
this
.
isPlayCountdownMus
=
true
;
...
...
assets/sceneBundle/games/ringSum/script/RingSumCtr.ts
View file @
0cb38e09
...
@@ -76,7 +76,7 @@ export class RingSumCtr extends Component {
...
@@ -76,7 +76,7 @@ export class RingSumCtr extends Component {
//@ts-ignore
//@ts-ignore
this
.
isShowGameDescViewOnce
=
false
;
this
.
isShowGameDescViewOnce
=
false
;
}
}
else
{
else
{
this
.
isShowGameDescViewOnce
=
true
;
this
.
isShowGameDescViewOnce
=
true
;
}
}
}
}
...
@@ -191,12 +191,12 @@ export class RingSumCtr extends Component {
...
@@ -191,12 +191,12 @@ export class RingSumCtr extends Component {
this
.
curRSItem
=
null
!
;
this
.
curRSItem
=
null
!
;
this
.
orgItemData
=
""
;
this
.
orgItemData
=
""
;
//看看是不是有相同数字
//看看是不是有相同数字
if
(
!
this
.
circle
.
checkRepeat
())
{
if
(
!
this
.
circle
.
checkRepeat
())
{
if
(
this
.
checkWin
())
{
if
(
this
.
checkWin
())
{
console
.
log
(
`赢了`
);
console
.
log
(
`赢了`
);
this
.
gameEnd
(
true
);
this
.
gameEnd
(
true
);
}
}
else
{
else
{
console
.
log
(
`还没赢`
);
console
.
log
(
`还没赢`
);
}
}
}
}
...
@@ -228,11 +228,27 @@ export class RingSumCtr extends Component {
...
@@ -228,11 +228,27 @@ export class RingSumCtr extends Component {
}
}
}
}
//倒计时
//倒计时
countdownTime
(
dt
:
number
)
{
countdownTime
(
dt
:
number
)
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
return
;
return
;
}
}
// 在视频中运行则到时间直接关闭
if
(
Utils
.
getValueFromHref
(
"gameEndTime"
))
{
let
gameEndTime
=
Number
(
Utils
.
getValueFromHref
(
"gameEndTime"
));
if
(
!
this
.
isPlayCountdownMus
&&
(
gameEndTime
-
new
Date
().
getTime
())
/
1000
<
3.5
+
3
)
{
this
.
isPlayCountdownMus
=
true
;
AudioMgr
.
playEffect
(
countdownMus
);
}
if
((
gameEndTime
-
new
Date
().
getTime
())
/
1000
<=
0
+
3
)
{
console
.
log
(
`游戏时间到`
);
this
.
gameEnd
(
false
);
return
;
}
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
gameEndTime
-
new
Date
().
getTime
());
return
;
}
//
this
.
costTime
+=
dt
;
this
.
costTime
+=
dt
;
if
(
!
this
.
isPlayCountdownMus
&&
this
.
totalTime
-
this
.
costTime
<
3.5
)
{
if
(
!
this
.
isPlayCountdownMus
&&
this
.
totalTime
-
this
.
costTime
<
3.5
)
{
this
.
isPlayCountdownMus
=
true
;
this
.
isPlayCountdownMus
=
true
;
...
@@ -246,7 +262,7 @@ export class RingSumCtr extends Component {
...
@@ -246,7 +262,7 @@ export class RingSumCtr extends Component {
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
Math
.
floor
((
this
.
totalTime
-
this
.
costTime
)
*
1000
));
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
Math
.
floor
((
this
.
totalTime
-
this
.
costTime
)
*
1000
));
}
}
update
(
deltaTime
:
number
)
{
update
(
deltaTime
:
number
)
{
// [4]
// [4]
this
.
countdownTime
(
deltaTime
);
this
.
countdownTime
(
deltaTime
);
}
}
...
...
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