Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn09_xuanze
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
sn09_xuanze
Commits
3f440434
Commit
3f440434
authored
Oct 29, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理快速点击
parent
878a08e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
sn09_xuanze.ts
assets/sn09_xuanze/scene/sn09_xuanze.ts
+10
-2
No files found.
assets/sn09_xuanze/scene/sn09_xuanze.ts
View file @
3f440434
...
@@ -60,6 +60,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -60,6 +60,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
private
audioId
:
any
;
private
audioId
:
any
;
onTouchVoice
()
{
onTouchVoice
()
{
if
(
this
.
isEnding
)
return
;
if
(
!
this
.
canTouch
)
return
;
if
(
!
this
.
canTouch
)
return
;
if
(
this
.
audioId
)
{
if
(
this
.
audioId
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
audioId
);
cc
.
audioEngine
.
stopEffect
(
this
.
audioId
);
...
@@ -105,7 +106,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -105,7 +106,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
}
}
private
isEnding
:
boolean
;
gameOver
()
{
gameOver
()
{
this
.
isEnding
=
true
;
this
.
sendData
(
this
.
data
.
questions
.
length
*
3
).
then
(()
=>
{
this
.
sendData
(
this
.
data
.
questions
.
length
*
3
).
then
(()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
this
.
data
.
questions
.
length
*
3
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
saveGolds
(
this
.
data
.
questions
.
length
*
3
);
// 保存金币数量;num 是获得金币的数量,数字类型;
...
@@ -237,6 +240,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -237,6 +240,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 点击泡泡
// 点击泡泡
touchPaoPao
(
e
:
any
)
{
touchPaoPao
(
e
:
any
)
{
if
(
this
.
isEnding
)
return
;
if
(
!
this
.
canTouch
)
return
;
if
(
!
this
.
canTouch
)
return
;
this
.
canTouch
=
false
;
this
.
canTouch
=
false
;
// 如果泡泡没有到指定位置不允许点击
// 如果泡泡没有到指定位置不允许点击
...
@@ -263,7 +267,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -263,7 +267,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
children
.
forEach
((
node
,
i
)
=>
{
children
.
forEach
((
node
,
i
)
=>
{
if
(
this
.
rightList
.
some
(
dt
=>
node
.
data
.
id
==
dt
.
id
))
return
;
if
(
this
.
rightList
.
some
(
dt
=>
node
.
data
.
id
==
dt
.
id
))
return
;
cc
.
Tween
.
stopAllByTarget
(
node
);
cc
.
Tween
.
stopAllByTarget
(
node
);
cc
.
tween
(
node
).
by
(
0.5
+
(
i
/
children
.
length
)
*
0.5
,
{
y
:
-
1500
}).
start
();
cc
.
tween
(
node
).
by
(
0.5
+
(
i
/
children
.
length
)
*
0.5
,
{
y
:
-
1500
}).
call
(()
=>
{
node
.
active
=
false
;
}).
start
();
})
})
}
}
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
...
@@ -287,7 +293,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -287,7 +293,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
visible
(
bubble
,
true
)
pg
.
view
.
visible
(
bubble
,
true
)
pg
.
view
.
visible
(
broken
,
false
)
pg
.
view
.
visible
(
broken
,
false
)
this
.
repeatFly
(
item
);
this
.
repeatFly
(
item
);
this
.
scheduleOnce
(()
=>
{
this
.
canTouch
=
true
;
this
.
canTouch
=
true
;
},
0.1
)
})
})
}
}
}
}
...
...
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