Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lwd
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
Lwd
Commits
fb9c688e
Commit
fb9c688e
authored
Mar 31, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
2ee5c039
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2161 additions
and
2110 deletions
+2161
-2110
Game.fire
play/assets/tmpGame/scene/Game.fire
+2096
-2088
game.js
play/assets/tmpGame/script/game/game.js
+49
-16
result.js
play/assets/tmpGame/script/game/result.js
+16
-6
frame_4.png
play/assets/tmpGame/textures/frame_4.png
+0
-0
No files found.
play/assets/tmpGame/scene/Game.fire
View file @
fb9c688e
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/game/game.js
View file @
fb9c688e
...
@@ -39,7 +39,12 @@ var game = cc.Class({
...
@@ -39,7 +39,12 @@ var game = cc.Class({
default
:
null
,
default
:
null
,
type
:
cc
.
Label
,
type
:
cc
.
Label
,
displayName
:
"
标题
"
displayName
:
"
标题
"
}
},
btnList
:
{
default
:
[],
type
:
cc
.
Button
,
displayName
:
"
上下页
"
},
},
},
ctor
:
function
()
{
ctor
:
function
()
{
...
@@ -81,11 +86,54 @@ var game = cc.Class({
...
@@ -81,11 +86,54 @@ var game = cc.Class({
//游戏开始
//游戏开始
gameStart
:
function
()
{
gameStart
:
function
()
{
//设置上下页按钮状态
this
.
setButtonState
();
console
.
log
(
"
游戏开始:
"
+
g
.
data_mgr
);
console
.
log
(
"
游戏开始:
"
+
g
.
data_mgr
);
//播放一个上面的音乐
//播放一个上面的音乐
this
.
setAudioInfo
(
1
);
this
.
setAudioInfo
(
1
);
},
},
//设置上下页按钮状态
setButtonState
:
function
()
{
//先判断题目长度
if
(
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
<
2
)
{
this
.
btnList
[
0
].
node
.
active
=
false
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
else
{
//如果第一页
if
(
g
.
data_mgr
.
pageId
==
0
)
{
this
.
btnList
[
1
].
node
.
opacity
=
255
;
this
.
btnList
[
1
].
interactable
=
true
;
this
.
btnList
[
0
].
node
.
opacity
=
255
/
2
;
this
.
btnList
[
0
].
interactable
=
false
;
}
if
(
g
.
data_mgr
.
pageId
==
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
opacity
=
255
;
this
.
btnList
[
0
].
interactable
=
true
;
this
.
btnList
[
1
].
node
.
opacity
=
255
/
2
;
this
.
btnList
[
1
].
interactable
=
false
;
}
}
},
//上一关
onBtnLastPage
:
function
()
{
if
(
g
.
data_mgr
.
pageId
-
1
>=
0
)
{
g
.
data_mgr
.
pageId
-=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
//下一关
onBtnNextPage
:
function
()
{
if
(
g
.
data_mgr
.
pageId
+
1
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
)
{
g
.
data_mgr
.
pageId
+=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
//获得随机播放的音乐并播放
//获得随机播放的音乐并播放
setAudioInfo
:
function
(
type
)
{
setAudioInfo
:
function
(
type
)
{
//随机一个数字 播放这个数字的上段部分
//随机一个数字 播放这个数字的上段部分
...
@@ -146,21 +194,6 @@ var game = cc.Class({
...
@@ -146,21 +194,6 @@ var game = cc.Class({
g
.
result
.
inst
.
updateUI
(
Info
);
g
.
result
.
inst
.
updateUI
(
Info
);
},
},
//上一关
onBtnLastPage
:
function
()
{
if
(
g
.
data_mgr
.
pageId
-
1
>=
0
)
{
g
.
data_mgr
.
pageId
-=
1
;
this
.
onBtnReStart
();
}
},
//下一关
onBtnNextPage
:
function
()
{
if
(
g
.
data_mgr
.
pageId
+
1
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
)
{
g
.
data_mgr
.
pageId
+=
1
;
this
.
onBtnReStart
();
}
},
//播放音乐
//播放音乐
PlayAudio
:
function
()
{
PlayAudio
:
function
()
{
...
...
play/assets/tmpGame/script/game/result.js
View file @
fb9c688e
...
@@ -67,8 +67,8 @@ var result = cc.Class({
...
@@ -67,8 +67,8 @@ var result = cc.Class({
if
(
Info
.
type
==
"
Spine
"
)
{
if
(
Info
.
type
==
"
Spine
"
)
{
g
.
res_mgr
.
loadSpine
(
this
.
Armature
,
Info
);
g
.
res_mgr
.
loadSpine
(
this
.
Armature
,
Info
);
}
}
this
.
initRichText
(
Info
.
groupLabel
);
this
.
initRichText
(
Info
.
groupLabel
);
this
.
wellDone
.
active
=
false
;
this
.
wellDone
.
active
=
false
;
this
.
frame_tips
.
active
=
true
;
this
.
frame_tips
.
active
=
true
;
this
.
eff_sahua
.
node
.
active
=
false
;
this
.
eff_sahua
.
node
.
active
=
false
;
...
@@ -114,8 +114,8 @@ var result = cc.Class({
...
@@ -114,8 +114,8 @@ var result = cc.Class({
this
.
layoutText
.
getComponent
(
cc
.
Layout
).
updateLayout
();
this
.
layoutText
.
getComponent
(
cc
.
Layout
).
updateLayout
();
let
width
=
this
.
layoutText
.
width
;
let
width
=
this
.
layoutText
.
width
;
if
(
width
>
100
0
)
{
if
(
width
>
85
0
)
{
let
scale
=
100
0
/
width
;
let
scale
=
85
0
/
width
;
this
.
layoutText
.
scale
=
scale
;
this
.
layoutText
.
scale
=
scale
;
}
}
},
},
...
@@ -179,14 +179,21 @@ var result = cc.Class({
...
@@ -179,14 +179,21 @@ var result = cc.Class({
if
(
!
this
.
layoutText
.
children
[
this
.
textIndex
]
||
this
.
textIndex
==
this
.
layoutText
.
childrenCount
)
{
if
(
!
this
.
layoutText
.
children
[
this
.
textIndex
]
||
this
.
textIndex
==
this
.
layoutText
.
childrenCount
)
{
this
.
isPlaying
=
false
;
this
.
isPlaying
=
false
;
this
.
unschedule
(
this
.
chengeTextColor
);
this
.
unschedule
(
this
.
chengeTextColor
);
if
(
g
.
data_mgr
.
temPlayAudio
.
length
<
1
)
{
if
(
g
.
data_mgr
.
pageId
==
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
//显示结算撒花
g
.
game
.
inst
.
showResult
();
}
}
}
}
this
.
layoutText
.
children
[
this
.
textIndex
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]));
this
.
layoutText
.
children
[
this
.
textIndex
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
1
]));
this
.
layoutText
.
children
[
this
.
textIndex
-
1
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
-
1
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
1
]));
this
.
layoutText
.
children
[
this
.
textIndex
-
1
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
-
1
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]));
this
.
textIndex
++
;
this
.
textIndex
++
;
},
},
clearTextColor
()
{
clearTextColor
()
{
for
(
let
i
=
0
;
i
<
this
.
layoutText
.
children
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
layoutText
.
children
.
length
;
i
++
)
{
this
.
layoutText
.
children
[
i
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
1
]);
this
.
layoutText
.
children
[
i
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]);
}
}
},
},
...
@@ -201,6 +208,9 @@ var result = cc.Class({
...
@@ -201,6 +208,9 @@ var result = cc.Class({
//点击关闭
//点击关闭
onBtnClose
:
function
()
{
onBtnClose
:
function
()
{
this
.
node
.
active
=
false
;
this
.
node
.
active
=
false
;
this
.
stopSpine
();
this
.
clearTextColor
();
this
.
stopAudio
();
//如果播放列表少于1则显示
//如果播放列表少于1则显示
if
(
this
.
End
==
false
)
{
if
(
this
.
End
==
false
)
{
return
;
return
;
...
...
play/assets/tmpGame/textures/frame_4.png
View replaced file @
2ee5c039
View file @
fb9c688e
374 KB
|
W:
|
H:
367 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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