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
5639f131
Commit
5639f131
authored
Apr 01, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
f90c8d88
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
76 deletions
+172
-76
Game.fire
play/assets/tmpGame/scene/Game.fire
+88
-10
game.js
play/assets/tmpGame/script/game/game.js
+18
-4
speaker.js
play/assets/tmpGame/script/game/speaker.js
+61
-61
data_mgr.js
play/assets/tmpGame/script/manager/data_mgr.js
+5
-1
No files found.
play/assets/tmpGame/scene/Game.fire
View file @
5639f131
...
...
@@ -75,22 +75,22 @@
"__id__": 5
},
{
"__id__": 18
2
"__id__": 18
4
}
],
"_active": true,
"_components": [
{
"__id__": 18
4
"__id__": 18
6
},
{
"__id__": 18
5
"__id__": 18
7
},
{
"__id__": 18
6
"__id__": 18
8
},
{
"__id__": 18
7
"__id__": 18
9
}
],
"_prefab": null,
...
...
@@ -252,6 +252,9 @@
},
{
"__id__": 8
},
{
"__id__": 182
}
],
"_active": true,
...
...
@@ -2989,8 +2992,8 @@
0,
0,
1,
0.
8
,
0.
8
,
0.
5
,
0.
5
,
1
]
},
...
...
@@ -7805,6 +7808,78 @@
"fileId": "",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 183
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 5000,
"height": 5000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c2bmd0u+BDNIivdoKz1pc8"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 182
},
"_enabled": true,
"_id": "80PylZIy9EbJR4/AZl0xgK"
},
{
"__type__": "cc.Node",
"_name": "speaker",
...
...
@@ -7816,7 +7891,7 @@
"_active": true,
"_components": [
{
"__id__": 18
3
"__id__": 18
5
}
],
"_prefab": null,
...
...
@@ -7872,7 +7947,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
2
"__id__": 18
4
},
"_enabled": true,
"eff_btn": {
...
...
@@ -7976,6 +8051,9 @@
"__id__": 81
}
],
"mask_node": {
"__id__": 182
},
"_id": "4eioQSfZdPna82l0qiAEEA"
},
{
...
...
@@ -7999,7 +8077,7 @@
}
],
"canvasView": {
"__id__": 18
4
"__id__": 18
6
},
"isCanvas": true,
"_id": "5eOVDDzARGnoMLcNXyk5ml"
...
...
play/assets/tmpGame/script/game/game.js
View file @
5639f131
...
...
@@ -45,6 +45,11 @@ var game = cc.Class({
type
:
cc
.
Button
,
displayName
:
"
上下页
"
},
mask_node
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
遮罩
"
}
},
ctor
:
function
()
{
...
...
@@ -113,6 +118,12 @@ var game = cc.Class({
this
.
btnList
[
1
].
node
.
opacity
=
255
/
2
;
this
.
btnList
[
1
].
interactable
=
false
;
}
if
(
g
.
data_mgr
.
pageId
>
0
&&
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
;
this
.
btnList
[
1
].
interactable
=
true
;
}
}
},
...
...
@@ -174,8 +185,8 @@ var game = cc.Class({
//初始化界面
this
.
UpdataUi
();
//播放游戏开始音效
g
.
speaker
.
inst
.
play_start
();
//
//
播放游戏开始音效
//
g.speaker.inst.play_start();
//游戏开始
g
.
game
.
inst
.
gameStart
();
...
...
@@ -205,11 +216,14 @@ var game = cc.Class({
},
//播放标题音效
playAudioTitle
:
function
()
{
playAudioTitle
:
function
(
cb
)
{
//获得播放路径
var
path
=
g
.
data_mgr
.
data
.
contentObj
.
audio_url
;
if
(
path
==
undefined
)
{
cb
&&
cb
();
}
g
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
g
.
snd_mgr
.
playEffect
(
url
);
g
.
snd_mgr
.
playEffect
(
url
,
cb
);
});
},
...
...
play/assets/tmpGame/script/game/speaker.js
View file @
5639f131
...
...
@@ -2,69 +2,69 @@
* 音效
*/
var
speaker
=
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
eff_btn
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击音效
"
},
eff_congratulation
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
撒花音效
"
},
eff_error
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击错误音效
"
},
eff_good
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击正确音效
"
},
eff_showPop
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
显示弹窗音效
"
},
eff_start
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
游戏开始音效
"
},
},
properties
:
{
eff_btn
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击音效
"
},
eff_congratulation
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
撒花音效
"
},
eff_error
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击错误音效
"
},
eff_good
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
点击正确音效
"
},
eff_showPop
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
显示弹窗音效
"
},
eff_start
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
displayName
:
"
游戏开始音效
"
},
},
ctor
:
function
()
{
speaker
.
inst
=
this
;
g
.
speaker
=
speaker
;
},
ctor
:
function
()
{
speaker
.
inst
=
this
;
g
.
speaker
=
speaker
;
},
//点击按钮
play_btn
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_btn
);
},
//点击按钮
play_btn
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_btn
);
},
//撒花音效
play_congratulation
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_congratulation
);
},
//答错
play_error
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_error
);
},
//答对
play_good
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_good
);
},
//显示弹窗
play_showPop
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_showPop
);
},
//游戏开始
play_start
:
function
(
)
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_start
);
},
//撒花音效
play_congratulation
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_congratulation
);
},
//答错
play_error
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_error
);
},
//答对
play_good
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_good
);
},
//显示弹窗
play_showPop
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_showPop
);
},
//游戏开始
play_start
:
function
(
cb
)
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_start
,
cb
);
},
});
play/assets/tmpGame/script/manager/data_mgr.js
View file @
5639f131
...
...
@@ -116,7 +116,11 @@ g.data_mgr = {
g
.
game
.
inst
.
UpdataUi
();
//播放游戏开始音效
g
.
speaker
.
inst
.
play_start
();
g
.
speaker
.
inst
.
play_start
(()
=>
{
g
.
game
.
inst
.
playAudioTitle
(()
=>
{
g
.
game
.
inst
.
mask_node
.
active
=
false
;
});
});
//游戏开始
g
.
game
.
inst
.
gameStart
();
...
...
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