Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg09_jq
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
dg09_jq
Commits
c5b1bac9
Commit
c5b1bac9
authored
Oct 12, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
10.12调整
parent
3c4bf285
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
868 additions
and
694 deletions
+868
-694
wancheng.mp3
assets/dg09_jq/audios/wancheng.mp3
+0
-0
wancheng.mp3.meta
assets/dg09_jq/audios/wancheng.mp3.meta
+7
-0
dg09_jq.fire
assets/dg09_jq/scene/dg09_jq.fire
+771
-687
dg09_jq.ts
assets/dg09_jq/scene/dg09_jq.ts
+90
-7
No files found.
assets/dg09_jq/audios/wancheng.mp3
0 → 100644
View file @
c5b1bac9
File added
assets/dg09_jq/audios/wancheng.mp3.meta
0 → 100644
View file @
c5b1bac9
{
"ver": "2.0.1",
"uuid": "a8f3aec7-9102-4431-acd8-31cd12bccd96",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
assets/dg09_jq/scene/dg09_jq.fire
View file @
c5b1bac9
This diff is collapsed.
Click to expand it.
assets/dg09_jq/scene/dg09_jq.ts
View file @
c5b1bac9
...
...
@@ -86,6 +86,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
tryData
:
Array
<
Option
>
;
private
timeSecond
;
private
assessCount
;
private
isClick
=
true
;
initData
()
{
Game
.
getIns
().
init
(
this
.
data
);
Game
.
getIns
().
reset
();
...
...
@@ -94,6 +95,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
startSecond
=
false
;
this
.
timeSecond
=
0
;
this
.
assessCount
=
0
;
this
.
isClick
=
true
;
}
private
layout_start
:
cc
.
Node
;
private
audioId
:
any
;
...
...
@@ -198,16 +200,33 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
c_d
=
data
.
wordArr
[
idx
];
if
(
!
c_d
)
ch
.
active
=
false
;
this
.
initCloudItem
(
ch
,
c_d
);
this
.
floatAction
(
ch
);
let
iData
:
any
=
{};
iData
.
x
=
ch
.
x
;
iData
.
y
=
ch
.
y
;
ch
.
data
=
iData
;
this
.
floatForeverAction
(
ch
);
});
layout_bridge
.
children
.
forEach
((
item
,
idx
)
=>
{
let
c_d
=
data
.
wordArr
[
idx
];
if
(
!
c_d
)
item
.
active
=
false
;
let
iData
:
any
=
{};
iData
.
x
=
item
.
x
;
iData
.
y
=
item
.
y
;
item
.
data
=
iData
;
let
word
=
cc
.
find
(
"
word
"
,
item
);
word
.
getComponent
(
cc
.
Label
).
string
=
""
;
word
.
getComponent
(
cc
.
Label
).
string
=
c_d
;
word
.
active
=
false
;
this
.
wordItams
.
push
(
item
);
let
bData
:
any
=
{};
bData
.
text
=
c_d
;
bData
.
parent
=
word
.
parent
;
bData
.
startPos
=
word
.
getPosition
();
word
.
data
=
bData
;
word
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onBridgeStart
,
this
);
word
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onBridgeMove
,
this
);
word
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onBridgeEnd
,
this
);
});
this
.
isClick
=
true
;
}
private
initCloudItem
(
item
,
text
)
{
let
word
=
cc
.
find
(
"
word
"
,
item
);
...
...
@@ -264,6 +283,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
onItemTouchStart
(
e
)
{
if
(
!
this
.
isClick
)
return
;
if
(
e
.
target
.
getComponent
(
cc
.
Label
).
string
==
""
)
return
;
this
.
playLocalAudio
(
"
takeout
"
);
// if (this.checkRoundOver()) return;
let
target
:
cc
.
Node
=
e
.
target
;
...
...
@@ -276,6 +297,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
setTouchPos
(
e
);
}
onItemTouchMove
(
e
)
{
if
(
!
this
.
isClick
)
return
;
// if (this.checkRoundOver()) return;
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
...
...
@@ -283,6 +305,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
setTouchPos
(
e
);
}
onItemTouchEnd
(
e
)
{
if
(
!
this
.
isClick
)
return
;
// if (this.checkRoundOver()) return;
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
...
...
@@ -290,7 +313,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// let dis = this.getDistances(target.getPosition(), bg.getPosition());
let
dis
=
this
.
getDistances
(
target
,
bg
);
// if (dis < 100 && bg.sortId == data.id) {
if
(
dis
<
bg
.
width
/
2
&&
!
cc
.
find
(
"
word
"
,
bg
).
active
)
{
if
(
dis
<
bg
.
width
/
2
&&
!
cc
.
find
(
"
word
"
,
bg
).
active
&&
bg
.
active
)
{
return
bg
;
}
return
null
;
...
...
@@ -299,12 +322,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
target
.
setPosition
(
data
.
startPos
);
target
.
active
=
false
;
if
(
!
itemBg
)
return
target
.
active
=
true
;
if
(
!
itemBg
)
{
target
.
active
=
true
;
this
.
floatForeverAction
(
target
.
parent
);
return
}
this
.
floatAction
(
itemBg
);
let
word
=
cc
.
find
(
"
word
"
,
itemBg
);
word
.
active
=
true
;
word
.
getComponent
(
cc
.
Label
).
string
=
data
.
text
;
// word.getComponent(cc.Label).string = data.text;
word
.
data
.
CParent
=
data
.
parent
;
this
.
playLocalAudio
(
"
move
"
)
if
(
this
.
checkRoundOver
())
{
...
...
@@ -328,6 +356,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
Game
.
getIns
().
failCount
++
;
this
.
isClick
=
false
;
this
.
playLocalAudio
(
"
error
"
).
then
(()
=>
{
this
.
showQuestion
();
});
...
...
@@ -336,6 +365,46 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private
onBridgeStart
(
e
)
{
if
(
!
this
.
isClick
)
return
;
let
target
:
cc
.
Node
=
e
.
target
;
this
.
floatAction
(
target
.
parent
);
target
.
parent
=
this
.
node
;
this
.
setTouchPos
(
e
);
}
private
onBridgeMove
(
e
)
{
if
(
!
this
.
isClick
)
return
;
let
target
:
cc
.
Node
=
e
.
target
;
this
.
setTouchPos
(
e
);
}
private
onBridgeEnd
(
e
)
{
if
(
!
this
.
isClick
)
return
;
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
let
itemBg
=
this
.
wordItams
.
find
((
bg
)
=>
{
// let dis = this.getDistances(target.getPosition(), bg.getPosition());
let
dis
=
this
.
getDistances
(
target
,
bg
);
// if (dis < 100 && bg.sortId == data.id) {
if
(
dis
>
bg
.
width
)
{
return
bg
;
}
return
null
;
})
target
.
parent
=
data
.
parent
;
target
.
setPosition
(
data
.
startPos
);
if
(
!
itemBg
)
return
;
target
.
active
=
false
;
let
cloud
=
data
.
CParent
;
if
(
cloud
)
{
this
.
floatForeverAction
(
cloud
);
let
word
=
cc
.
find
(
"
word
"
,
cloud
);
if
(
word
)
{
word
.
active
=
true
;
// word.getComponent(cc.Label).string = data.text;
}
}
}
private
checkRoundOver
()
{
let
count
=
0
;
...
...
@@ -360,9 +429,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
floatAction
(
target
)
{
cc
.
Tween
.
stopAllByTarget
(
target
);
cc
.
tween
(
target
).
by
(
0.15
,
{
y
:
-
20
}).
by
(
0.3
,
{
y
:
20
}).
start
();
let
data
=
target
.
data
;
target
.
x
=
data
.
x
;
target
.
y
=
data
.
y
;
let
y1
=
target
.
y
-
20
;
let
y2
=
target
.
y
;
cc
.
tween
(
target
).
to
(
0.15
,
{
y
:
y1
}).
to
(
0.3
,
{
y
:
y2
}).
start
();
}
private
floatForeverAction
(
target
)
{
cc
.
Tween
.
stopAllByTarget
(
target
);
let
data
=
target
.
data
;
target
.
x
=
data
.
x
;
target
.
y
=
data
.
y
;
let
y1
=
target
.
y
-
10
;
let
y2
=
target
.
y
;
cc
.
tween
(
target
).
repeatForever
(
cc
.
tween
().
to
(
0.5
+
Math
.
random
()
*
1.5
,
{
y
:
y1
}).
to
(
0.5
+
Math
.
random
()
*
1.5
,
{
y
:
y2
})).
start
();
}
...
...
@@ -480,7 +563,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
private
showFind
()
{
// this.playLocalAudio("complete
");
this
.
playLocalAudio
(
"
wancheng
"
);
this
.
startSecond
=
false
;
this
.
layout_final
.
scale
=
0.3
;
this
.
layout_final
.
active
=
true
;
...
...
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