Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg18_tianci
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
dg18_tianci
Commits
c11f5126
Commit
c11f5126
authored
Dec 18, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成
parent
828ebdc3
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
269 additions
and
126 deletions
+269
-126
dg28_drag.fire
assets/dg18_danci/scene/dg28_drag.fire
+237
-123
dg28_drag.ts
assets/dg18_danci/scene/dg28_drag.ts
+32
-3
No files found.
assets/dg18_danci/scene/dg28_drag.fire
View file @
c11f5126
This diff is collapsed.
Click to expand it.
assets/dg18_danci/scene/dg28_drag.ts
View file @
c11f5126
...
@@ -56,7 +56,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -56,7 +56,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 初始化页面
// 初始化页面
initView
()
{
initView
()
{
this
.
img_dengdai
.
opacity
=
100
;
this
.
img_dengpao
.
opacity
=
100
;
}
}
// 事件监听
// 事件监听
initEvent
()
{
initEvent
()
{
...
@@ -76,7 +77,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -76,7 +77,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
item_battery_img
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
item_battery_img
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_left
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_left
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_right
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_right
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
ani_star
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_dengpao
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
img_dengdai
:
cc
.
Node
=
null
;
initCanvas
()
{
initCanvas
()
{
this
.
img_dengdai
.
opacity
=
100
;
this
.
img_dengpao
.
opacity
=
100
;
let
img
=
pg
.
view
.
find
(
this
.
layout_canvas
,
'
img
'
);
let
img
=
pg
.
view
.
find
(
this
.
layout_canvas
,
'
img
'
);
pg
.
view
.
setNetImg
(
img
,
this
.
currentQuestion
.
bgItem
.
url
,
{
w
:
1220
,
h
:
790
},
false
)
pg
.
view
.
setNetImg
(
img
,
this
.
currentQuestion
.
bgItem
.
url
,
{
w
:
1220
,
h
:
790
},
false
)
...
@@ -125,7 +132,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -125,7 +132,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
delayTime
=
1.5
;
let
delayTime
=
1.5
;
if
(
this
.
current
==
0
)
{
if
(
this
.
current
==
0
)
{
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
playLocalAudio
(
'
bettery
'
)
this
.
playLocalAudio
(
'
bettery
'
).
then
(()
=>
{
pg
.
audio
.
playLocalBgm
(
pg
.
view
.
find
(
this
,
'
res/audio/bgm
'
))
})
},
delayTime
)
},
delayTime
)
}
else
{
}
else
{
this
.
playLocalAudio
(
'
bettery
'
)
this
.
playLocalAudio
(
'
bettery
'
)
...
@@ -298,21 +307,41 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -298,21 +307,41 @@ export default class SceneComponent extends MyCocosSceneComponent {
onMeetSuccess
(
node
,
targetData
)
{
onMeetSuccess
(
node
,
targetData
)
{
this
.
playLocalAudio
(
'
right
'
)
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
node
.
x
=
targetData
.
pos
.
x
;
node
.
x
=
targetData
.
pos
.
x
;
node
.
y
=
targetData
.
pos
.
y
;
node
.
y
=
targetData
.
pos
.
y
;
pg
.
view
.
setColor
(
pg
.
view
.
find
(
node
,
'
text
'
),
'
#1D8B38
'
)
let
item
=
pg
.
view
.
clone
(
this
.
ani_star
);
node
.
addChild
(
item
);
item
.
x
=
-
15
;
item
.
y
=
-
15
;
item
.
active
=
true
;
pg
.
view
.
playDBAnimation
(
item
,
'
normal
'
,
1
)
node
.
parent
=
this
.
layout_items
;
node
.
parent
=
this
.
layout_items
;
// 处理完成就结束了
// 处理完成就结束了
this
.
successArr
.
push
(
targetData
);
this
.
successArr
.
push
(
targetData
);
// 处理完成
// 处理完成
if
(
this
.
successArr
.
length
==
this
.
currentQuestion
.
hotZoneItemArr
.
length
)
{
if
(
this
.
successArr
.
length
==
this
.
currentQuestion
.
hotZoneItemArr
.
length
)
{
cc
.
tween
(
this
.
img_dengdai
).
repeat
(
2
,
cc
.
tween
().
to
(
0.2
,
{
opacity
:
255
}).
to
(
0.2
,
{
opacity
:
50
})).
to
(
0.2
,
{
opacity
:
255
}).
start
();
cc
.
tween
(
this
.
img_dengpao
).
repeatForever
(
cc
.
tween
().
to
(
0.2
,
{
opacity
:
255
}).
to
(
0.2
,
{
opacity
:
50
})).
start
();
this
.
scheduleOnce
(()
=>
{
cc
.
Tween
.
stopAllByTarget
(
this
.
img_dengdai
)
cc
.
Tween
.
stopAllByTarget
(
this
.
img_dengpao
)
this
.
img_dengdai
.
opacity
=
100
;
this
.
img_dengpao
.
opacity
=
100
;
this
.
nextStage
();
this
.
nextStage
();
},
2
)
}
}
}
}
onMeetFail
(
node
)
{
onMeetFail
(
node
)
{
this
.
playLocalAudio
(
'
error
'
)
node
.
x
=
node
.
cPos
.
x
;
node
.
x
=
node
.
cPos
.
x
;
node
.
y
=
node
.
cPos
.
y
;
node
.
y
=
node
.
cPos
.
y
;
}
}
...
...
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