Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LWD_3
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_3
Commits
247ea653
Commit
247ea653
authored
Dec 29, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
e44191d5
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1268 additions
and
563 deletions
+1268
-563
LWD_3.meta
assets/LWD_3.meta
+15
-1
LWD_3.fire
assets/LWD_3/scene/LWD_3.fire
+972
-271
LWD_3.js
assets/LWD_3/scene/LWD_3.js
+115
-124
view.js
assets/LWD_3/script/common/view.js
+0
-48
handMove.js
assets/LWD_3/script/game/handMove.js
+12
-0
handMove.js.meta
assets/LWD_3/script/game/handMove.js.meta
+9
-0
item.js
assets/LWD_3/script/game/item.js
+9
-0
speaker.js
assets/LWD_3/script/game/speaker.js
+0
-102
data_mgr.js
assets/LWD_3/script/manager/data_mgr.js
+18
-17
bg_circle.png
assets/LWD_3/textures/bg_circle.png
+0
-0
bg_circle.png.meta
assets/LWD_3/textures/bg_circle.png.meta
+36
-0
btn_restart.png
assets/LWD_3/textures/btn_restart.png
+0
-0
btn_restart.png.meta
assets/LWD_3/textures/btn_restart.png.meta
+36
-0
icon_hand.png
assets/LWD_3/textures/icon_hand.png
+0
-0
icon_hand.png.meta
assets/LWD_3/textures/icon_hand.png.meta
+36
-0
form.component.html
form/src/app/form/form.component.html
+10
-0
No files found.
assets/LWD_3.meta
View file @
247ea653
{"ver":"1.1.2","uuid":"551f3197-dce7-4bd2-a290-e784ab1d271a","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
{
\ No newline at end of file
"ver": "1.1.2",
"uuid": "551f3197-dce7-4bd2-a290-e784ab1d271a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/LWD_3/scene/LWD_3.fire
View file @
247ea653
This diff is collapsed.
Click to expand it.
assets/LWD_3/scene/LWD_3.js
View file @
247ea653
...
@@ -28,6 +28,27 @@ var game = cc.Class({
...
@@ -28,6 +28,27 @@ var game = cc.Class({
default
:
null
,
default
:
null
,
type
:
dragonBones
.
ArmatureDisplay
,
type
:
dragonBones
.
ArmatureDisplay
,
displayName
:
"
猫
"
displayName
:
"
猫
"
},
btnReStart
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
重新开始按钮
"
},
nodCircle
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
光圈
"
},
handTip
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
重新开始按钮
"
},
nodMask
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
遮罩
"
}
}
},
},
...
@@ -41,7 +62,7 @@ var game = cc.Class({
...
@@ -41,7 +62,7 @@ var game = cc.Class({
// 生命周期 onLoad
// 生命周期 onLoad
onLoad
()
{
onLoad
()
{
//初始化游戏
//初始化游戏
this
.
initGame
()
;
this
.
initGame
()
// //监听尺寸变化
// //监听尺寸变化
// if (window.addEventListener) {
// if (window.addEventListener) {
...
@@ -83,18 +104,6 @@ var game = cc.Class({
...
@@ -83,18 +104,6 @@ var game = cc.Class({
return
svBBoxRect
return
svBBoxRect
},
},
//检查当前缩放倍数
checkScale
:
function
(
num
)
{
var
scale
=
1
;
if
(
num
>
2
&&
num
<=
4
)
{
scale
=
0.74
}
if
(
num
>
4
)
{
scale
=
0.65
}
return
scale
;
},
//添加节点
//添加节点
addItem
:
function
()
{
addItem
:
function
()
{
...
@@ -120,22 +129,6 @@ var game = cc.Class({
...
@@ -120,22 +129,6 @@ var game = cc.Class({
};
};
},
},
//五秒没操作
hintPlay
:
function
()
{
// this.playLionDragon("openmouth")
this
.
playCatDragon
(
"
begin
"
)
LWD_3
.
speaker
.
inst
.
playEffect
(
LWD_3
.
enum
.
E_Audio
.
CatHint
);
for
(
var
i
=
0
;
i
<
this
.
contentArr
.
childrenCount
;
i
++
)
{
cc
.
tween
(
this
.
contentArr
.
children
[
i
].
children
[
0
])
.
to
(
0.1
,
{
x
:
-
50
})
.
to
(
0.1
,
{
x
:
0
})
.
to
(
0.1
,
{
x
:
50
})
.
to
(
0.1
,
{
x
:
0
})
.
start
();
}
},
//隐藏剩余物品并跳转下一题
//隐藏剩余物品并跳转下一题
resetQues
:
function
()
{
resetQues
:
function
()
{
if
(
LWD_3
.
data_mgr
.
quesId
>=
4
)
{
if
(
LWD_3
.
data_mgr
.
quesId
>=
4
)
{
...
@@ -158,34 +151,29 @@ var game = cc.Class({
...
@@ -158,34 +151,29 @@ var game = cc.Class({
finish
()
{
finish
()
{
this
.
playLionDragon
(
"
normal
"
)
this
.
playLionDragon
(
"
normal
"
)
this
.
playCatDragon
(
"
finish
"
)
this
.
playCatDragon
(
"
finish
"
)
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
LWD_3
.
speaker
.
inst
.
playEffect
(
LWD_3
.
enum
.
E_Audio
.
CatComplete
);
},
500
));
},
//检测放到哪个节点底下
//播放引导音频
checkNodeParent
:
function
()
{
let
path
=
LWD_3
.
data_mgr
.
getAudioEnd
();
//获取到总列表
if
(
path
==
-
1
)
return
this
.
showRestartBtn
();
var
itemArr
=
LWD_3
.
data_mgr
.
getSheepArr
();
LWD_3
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
LWD_3
.
snd_mgr
.
playEffect
(
url
,
()
=>
{
//
this
.
showRestartBtn
();
if
(
itemArr
.
length
<=
7
)
{
})
var
idx
=
1
;
})
}
else
{
var
idx
=
0
;
}
return
idx
;
},
},
//检查类别
//开始引导游戏
checkType
:
function
(
Id
)
{
guideGame
:
function
()
{
for
(
var
i
in
LWD_3
.
data_mgr
.
getSheepfoldArr
())
{
this
.
UpdataUi
();
var
sheepfoldInfo
=
LWD_3
.
data_mgr
.
getSheepfoldArr
()[
i
];
this
.
playCatDragon
(
"
begin
"
);
if
(
Id
==
sheepfoldInfo
.
id
)
{
//播放引导音频
return
~~
i
+
1
;
let
path
=
LWD_3
.
data_mgr
.
getAudioBegin
();
}
if
(
path
==
-
1
)
return
this
.
nodMask
.
active
=
false
;
}
LWD_3
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
return
-
1
;
LWD_3
.
snd_mgr
.
playEffect
(
url
,
()
=>
{
this
.
nodMask
.
active
=
false
;
})
})
},
},
//更新界面信息
//更新界面信息
...
@@ -207,15 +195,10 @@ var game = cc.Class({
...
@@ -207,15 +195,10 @@ var game = cc.Class({
//播放题干
//播放题干
this
.
playAudioTitle
();
this
.
playAudioTitle
();
// LWD_3.speaker.inst.playEffect(E_Audio.BtnCommom);
//重置UI界面
//重置UI界面
this
.
resetUI
();
this
.
resetUI
();
//添加项
//添加项
this
.
addItem
();
this
.
addItem
();
// //设置上下页按钮状态
// this.setButtonState();
},
},
//播放猫动画
//播放猫动画
...
@@ -230,15 +213,44 @@ var game = cc.Class({
...
@@ -230,15 +213,44 @@ var game = cc.Class({
this
.
dragonLion
.
playAnimation
(
name
);
this
.
dragonLion
.
playAnimation
(
name
);
},
},
//点击猫猫
onBtnCheckCat
:
function
()
{
if
(
this
.
_isSpeak
)
return
;
//判断当前状态
if
(
LWD_3
.
data_mgr
.
quesId
<
4
)
{
this
.
_isSpeak
=
true
;
this
.
playCatDragon
(
"
begin
"
);
this
.
playAudioTitle
(()
=>
{
this
.
_isSpeak
=
false
;
this
.
playCatDragon
(
"
normal
"
);
});
}
//如果结束了则提示音
if
(
this
.
btnReStart
.
active
)
{
let
path
=
LWD_3
.
data_mgr
.
getAudioReStart
();
if
(
path
==
-
1
)
return
;
this
.
_isSpeak
=
true
this
.
playCatDragon
(
"
begin
"
);
LWD_3
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
LWD_3
.
snd_mgr
.
playEffect
(
url
,
()
=>
{
this
.
_isSpeak
=
false
;
this
.
playCatDragon
(
"
normal
"
);
})
});
}
},
//播放题干
//播放题干
playAudioTitle
:
function
()
{
playAudioTitle
:
function
(
cb
)
{
if
(
LWD_3
.
data_mgr
.
quesId
>=
4
)
return
//获得播放路径
var
path
=
LWD_3
.
data_mgr
.
getQuestionStem
(
LWD_3
.
data_mgr
.
quesId
);
var
path
=
LWD_3
.
data_mgr
.
getQuestionStem
(
LWD_3
.
data_mgr
.
quesId
);
if
(
LWD_3
.
data_mgr
.
quesId
>=
4
||
!
path
)
return
//获得播放路径
LWD_3
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
LWD_3
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
LWD_3
.
snd_mgr
.
playEffect
(
url
,
()
=>
{
LWD_3
.
snd_mgr
.
playEffect
(
url
,
()
=>
{
//结束回调
//结束回调
this
.
playCatDragon
(
"
normal
"
);
this
.
playCatDragon
(
"
normal
"
);
cb
&&
cb
();
});
});
});
});
},
},
...
@@ -249,16 +261,6 @@ var game = cc.Class({
...
@@ -249,16 +261,6 @@ var game = cc.Class({
this
.
contentArr
.
removeAllChildren
();
this
.
contentArr
.
removeAllChildren
();
},
},
//重新开始
onBtnReStart
:
function
()
{
LWD_3
.
speaker
.
inst
.
play_btn
();
//移除所有计时器
this
.
unscheduleAllCallbacks
();
//初始化界面
this
.
UpdataUi
();
LWD_3
.
speaker
.
inst
.
play_restart
();
},
//游戏开始
//游戏开始
gameStart
:
function
()
{
gameStart
:
function
()
{
console
.
log
(
"
游戏开始:
"
+
LWD_3
.
data_mgr
);
console
.
log
(
"
游戏开始:
"
+
LWD_3
.
data_mgr
);
...
@@ -266,69 +268,58 @@ var game = cc.Class({
...
@@ -266,69 +268,58 @@ var game = cc.Class({
this
.
setAudioInfo
(
1
);
this
.
setAudioInfo
(
1
);
},
},
//设置上下页按钮状态
setButtonState
:
function
()
{
//先判断题目长度
if
(
LWD_3
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
<
2
)
{
this
.
btnList
[
0
].
node
.
active
=
false
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
else
{
//如果第一页
if
(
LWD_3
.
data_mgr
.
pageId
==
0
)
{
this
.
btnList
[
1
].
node
.
active
=
true
;
this
.
btnList
[
0
].
node
.
active
=
false
;
}
if
(
LWD_3
.
data_mgr
.
pageId
==
LWD_3
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
if
(
LWD_3
.
data_mgr
.
pageId
>
0
&&
LWD_3
.
data_mgr
.
pageId
<
LWD_3
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
true
;
}
}
},
//下一关
onBtnNextQues
:
function
()
{
LWD_3
.
data_mgr
.
time
=
0
;
LWD_3
.
speaker
.
inst
.
playEffect
(
LWD_3
.
enum
.
E_Audio
.
BtnCommom
);
LWD_3
.
data_mgr
.
quesId
+=
1
;
LWD_3
.
game
.
inst
.
resetQues
();
},
//重新开始
//重新开始
onBtnReStart
()
{
onBtnReStart
()
{
LWD_3
.
data_mgr
.
time
=
0
;
//隐藏节点
LWD_3
.
data_mgr
.
resetQuestion
()
;
this
.
btnReStart
.
active
=
false
;
//播放音效
LWD_3
.
speaker
.
inst
.
playEffect
(
LWD_3
.
enum
.
E_Audio
.
BtnCommom
);
LWD_3
.
speaker
.
inst
.
playEffect
(
LWD_3
.
enum
.
E_Audio
.
BtnCommom
);
//数据重置
LWD_3
.
data_mgr
.
quesId
=
0
;
LWD_3
.
data_mgr
.
quesId
=
0
;
//更新界面
this
.
UpdataUi
();
this
.
UpdataUi
();
},
//上一关
this
.
hideRestartBtn
();
onBtnLastPage
:
function
()
{
},
LWD_3
.
speaker
.
inst
.
play_btn
();
if
(
LWD_3
.
data_mgr
.
pageId
-
1
>=
0
)
{
//手势移动
LWD_3
.
data_mgr
.
pageId
-=
1
;
setHandTip
(
node
)
{
this
.
setButtonState
();
//传入当前点击的节点坐标,移动至中心点
this
.
onBtnReStart
();
var
beginPos
=
cc
.
v2
(
node
.
x
,
node
.
y
+
this
.
contentArr
.
y
);
}
//50偏移量到嘴巴
var
EndPos
=
cc
.
v2
(
this
.
dragonLion
.
node
.
x
,
this
.
dragonLion
.
node
.
y
-
300
);
this
.
handTween
&&
this
.
handTween
.
stop
();
this
.
handTween
=
cc
.
tween
(
this
.
handTip
)
.
call
(()
=>
{
this
.
handTip
.
active
=
true
;
this
.
handTip
.
x
=
beginPos
.
x
;
this
.
handTip
.
y
=
beginPos
.
y
;
})
.
to
(
1.5
,
{
x
:
EndPos
.
x
,
y
:
EndPos
.
y
})
.
call
(()
=>
{
this
.
handTip
.
active
=
false
;
})
.
union
()
.
repeat
(
2
)
// 执行2次
.
start
();
},
},
//下一关
showRestartBtn
()
{
onBtnNextPage
:
function
()
{
this
.
btnReStart
.
active
=
true
;
LWD_3
.
speaker
.
inst
.
play_btn
();
cc
.
tween
(
this
.
nodCircle
)
.
set
({
scale
:
0.8
,
opacity
:
255
})
.
to
(
2
,
{
scale
:
1.2
,
opacity
:
0
})
.
union
()
.
repeatForever
()
.
start
();
},
if
(
LWD_3
.
data_mgr
.
pageId
+
1
<
LWD_3
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
)
{
hideRestartBtn
()
{
LWD_3
.
data_mgr
.
pageId
+=
1
;
this
.
nodCircle
.
stopAllActions
();
this
.
setButtonState
();
this
.
nodCircle
.
scale
=
0.8
;
this
.
onBtnReStart
();
this
.
nodCircle
.
opacity
=
255
;
}
},
},
_timeoutIds
:
null
,
_timeoutIds
:
null
,
_intervalIds
:
null
,
_intervalIds
:
null
,
// 生命周期
// 生命周期
...
...
assets/LWD_3/script/common/view.js
View file @
247ea653
...
@@ -8,16 +8,6 @@ cc.Class({
...
@@ -8,16 +8,6 @@ cc.Class({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
properties
:
{
UIMax
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
等比放大
"
},
topUI
:
{
default
:
[],
type
:
cc
.
Widget
,
},
bgScaleMax
:
{
bgScaleMax
:
{
default
:
[],
default
:
[],
type
:
cc
.
Node
,
type
:
cc
.
Node
,
...
@@ -54,8 +44,6 @@ cc.Class({
...
@@ -54,8 +44,6 @@ cc.Class({
// var h = (canvaSize.height) / WIDTH;
// var h = (canvaSize.height) / WIDTH;
this
.
MaxSize
=
1
//w / h > 1 ? w / h : h / w;
this
.
MaxSize
=
1
//w / h > 1 ? w / h : h / w;
this
.
setUIMax
(
this
.
MaxSize
);
this
.
settopUI
(
this
.
MaxSize
);
this
.
setBgScale
();
this
.
setBgScale
();
this
.
setUiPositon
();
this
.
setUiPositon
();
var
scene
=
cc
.
director
.
getScene
();
var
scene
=
cc
.
director
.
getScene
();
...
@@ -120,8 +108,6 @@ cc.Class({
...
@@ -120,8 +108,6 @@ cc.Class({
this
.
MaxSize
=
1
// w / h > 1 ? w / h : h / w;
this
.
MaxSize
=
1
// w / h > 1 ? w / h : h / w;
LWD_3
.
data_mgr
.
MaxSize
=
this
.
MaxSize
;
LWD_3
.
data_mgr
.
MaxSize
=
this
.
MaxSize
;
this
.
setUIMax
(
this
.
MaxSize
);
this
.
settopUI
(
this
.
MaxSize
);
this
.
setBgScale
();
this
.
setBgScale
();
this
.
setUiPositon
();
this
.
setUiPositon
();
var
scene
=
cc
.
director
.
getScene
();
var
scene
=
cc
.
director
.
getScene
();
...
@@ -136,35 +122,16 @@ cc.Class({
...
@@ -136,35 +122,16 @@ cc.Class({
LWD_3
.
event_pump
.
unReg
(
"
adjustUI
"
);
LWD_3
.
event_pump
.
unReg
(
"
adjustUI
"
);
}
}
},
},
settopUI
:
function
(
s
)
{
if
(
!
LWD_3
.
data_mgr
.
phoneInfo
)
{
return
;
}
var
top
=
LWD_3
.
data_mgr
.
phoneInfo
;
top
=
top
*
s
;
for
(
var
i
in
this
.
topUI
)
{
if
(
this
.
topUI
[
i
].
perTop
==
undefined
)
{
this
.
topUI
[
i
].
perTop
=
this
.
topUI
[
i
].
top
;
}
else
{
this
.
topUI
[
i
].
top
=
this
.
topUI
[
i
].
perTop
;
}
this
.
topUI
[
i
].
top
+=
top
;
console
.
log
(
this
.
topUI
[
i
].
top
);
}
},
//背景适配
//背景适配
setBgScale
:
function
()
{
setBgScale
:
function
()
{
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
bg
.
scale
=
this
.
_mapScaleMax
;
bg
.
scale
=
this
.
_mapScaleMax
;
const
grass
=
cc
.
find
(
'
Canvas/connent/bg_grass
'
);
const
grass
=
cc
.
find
(
'
Canvas/connent/bg_grass
'
);
grass
.
scaleX
=
this
.
canvas
.
width
/
grass
.
width
;
grass
.
scaleX
=
this
.
canvas
.
width
/
grass
.
width
;
return
;
return
;
for
(
var
i
in
this
.
bgScaleMax
)
{
for
(
var
i
in
this
.
bgScaleMax
)
{
// 1. 先找到 SHOW_ALL 模式适配之后,本节点的实际宽高以及初始缩放值
// 1. 先找到 SHOW_ALL 模式适配之后,本节点的实际宽高以及初始缩放值
...
@@ -185,7 +152,6 @@ cc.Class({
...
@@ -185,7 +152,6 @@ cc.Class({
//适配节点位置
//适配节点位置
setUiPositon
:
function
()
{
setUiPositon
:
function
()
{
return
;
for
(
var
i
in
this
.
nodeUIOffset
)
{
for
(
var
i
in
this
.
nodeUIOffset
)
{
// 1. 先找到 SHOW_ALL 模式适配之后,本节点的实际宽高以及初始缩放值
// 1. 先找到 SHOW_ALL 模式适配之后,本节点的实际宽高以及初始缩放值
let
srcScaleForShowAll
=
Math
.
min
(
let
srcScaleForShowAll
=
Math
.
min
(
...
@@ -201,20 +167,6 @@ cc.Class({
...
@@ -201,20 +167,6 @@ cc.Class({
}
}
},
},
setUIMax
:
function
(
size
)
{
return
;
for
(
var
i
in
this
.
UIMax
)
{
if
(
this
.
UIMax
[
i
].
perScale
==
undefined
)
{
this
.
UIMax
[
i
].
perScale
=
this
.
UIMax
[
i
].
scaleX
;
}
else
{
this
.
UIMax
[
i
].
scaleX
=
this
.
UIMax
[
i
].
perScale
;
this
.
UIMax
[
i
].
scaleY
=
this
.
UIMax
[
i
].
perScale
;
}
this
.
UIMax
[
i
].
scaleX
*=
size
;
this
.
UIMax
[
i
].
scaleY
*=
size
;
}
},
findCanvas
:
function
()
{
findCanvas
:
function
()
{
if
(
cc
.
sys
.
isNative
)
{
if
(
cc
.
sys
.
isNative
)
{
return
{
return
{
...
...
assets/LWD_3/script/game/handMove.js
0 → 100644
View file @
247ea653
//手势移动
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
},
start
()
{
},
});
assets/LWD_3/script/game/handMove.js.meta
0 → 100644
View file @
247ea653
{
"ver": "1.0.8",
"uuid": "3965d960-0cbf-4158-af67-3ddc4ae03225",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/LWD_3/script/game/item.js
View file @
247ea653
...
@@ -23,6 +23,7 @@ cc.Class({
...
@@ -23,6 +23,7 @@ cc.Class({
start
:
function
()
{
start
:
function
()
{
this
.
_timeoutIds
=
[];
this
.
_timeoutIds
=
[];
this
.
_intervalIds
=
[];
this
.
_intervalIds
=
[];
this
.
handTip
=
0
;
//手势提示次数
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
touchBegan
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
touchBegan
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
touchMove
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
touchMove
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
touchEnd
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
touchEnd
,
this
);
...
@@ -35,6 +36,9 @@ cc.Class({
...
@@ -35,6 +36,9 @@ cc.Class({
LWD_3
.
data_mgr
.
gameState
=
2
;
LWD_3
.
data_mgr
.
gameState
=
2
;
LWD_3
.
data_mgr
.
time
=
0
;
LWD_3
.
data_mgr
.
time
=
0
;
//如果有提示手则停止
LWD_3
.
game
.
inst
.
handTween
&&
LWD_3
.
game
.
inst
.
handTween
.
stop
();
//狮子猫动画
//狮子猫动画
LWD_3
.
game
.
inst
.
playLionDragon
(
"
openmouth
"
);
LWD_3
.
game
.
inst
.
playLionDragon
(
"
openmouth
"
);
...
@@ -124,6 +128,7 @@ cc.Class({
...
@@ -124,6 +128,7 @@ cc.Class({
this
.
errorEffect
();
this
.
errorEffect
();
}
}
}
else
{
}
else
{
this
.
handTip
+=
1
;
this
.
errorEffect
();
this
.
errorEffect
();
}
}
},
},
...
@@ -201,6 +206,10 @@ cc.Class({
...
@@ -201,6 +206,10 @@ cc.Class({
});
});
LWD_3
.
game
.
inst
.
playCatDragon
(
"
wrong
"
);
LWD_3
.
game
.
inst
.
playCatDragon
(
"
wrong
"
);
LWD_3
.
game
.
inst
.
playLionDragon
(
"
normal
"
);
LWD_3
.
game
.
inst
.
playLionDragon
(
"
normal
"
);
if
(
this
.
handTip
>=
2
)
{
LWD_3
.
game
.
inst
.
setHandTip
(
this
.
node
.
parent
);
this
.
handTip
=
0
;
}
},
500
));
},
500
));
},
},
...
...
assets/LWD_3/script/game/speaker.js
View file @
247ea653
...
@@ -16,21 +16,6 @@ var E_Audio = {
...
@@ -16,21 +16,6 @@ var E_Audio = {
Error
:
9
,
Error
:
9
,
}
}
// var E_lion = {
// normal= "normal",
// no = "no",
// chew = "chew",
// openmouth = "openmouth"
// }
// var E_cat = {
// begin = "begin",
// right = "right",
// normal= "normal",
// wrong = "wrong",
// finish = "finish"
// }
var
speaker
=
cc
.
Class
({
var
speaker
=
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
...
@@ -40,57 +25,6 @@ var speaker = cc.Class({
...
@@ -40,57 +25,6 @@ var speaker = cc.Class({
type
:
cc
.
AudioClip
,
type
:
cc
.
AudioClip
,
displayName
:
"
音效列表
"
displayName
:
"
音效列表
"
},
},
// eff_allPop: {
// default: null,
// type: cc.AudioClip,
// displayName: "全部弹出"
// },
// eff_btn: {
// default: null,
// type: cc.AudioClip,
// displayName: "点击音效"
// },
// eff_right: {
// default: null,
// type: cc.AudioClip,
// displayName: "正确音效"
// },
// eff_catComplete: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫完成"
// },
// eff_catHint: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫提示"
// },
// eff_catRight1: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫正确1"
// },
// eff_catRight2: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫正确2"
// },
// eff_catError1: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫错误1"
// },
// eff_catError2: {
// default: null,
// type: cc.AudioClip,
// displayName: "猫错误2"
// },
},
},
ctor
:
function
()
{
ctor
:
function
()
{
...
@@ -104,40 +38,4 @@ var speaker = cc.Class({
...
@@ -104,40 +38,4 @@ var speaker = cc.Class({
LWD_3
.
snd_mgr
.
playEffect
(
this
.
eff_audio
[
num
],
cb
);
LWD_3
.
snd_mgr
.
playEffect
(
this
.
eff_audio
[
num
],
cb
);
},
},
// //点击按钮
// play_btn: function () {
// LWD_3.snd_mgr.playEffect(this.eff_btn);
// },
// //撒花音效
// play_congratulation: function () {
// LWD_3.snd_mgr.playEffect(this.eff_congratulation);
// },
// //答错
// play_error: function () {
// LWD_3.snd_mgr.playEffect(this.eff_error);
// },
// //答对
// play_good: function (cb) {
// LWD_3.snd_mgr.playEffect(this.eff_good, cb);
// },
// //显示弹窗
// play_showPop: function () {
// LWD_3.snd_mgr.playEffect(this.eff_showPop);
// },
// //游戏开始
// play_start: function (cb) {
// LWD_3.snd_mgr.playEffect(this.eff_start, cb);
// },
// //拉开窗帘
// play_open: function () {
// LWD_3.snd_mgr.playEffect(this.eff_open);
// },
// //重新开始
// play_restart: function () {
// LWD_3.snd_mgr.playEffect(this.eff_restart);
// },
});
});
assets/LWD_3/script/manager/data_mgr.js
View file @
247ea653
...
@@ -7,7 +7,6 @@ LWD_3.data_mgr = {
...
@@ -7,7 +7,6 @@ LWD_3.data_mgr = {
nowNum
:
0
,
//剩余正确数量
nowNum
:
0
,
//剩余正确数量
gameState
:
2
,
//游戏状态1可操作 2不可操作
gameState
:
2
,
//游戏状态1可操作 2不可操作
time
:
0
,
//获得默认数据
//获得默认数据
getDefaultData
()
{
getDefaultData
()
{
...
@@ -42,7 +41,10 @@ LWD_3.data_mgr = {
...
@@ -42,7 +41,10 @@ LWD_3.data_mgr = {
"
tex_json
"
:
"
http://staging-teach.cdn.ireadabc.com/511fe163f2df10925e3da82f0f69590b.json
"
,
"
tex_json
"
:
"
http://staging-teach.cdn.ireadabc.com/511fe163f2df10925e3da82f0f69590b.json
"
,
"
tex_json_name
"
:
"
lion_tex.json
"
,
"
tex_json_name
"
:
"
lion_tex.json
"
,
"
tex_png
"
:
"
http://staging-teach.cdn.ireadabc.com/2fd2a53fcb36d36281a6ded9500dd54f.png
"
,
"
tex_png
"
:
"
http://staging-teach.cdn.ireadabc.com/2fd2a53fcb36d36281a6ded9500dd54f.png
"
,
"
tex_png_name
"
:
"
lion_tex.png
"
"
tex_png_name
"
:
"
lion_tex.png
"
,
"
guideBegin_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3
"
,
"
guideEnd_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3
"
,
"
guideRestart_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/bd6e2b3a870ef3f9ee9ad9c0fda79228.mp3
"
,
}
}
const
data
=
dataJson
;
const
data
=
dataJson
;
// const data = JSON.parse(dataJson);
// const data = JSON.parse(dataJson);
...
@@ -50,6 +52,19 @@ LWD_3.data_mgr = {
...
@@ -50,6 +52,19 @@ LWD_3.data_mgr = {
return
data
;
return
data
;
},
},
getAudioBegin
()
{
if
(
!
this
.
data
.
guideBegin_audio_url
)
return
-
1
;
return
this
.
data
.
guideBegin_audio_url
;
},
getAudioEnd
()
{
if
(
!
this
.
data
.
guideEnd_audio_url
)
return
-
1
;
return
this
.
data
.
guideEnd_audio_url
},
getAudioReStart
()
{
if
(
!
this
.
data
.
guideRestart_audio_url
)
return
-
1
;
return
this
.
data
.
guideRestart_audio_url
},
//数据处理
//数据处理
resetQuestion
()
{
resetQuestion
()
{
for
(
var
i
in
this
.
data
.
question_arr
)
{
for
(
var
i
in
this
.
data
.
question_arr
)
{
...
@@ -149,21 +164,7 @@ LWD_3.data_mgr = {
...
@@ -149,21 +164,7 @@ LWD_3.data_mgr = {
loadEnd
()
{
loadEnd
()
{
//更新游戏界面信息
//更新游戏界面信息
LWD_3
.
game
.
inst
.
UpdataUi
();
LWD_3
.
game
.
inst
.
guideGame
();
clearInterval
(
this
.
timer
)
this
.
timer
=
setInterval
(()
=>
{
if
(
LWD_3
.
data_mgr
.
gameState
==
2
)
{
return
;
}
LWD_3
.
data_mgr
.
time
+=
1
;
if
(
LWD_3
.
data_mgr
.
time
>=
10
)
{
LWD_3
.
data_mgr
.
time
=
0
;
LWD_3
.
game
.
inst
.
hintPlay
();
}
},
1000
)
LWD_3
.
game
.
inst
.
_intervalIds
.
push
(
this
.
timer
);
LWD_3
.
game
.
inst
.
isLoadEnd
=
true
;
LWD_3
.
game
.
inst
.
isLoadEnd
=
true
;
},
},
}
}
\ No newline at end of file
assets/LWD_3/textures/bg_circle.png
0 → 100644
View file @
247ea653
7.02 KB
assets/LWD_3/textures/bg_circle.png.meta
0 → 100644
View file @
247ea653
{
"ver": "2.3.5",
"uuid": "405ffc19-1281-4e7b-94b4-d3e545448c7c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 409,
"height": 409,
"platformSettings": {},
"subMetas": {
"bg_circle": {
"ver": "1.0.4",
"uuid": "34014b86-5854-4b25-81a5-7f74c9241368",
"rawTextureUuid": "405ffc19-1281-4e7b-94b4-d3e545448c7c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 409,
"height": 409,
"rawWidth": 409,
"rawHeight": 409,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/LWD_3/textures/btn_restart.png
0 → 100644
View file @
247ea653
20.1 KB
assets/LWD_3/textures/btn_restart.png.meta
0 → 100644
View file @
247ea653
{
"ver": "2.3.5",
"uuid": "2d128bd0-c993-40d4-88bb-6272f67864e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 262,
"height": 268,
"platformSettings": {},
"subMetas": {
"btn_restart": {
"ver": "1.0.4",
"uuid": "2b74a4ab-b3be-4c0d-b986-b99ec48ea911",
"rawTextureUuid": "2d128bd0-c993-40d4-88bb-6272f67864e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 262,
"height": 268,
"rawWidth": 262,
"rawHeight": 268,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/LWD_3/textures/icon_hand.png
0 → 100644
View file @
247ea653
13.4 KB
assets/LWD_3/textures/icon_hand.png.meta
0 → 100644
View file @
247ea653
{
"ver": "2.3.5",
"uuid": "b928bd5f-c95f-4f22-ae3e-a3fa57b0c85f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 88,
"height": 185,
"platformSettings": {},
"subMetas": {
"icon_hand": {
"ver": "1.0.4",
"uuid": "5bb2bddc-57f4-49fc-9ab4-0d4583cb903b",
"rawTextureUuid": "b928bd5f-c95f-4f22-ae3e-a3fa57b0c85f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 88,
"height": 185,
"rawWidth": 88,
"rawHeight": 185,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
form/src/app/form/form.component.html
View file @
247ea653
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
style=
"padding: 10px;"
>
<div
style=
"padding: 10px;"
>
<span>
开始引导音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
guideBegin_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
guideBegin_audio_url
',
item
)"
></app-audio-recorder>
<span>
结束猫猫音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
guideEnd_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
guideEnd_audio_url
',
item
)"
></app-audio-recorder>
<span>
点击猫猫提示重新开始音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
guideRestart_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
guideRestart_audio_url
',
item
)"
></app-audio-recorder>
<div
style=
"display: flex 1;margin-bottom: 10px;margin-left: 10px;"
>
<div
style=
"display: flex 1;margin-bottom: 10px;margin-left: 10px;"
>
<span>
上传 ske_json 文件
</span><span>
:
</span>
<span>
上传 ske_json 文件
</span><span>
:
</span>
<nz-upload
nzAccept=
".json"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzShowUploadList
]="
false
"
<nz-upload
nzAccept=
".json"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzShowUploadList
]="
false
"
...
...
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