Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ET04
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
ET04
Commits
453dbde7
Commit
453dbde7
authored
Feb 25, 2021
by
wangxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
碰撞
parent
b1ab6400
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
74 additions
and
9 deletions
+74
-9
结束welldone.mp3
play/assets/tmpGame/audios/结束welldone.mp3
+0
-0
结束welldone.mp3.meta
play/assets/tmpGame/audios/结束welldone.mp3.meta
+8
-0
进入课件提示音.mp3
play/assets/tmpGame/audios/进入课件提示音.mp3
+0
-0
进入课件提示音.mp3.meta
play/assets/tmpGame/audios/进入课件提示音.mp3.meta
+8
-0
选择正确.mp3
play/assets/tmpGame/audios/选择正确.mp3
+0
-0
选择正确.mp3.meta
play/assets/tmpGame/audios/选择正确.mp3.meta
+8
-0
选择错误啊哦.mp3
play/assets/tmpGame/audios/选择错误啊哦.mp3
+0
-0
选择错误啊哦.mp3.meta
play/assets/tmpGame/audios/选择错误啊哦.mp3.meta
+8
-0
Scene.fire
play/assets/tmpGame/scene/Scene.fire
+14
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+14
-1
op_pic.js
play/assets/tmpGame/script/op_pic.js
+14
-8
No files found.
play/assets/tmpGame/audios/结束welldone.mp3
0 → 100755
View file @
453dbde7
File added
play/assets/tmpGame/audios/结束welldone.mp3.meta
0 → 100644
View file @
453dbde7
{
"ver": "2.0.1",
"uuid": "f7ba93b1-0719-40f3-8482-0d5d94a2fb8f",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/audios/进入课件提示音.mp3
0 → 100755
View file @
453dbde7
File added
play/assets/tmpGame/audios/进入课件提示音.mp3.meta
0 → 100644
View file @
453dbde7
{
"ver": "2.0.1",
"uuid": "684d7cb6-2589-4ca9-97e4-4fee3d611cdc",
"downloadMode": 0,
"duration": 1.854694,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/audios/选择正确.mp3
0 → 100755
View file @
453dbde7
File added
play/assets/tmpGame/audios/选择正确.mp3.meta
0 → 100644
View file @
453dbde7
{
"ver": "2.0.1",
"uuid": "5060d073-9761-4a5c-8910-5439b56725bf",
"downloadMode": 0,
"duration": 2.324917,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/audios/选择错误啊哦.mp3
0 → 100755
View file @
453dbde7
File added
play/assets/tmpGame/audios/选择错误啊哦.mp3.meta
0 → 100644
View file @
453dbde7
{
"ver": "2.0.1",
"uuid": "c271a59a-d4e5-453e-8e2e-5b97fa3e4b43",
"downloadMode": 0,
"duration": 0.556563,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/scene/Scene.fire
View file @
453dbde7
...
...
@@ -1426,6 +1426,20 @@
"op_pic": {
"__uuid__": "b74714cb-b4ed-49a6-9955-c21a7c47db01"
},
"sounds": [
{
"__uuid__": "684d7cb6-2589-4ca9-97e4-4fee3d611cdc"
},
{
"__uuid__": "5060d073-9761-4a5c-8910-5439b56725bf"
},
{
"__uuid__": "c271a59a-d4e5-453e-8e2e-5b97fa3e4b43"
},
{
"__uuid__": "f7ba93b1-0719-40f3-8482-0d5d94a2fb8f"
}
],
"_id": "e687yyoRBIzZAOVRL8Sseh"
}
]
\ No newline at end of file
play/assets/tmpGame/script/Scene.js
View file @
453dbde7
...
...
@@ -35,6 +35,12 @@ cc.Class({
default
:
null
,
type
:
cc
.
Prefab
,
},
// 声音,0-进入,1-正确,2-错误,3-结束
sounds
:
{
default
:
[],
type
:
[
cc
.
AudioClip
],
},
},
// 生命周期 onLoad
...
...
@@ -191,9 +197,11 @@ cc.Class({
}
var
self
=
this
;
sch
duleOnce
(
function
()
{
this
.
node
.
sche
duleOnce
(
function
()
{
self
.
pic_container
.
getComponent
(
cc
.
Layout
).
enabled
=
false
;
},
0.5
);
this
.
playSound
(
0
);
},
initBg
()
{
...
...
@@ -283,5 +291,10 @@ cc.Class({
}
},
// 播放声音
playSound
(
index
)
{
cc
.
audioEngine
.
playEffect
(
this
.
sounds
[
index
],
false
);
},
// ------------------------------------------
});
play/assets/tmpGame/script/op_pic.js
View file @
453dbde7
...
...
@@ -14,7 +14,9 @@ cc.Class({
_opId
:
0
,
// 选项id
_ori_pos
:
null
,
// 初始位置
_isEnter
:
false
,
// 是否碰到上面的选项框
_isEnter
:
false
,
// 是否碰到对的选框
_isContact
:
false
,
// 是否碰到了选项框
_soundOp
:
null
,
// 碰到的选框
},
onLoad
()
{
...
...
@@ -69,10 +71,14 @@ cc.Class({
},
onTouchEnd
()
{
this
.
nodePos
=
this
.
node
.
getPosition
();
//获取触摸结束之后的node坐标;
if
(
this
.
_isContact
)
{
this
.
node
.
setPosition
();
if
(
this
.
_isEnter
)
{
console
.
log
(
"
enter right
"
);
}
else
{
console
.
log
(
"
enter right
"
);
console
.
log
(
"
enter false
"
);
}
}
else
{
this
.
node
.
setPosition
(
this
.
_ori_pos
);
}
},
...
...
@@ -84,6 +90,8 @@ cc.Class({
*/
onCollisionEnter
:
function
(
other
,
self
)
{
console
.
log
(
"
on collision
"
);
this
.
_soundOp
=
other
;
this
.
_isContact
=
true
;
if
(
other
.
getComponent
(
"
op_sound
"
).
_opId
==
this
.
_opId
)
{
this
.
_isEnter
=
true
;
}
...
...
@@ -97,9 +105,7 @@ cc.Class({
onCollisionExit
:
function
(
other
,
self
)
{
console
.
log
(
"
on collision exit
"
);
this
.
_isEnter
=
false
;
},
resetPos
()
{
// cc.tween(this.node).to()
this
.
_isContact
=
false
;
this
.
_soundOp
=
null
;
},
});
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