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
6a46d245
Commit
6a46d245
authored
Apr 02, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
d1de056a
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
368 additions
and
426 deletions
+368
-426
Game.fire
play/assets/tmpGame/scene/Game.fire
+335
-384
item.js
play/assets/tmpGame/script/game/item.js
+26
-35
result.js
play/assets/tmpGame/script/game/result.js
+4
-4
speaker.js
play/assets/tmpGame/script/game/speaker.js
+2
-2
data_mgr.js
play/assets/tmpGame/script/manager/data_mgr.js
+1
-1
No files found.
play/assets/tmpGame/scene/Game.fire
View file @
6a46d245
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/game/item.js
View file @
6a46d245
...
...
@@ -58,7 +58,7 @@ cc.Class({
//图片适配
photoScare
:
function
(
node
)
{
let
maxSize
=
Math
.
min
(
90
/
node
.
height
,
90
/
node
.
width
);
let
maxSize
=
Math
.
min
(
128
/
node
.
height
,
128
/
node
.
width
);
if
(
node
.
perScale
==
undefined
)
{
node
.
perScale
=
node
.
scaleX
;
}
else
{
...
...
@@ -111,42 +111,33 @@ cc.Class({
//如果节点的Id等于当前数据的id的话
if
(
this
.
itemInfo
.
typeId
==
g
.
data_mgr
.
playId
&&
this
.
itemInfo
.
positionId
==
g
.
data_mgr
.
playType
)
{
//播放答对音效
g
.
speaker
.
inst
.
play_good
(
);
this
.
setBtnState
(
1
);
//如果是上面答对的话
if
(
this
.
itemInfo
.
positionId
==
1
)
{
//执行播放下排的音乐
g
.
data_mgr
.
playType
=
2
;
g
.
game
.
inst
.
PlayAudio
();
g
.
speaker
.
inst
.
play_good
(
()
=>
{
this
.
setBtnState
(
1
);
//如果是上面答对的话
if
(
this
.
itemInfo
.
positionId
==
1
)
{
//执行播放下排的音乐
g
.
data_mgr
.
playType
=
2
;
g
.
game
.
inst
.
PlayAudio
();
//设置状态
g
.
game
.
inst
.
allLightDark
(
1
,
2
);
g
.
game
.
inst
.
allLightDark
(
2
,
0
);
//设置状态
g
.
game
.
inst
.
allLightDark
(
1
,
2
);
g
.
game
.
inst
.
allLightDark
(
2
,
0
);
//把这个答对的节点保存起来
g
.
data_mgr
.
itemInfo
=
this
;
}
//如果答对的是下排的话
if
(
this
.
itemInfo
.
positionId
==
2
)
{
//连线
var
posStart
=
g
.
data_mgr
.
itemInfo
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
g
.
data_mgr
.
itemInfo
.
spt_chick
.
position
);
var
posEnd
=
this
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
this
.
spt_chick
.
position
);
g
.
data_mgr
.
nowNode
=
this
.
itemInfo
;
g
.
game
.
inst
.
ShowLine
(
posStart
.
x
-
640
,
posStart
.
y
-
360
,
posEnd
.
x
-
640
,
posEnd
.
y
-
360
,
()
=>
{
g
.
data_mgr
.
itemInfo
.
setBtnState
(
3
);
this
.
setBtnState
(
3
);
});
// //显示弹窗
// var Info = g.data_mgr.getResultInfo(this.itemInfo.typeId);
// g.game.inst.showResult(Info);
//弹窗关闭
// //移除当前播放的音乐
// const index = this.pageArr.indexOf(data);
// if (index !== -1) {
// this.pageArr.splice(index, 1);
// }
}
//把这个答对的节点保存起来
g
.
data_mgr
.
itemInfo
=
this
;
}
//如果答对的是下排的话
if
(
this
.
itemInfo
.
positionId
==
2
)
{
//连线
var
posStart
=
g
.
data_mgr
.
itemInfo
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
g
.
data_mgr
.
itemInfo
.
spt_chick
.
position
);
var
posEnd
=
this
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
this
.
spt_chick
.
position
);
g
.
data_mgr
.
nowNode
=
this
.
itemInfo
;
g
.
game
.
inst
.
ShowLine
(
posStart
.
x
-
640
,
posStart
.
y
-
360
,
posEnd
.
x
-
640
,
posEnd
.
y
-
360
,
()
=>
{
g
.
data_mgr
.
itemInfo
.
setBtnState
(
3
);
this
.
setBtnState
(
3
);
});
}
});
}
else
{
this
.
spt_error
.
active
=
true
;
...
...
play/assets/tmpGame/script/game/result.js
View file @
6a46d245
...
...
@@ -192,10 +192,10 @@ var result = cc.Class({
return
;
}
if
(
g
.
data_mgr
.
temPlayAudio
.
length
<
1
)
{
if
(
g
.
data_mgr
.
pageId
==
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
//显示结算撒花
g
.
eff_well
.
inst
.
showEff
();
}
//
if (g.data_mgr.pageId == g.data_mgr.data.contentObj.pageArr.length - 1) {
//
//显示结算撒花
//
g.eff_well.inst.showEff();
//
}
this
.
End
=
false
;
}
else
{
//重新随机一组数据
...
...
play/assets/tmpGame/script/game/speaker.js
View file @
6a46d245
...
...
@@ -56,8 +56,8 @@ var speaker = cc.Class({
g
.
snd_mgr
.
playEffect
(
this
.
eff_error
);
},
//答对
play_good
:
function
()
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_good
);
play_good
:
function
(
cb
)
{
g
.
snd_mgr
.
playEffect
(
this
.
eff_good
,
cb
);
},
//显示弹窗
play_showPop
:
function
()
{
...
...
play/assets/tmpGame/script/manager/data_mgr.js
View file @
6a46d245
This diff is collapsed.
Click to expand it.
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