Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_Pronunciation
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
Sbx_Pronunciation
Commits
26536659
Commit
26536659
authored
Dec 08, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
1bf0a326
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
54 deletions
+46
-54
GameLogic.js
play/assets/tmpGame/script/GameLogic.js
+34
-2
Scene.js
play/assets/tmpGame/script/Scene.js
+5
-4
defaultData.js
play/assets/tmpGame/script/defaultData.js
+7
-48
No files found.
play/assets/tmpGame/script/GameLogic.js
View file @
26536659
...
@@ -42,7 +42,18 @@ export default class GameLogic {
...
@@ -42,7 +42,18 @@ export default class GameLogic {
this
.
addEventListener
();
this
.
addEventListener
();
this
.
initBottomButtons
();
this
.
initBottomButtons
();
this
.
initDragonContainers
();
this
.
initDragonContainers
();
this
.
loadQuestion
(
true
)
if
(
!
this
.
loadQuestion
(
true
))
{
const
btnRestart
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_restart
"
);
if
(
this
.
m_currentQuestion
<=
-
1
)
{
btnRestart
.
node
.
opacity
=
128
;
btnRestart
.
disable
=
true
;
console
.
log
(
"
Disable restart
"
)
}
else
{
btnRestart
.
node
.
opacity
=
255
;
btnRestart
.
disable
=
false
;
}
}
this
.
enableClick
(
"
Sysyem_init_done
"
)
this
.
enableClick
(
"
Sysyem_init_done
"
)
}
}
...
@@ -71,7 +82,11 @@ export default class GameLogic {
...
@@ -71,7 +82,11 @@ export default class GameLogic {
}
}
addEventListener
()
{
addEventListener
()
{
const
btnRestart
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_restart
"
);
this
.
g_cartoon
.
subscribeTouchEvent
(
"
bgMain
"
,
()
=>
{
this
.
g_cartoon
.
subscribeTouchEvent
(
"
bgMain
"
,
()
=>
{
if
(
btnRestart
.
disable
)
{
return
}
this
.
playCurrentQuestion
()
this
.
playCurrentQuestion
()
})
})
}
}
...
@@ -305,6 +320,7 @@ export default class GameLogic {
...
@@ -305,6 +320,7 @@ export default class GameLogic {
this
.
m_currentQuestion
--
;
this
.
m_currentQuestion
--
;
}
}
this
.
checkButtonDisable
();
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
)
{
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
)
{
this
.
m_currentQuestion
=
this
.
g_formData
.
dataArray
.
length
-
1
this
.
m_currentQuestion
=
this
.
g_formData
.
dataArray
.
length
-
1
return
false
;
return
false
;
...
@@ -330,7 +346,6 @@ export default class GameLogic {
...
@@ -330,7 +346,6 @@ export default class GameLogic {
this
.
playCurrentQuestion
()
this
.
playCurrentQuestion
()
}
}
this
.
checkButtonDisable
();
return
true
;
return
true
;
}
}
...
@@ -370,6 +385,9 @@ export default class GameLogic {
...
@@ -370,6 +385,9 @@ export default class GameLogic {
})
})
this
.
g_cartoon
.
subscribeTouchEvent
(
btnRestart
.
key
,
()
=>
{
this
.
g_cartoon
.
subscribeTouchEvent
(
btnRestart
.
key
,
()
=>
{
if
(
btnRestart
.
disable
)
{
return
}
jelly
(
btnRestart
.
node
)
jelly
(
btnRestart
.
node
)
this
.
g_cartoon
.
playAudio
(
"
sm_btn
"
);
this
.
g_cartoon
.
playAudio
(
"
sm_btn
"
);
this
.
playCurrentQuestion
()
this
.
playCurrentQuestion
()
...
@@ -379,10 +397,23 @@ export default class GameLogic {
...
@@ -379,10 +397,23 @@ export default class GameLogic {
checkButtonDisable
()
{
checkButtonDisable
()
{
const
btnLeft
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_left
"
);
const
btnLeft
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_left
"
);
const
btnRight
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_right
"
);
const
btnRight
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_right
"
);
const
btnRestart
=
this
.
g_cartoon
.
getCartoonElement
(
"
btn_restart
"
);
console
.
log
(
"
Check button disabe
"
+
this
.
m_currentQuestion
)
console
.
log
(
"
Check button disabe
"
+
this
.
m_currentQuestion
)
if
(
this
.
m_currentQuestion
<=
-
1
)
{
btnRestart
.
node
.
opacity
=
128
;
btnRestart
.
disable
=
true
;
console
.
log
(
"
Disable restart
"
)
}
else
{
btnRestart
.
node
.
opacity
=
255
;
btnRestart
.
disable
=
false
;
}
if
(
this
.
m_currentQuestion
<=
0
)
{
if
(
this
.
m_currentQuestion
<=
0
)
{
btnLeft
.
node
.
opacity
=
128
;
btnLeft
.
node
.
opacity
=
128
;
btnLeft
.
disable
=
true
;
btnLeft
.
disable
=
true
;
console
.
log
(
"
Disable left
"
)
}
else
{
}
else
{
btnLeft
.
node
.
opacity
=
255
;
btnLeft
.
node
.
opacity
=
255
;
btnLeft
.
disable
=
false
;
btnLeft
.
disable
=
false
;
...
@@ -391,6 +422,7 @@ export default class GameLogic {
...
@@ -391,6 +422,7 @@ export default class GameLogic {
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
-
1
)
{
if
(
this
.
m_currentQuestion
>=
this
.
g_formData
.
dataArray
.
length
-
1
)
{
btnRight
.
node
.
opacity
=
128
;
btnRight
.
node
.
opacity
=
128
;
btnRight
.
disable
=
true
;
btnRight
.
disable
=
true
;
console
.
log
(
"
Disable right
"
)
}
else
{
}
else
{
btnRight
.
node
.
opacity
=
255
;
btnRight
.
node
.
opacity
=
255
;
btnRight
.
disable
=
false
;
btnRight
.
disable
=
false
;
...
...
play/assets/tmpGame/script/Scene.js
View file @
26536659
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/defaultData.js
View file @
26536659
export
default
{
export
default
{
"
default
"
:
true
,
"
version
"
:
"
1.0
"
,
"
version
"
:
"
1.0
"
,
"
key
"
:
"
DataKey_Sbx_Pronunciation
"
,
"
key
"
:
"
DataKey_Sbox_FT_08
"
,
"
dataArray
"
:
[],
"
bgMusic
"
:
""
,
"
theme
"
:
"
A
"
,
"
titleText
"
:
"
It's My Day
"
,
"
border_image_url
"
:
""
,
"
questionAudio_url
"
:
""
,
"
video_image_url
"
:
""
,
"
dataArray
"
:[
"
text_image_url
"
:
""
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
{
"
image_url
"
:
"
card_demo
"
,
"
audio_url
"
:
""
},
]
}
}
\ No newline at end of file
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