Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_dds
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
dfzx_cocos_dds
Commits
4749dfda
Commit
4749dfda
authored
Mar 16, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: savearea插件失败
parent
2f224257
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
42 deletions
+62
-42
et_13.fire
play/assets/et_13/scene/et_13.fire
+9
-9
et_13.js
play/assets/et_13/script/et_13.js
+51
-31
util.js
play/assets/et_13/script/util.js
+2
-2
No files found.
play/assets/et_13/scene/et_13.fire
View file @
4749dfda
...
...
@@ -572,8 +572,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
5
8
7,
-
30
4,
5
4
7,
-
26
4,
0,
0,
0,
...
...
@@ -616,7 +616,7 @@
"__uuid__": "ba7e8674-648a-49ee-9f6f-2903e1beac33"
},
"_type": 0,
"_sizeMode":
1
,
"_sizeMode":
0
,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
...
...
@@ -659,10 +659,10 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left":
0
,
"_right":
1
0,
"_top":
0
,
"_bottom":
1
0,
"_left":
1189
,
"_right":
5
0,
"_top":
623
,
"_bottom":
5
0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
...
...
@@ -671,8 +671,8 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth":
0
,
"_originalHeight":
0
,
"_originalWidth":
86
,
"_originalHeight":
92
,
"_id": "ddgxKrZeRCD5yonPhJlnTQ"
},
{
...
...
play/assets/et_13/script/et_13.js
View file @
4749dfda
// import { getSprNode } from "./util";
import
{
getSprNode
,
playAudioByUrl
,
randomSortByArr
,
playAudio
,
showTrebleFirework
,
RandomInt
,
asyncDelay
}
from
"
./util
"
;
import
{
getSprNode
,
playAudioByUrl
,
randomSortByArr
,
playAudio
,
showTrebleFirework
,
RandomInt
,
asyncDelay
,
exchangeNodePos
}
from
"
./util
"
;
cc
.
Class
({
extends
:
cc
.
Component
,
...
...
@@ -255,7 +255,7 @@ cc.Class({
this
.
bigStarArr
=
[];
let
baseX
=
this
.
canvas
.
width
/
2
-
5
0
*
this
.
_mapScaleMin
;
let
baseX
=
this
.
canvas
.
width
/
2
-
8
0
*
this
.
_mapScaleMin
;
let
baseY
=
this
.
canvas
.
height
/
2
-
80
*
this
.
_mapScaleMin
;
let
disH
=
80
*
this
.
_mapScaleMin
;
for
(
let
i
=
0
;
i
<
gArr
.
length
;
i
++
)
{
...
...
@@ -270,8 +270,8 @@ cc.Class({
starBg
.
star
=
starTop
;
const
starBig
=
getSprNode
(
'
icon_bigstar
'
);
star
Bg
.
addChild
(
starBig
);
starBig
.
a
ctive
=
false
;
star
Top
.
addChild
(
starBig
);
starBig
.
a
ngle
=
-
90
;
starBg
.
starBig
=
starBig
;
this
.
bigStarArr
.
push
(
starBg
);
...
...
@@ -324,6 +324,7 @@ cc.Class({
showSoundBtn
()
{
const
btn
=
cc
.
find
(
'
Canvas/btn_laba
'
)
btn
.
scale
=
this
.
_mapScaleMin
;
btn
.
zIndex
=
1
;
},
startBtnClicked
()
{
...
...
@@ -622,47 +623,66 @@ cc.Class({
}
const
bigStarBg
=
this
.
bigStarArr
[
this
.
groupIndex
];
const
starBig
=
bigStarBg
.
starBig
;
const
star
=
bigStarBg
.
star
;
star
.
active
=
true
;
star
.
opacity
=
0
;
star
.
scale
=
1
;
star
.
angle
=
0
;
const
starBig
=
bigStarBg
.
starBig
;
starBig
.
active
=
true
;
starBig
.
scale
=
1
;
starBig
.
angle
=
-
90
;
star
.
scaleX
=
0.7
;
star
.
angle
=
90
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
star
.
parent
.
convertToNodeSpaceAR
(
canvas
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
-
canvas
.
height
/
2
)));
starBig
.
x
=
startPos
.
x
;
starBig
.
y
=
startPos
.
y
;
const
startPos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
const
middlePos
=
exchangeNodePos
(
star
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
4
));
star
.
x
=
startPos
.
x
;
star
.
y
=
startPos
.
y
;
star
.
y
=
startPos
.
y
-
starBig
.
height
;
console
.
log
(
'
middlePos =
'
+
JSON
.
stringify
(
middlePos
));
const
time
=
1
;
cc
.
tween
(
star
)
.
to
(
time
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
,
scaleY
:
0.8
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
,
scaleY
:
1
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
})
.
start
();
cc
.
tween
(
star
)
.
to
(
time
,
{
angle
:
-
720
})
.
delay
(
0.6
)
.
to
(
0.8
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
star
)
.
to
(
time
,
{
y
:
0
,
scale
:
1
,
opacity
:
255
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.6
)
.
to
(
0.8
,
{
y
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
cc
.
tween
(
starBig
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
this
.
checkGameEnd
();
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
angle
:
-
720
-
90
})
.
start
();
cc
.
tween
(
starBig
)
.
to
(
time
,
{
y
:
0
,
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
// cc.tween(star)
// .to(time, { x: 0 }, { easing: 'quadIn' })
// .start();
// cc.tween(star)
// .to(time, { angle: -720 })
// .start();
// cc.tween(star)
// .to(time, { y: 0, scale: 1, opacity: 255 }, { easing: 'quadOut' })
// .call(() => {
// this.checkGameEnd();
// })
// .start();
// cc.tween(starBig)
// .to(time, { x: 0 }, { easing: 'quadIn' })
// .start();
// cc.tween(starBig)
// .to(time, { angle: -720 - 90 })
// .start();
// cc.tween(starBig)
// .to(time, { y: 0, scale: 0 }, { easing: 'quadOut' })
// .start();
playAudio
(
this
.
bigStarClip
);
},
...
...
@@ -679,8 +699,8 @@ cc.Class({
await
asyncDelay
(
1
);
this
.
initCurGroup
();
this
.
showQuestion
(()
=>
{
this
.
showQuestion
(()
=>
{
this
.
showOnePenguin
();
});
},
...
...
play/assets/et_13/script/util.js
View file @
4749dfda
...
...
@@ -42,8 +42,8 @@ export function getAngleByPos(px, py, mx, my) {
}
export
function
exchangeNodePos
(
baseNode
,
targetNode
)
{
return
baseNode
.
convertToNodeSpaceAR
(
targetNode
.
_parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
targetNode
.
x
,
targetNode
.
y
)));
export
function
exchangeNodePos
(
targetNode
,
baseNode
,
basePos
)
{
return
targetNode
.
convertToNodeSpaceAR
(
baseNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
basePos
.
x
,
basePos
.
y
)));
}
export
function
RandomInt
(
a
,
b
=
0
)
{
...
...
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