Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
comparetree
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
comparetree
Commits
a4336c82
Commit
a4336c82
authored
Jun 13, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正确动效
parent
b1c207ea
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
scene.js
play/assets/scene/scene/scene.js
+16
-16
right_ske.json
play/assets/scene/textures/ani/right_ske.json
+1
-1
right_tex.json
play/assets/scene/textures/ani/right_tex.json
+1
-1
right_tex.png
play/assets/scene/textures/ani/right_tex.png
+0
-0
right_tex.png.meta
play/assets/scene/textures/ani/right_tex.png.meta
+4
-4
No files found.
play/assets/scene/scene/scene.js
View file @
a4336c82
...
...
@@ -375,9 +375,11 @@ cc.Class({
break
;
}
},
move
Item
(
item
,
pos
)
{
back
Item
(
item
,
pos
)
{
item
.
x
=
pos
.
x
;
item
.
y
=
pos
.
y
;
item
.
moveState
=
0
;
this
.
updateItem
(
item
);
},
initButton
(
item
)
{
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onStartItem
,
this
);
...
...
@@ -390,11 +392,6 @@ cc.Class({
if
(
item
.
moveState
==
2
)
return
;
//判断是否是在原地并没有到处移动
this
.
_startPos
=
cc
.
v2
(
touch
.
target
.
x
,
touch
.
target
.
y
);
//有点击行为不进行位移
// let touchPos = touch.getLocation();
// touch.target.x = touchPos.x - 1280 / 2;
// touch.target.y = touchPos.y - 720 / 2;
},
//1.移动效果--在节点上绑定一个运动的type 根据type来刷新按钮效果 刷新type的方法,和具体的执行的时候刷新type
//2.成功效果--
...
...
@@ -414,7 +411,7 @@ cc.Class({
height
:
50
,
//item.height
}))
{
//回归原位
this
.
move
Item
(
item
,
this
.
_startPos
);
this
.
back
Item
(
item
,
this
.
_startPos
);
//变换动画
ani
.
flipX0
(
item
).
then
(()
=>
{
item
.
cardState
=
item
.
cardState
==
0
?
1
:
0
;
...
...
@@ -429,21 +426,24 @@ cc.Class({
//成功 失败的判断 根据id
let
successed
=
box
.
data
.
child
.
some
(
dt
=>
dt
.
cardId
==
item
.
data
.
cardId
);
if
(
successed
)
{
item
.
moveState
=
2
;
this
.
updateItem
(
item
);
box
.
data
.
success
.
push
(
item
);
this
.
setSuccessItemPos
(
box
,
item
);
//检测是否全部完成
this
.
createRightAni
(
cc
.
v2
(
item
.
x
,
item
.
y
));
setTimeout
(()
=>
{
//检测是否全部完成
item
.
moveState
=
2
;
this
.
updateItem
(
item
);
box
.
data
.
success
.
push
(
item
);
this
.
setSuccessItemPos
(
box
,
item
);
},
300
);
}
else
{
item
.
moveState
=
3
;
this
.
updateItem
(
item
);
//
//
碰撞失败退回原位置
//碰撞失败退回原位置
setTimeout
(()
=>
{
this
.
move
Item
(
item
,
this
.
_startPos
);
},
1
00
);
this
.
back
Item
(
item
,
this
.
_startPos
);
},
3
00
);
}
}
else
{
this
.
move
Item
(
item
,
this
.
_startPos
);
this
.
back
Item
(
item
,
this
.
_startPos
);
}
},
onMoveItem
(
touch
)
{
...
...
play/assets/scene/textures/ani/right_ske.json
View file @
a4336c82
This diff is collapsed.
Click to expand it.
play/assets/scene/textures/ani/right_tex.json
View file @
a4336c82
{
"name"
:
"right"
,
"imagePath"
:
"right_tex.png"
,
"SubTexture"
:[{
"name"
:
"1/圆"
,
"x"
:
1
,
"height"
:
98
,
"y"
:
1
,
"width"
:
98
},{
"name"
:
"1/星1"
,
"x"
:
66
,
"height"
:
59
,
"y"
:
172
,
"width"
:
57
},{
"name"
:
"1/星2"
,
"x"
:
71
,
"height"
:
45
,
"y"
:
101
,
"width"
:
43
},{
"name"
:
"1/星3"
,
"x"
:
1
,
"height"
:
64
,
"y"
:
172
,
"width"
:
63
},{
"name"
:
"1/星4"
,
"x"
:
183
,
"height"
:
45
,
"y"
:
172
,
"width"
:
45
},{
"name"
:
"1/星6"
,
"x"
:
1
,
"height"
:
69
,
"y"
:
101
,
"width"
:
68
},{
"name"
:
"1/星7"
,
"x"
:
116
,
"height"
:
40
,
"y"
:
101
,
"width"
:
37
},{
"name"
:
"1/星5"
,
"x"
:
125
,
"height"
:
57
,
"y"
:
172
,
"width"
:
56
},{
"name"
:
"1/星8"
,
"x"
:
183
,
"height"
:
33
,
"y"
:
219
,
"width"
:
32
},{
"name"
:
"1/星9"
,
"x"
:
155
,
"height"
:
37
,
"y"
:
101
,
"width"
:
36
}],
"height"
:
256
,
"width"
:
256
}
\ No newline at end of file
{
"name"
:
"right"
,
"SubTexture"
:[{
"name"
:
"1/勾"
,
"x"
:
1
,
"height"
:
112
,
"y"
:
1
,
"width"
:
128
},{
"name"
:
"1/星1"
,
"x"
:
196
,
"height"
:
59
,
"y"
:
72
,
"width"
:
57
},{
"name"
:
"1/星2"
,
"x"
:
1
,
"height"
:
45
,
"y"
:
192
,
"width"
:
43
},{
"name"
:
"1/星3"
,
"x"
:
131
,
"height"
:
64
,
"y"
:
72
,
"width"
:
63
},{
"name"
:
"1/星4"
,
"x"
:
201
,
"height"
:
45
,
"y"
:
1
,
"width"
:
45
},{
"name"
:
"1/星6"
,
"x"
:
131
,
"height"
:
69
,
"y"
:
1
,
"width"
:
68
},{
"name"
:
"1/星7"
,
"x"
:
1
,
"height"
:
40
,
"y"
:
115
,
"width"
:
37
},{
"name"
:
"1/星5"
,
"x"
:
196
,
"height"
:
57
,
"y"
:
133
,
"width"
:
56
},{
"name"
:
"1/星8"
,
"x"
:
78
,
"height"
:
33
,
"y"
:
115
,
"width"
:
32
},{
"name"
:
"1/星9"
,
"x"
:
40
,
"height"
:
37
,
"y"
:
115
,
"width"
:
36
}],
"imagePath"
:
"right_tex.png"
,
"height"
:
256
,
"width"
:
256
}
\ No newline at end of file
play/assets/scene/textures/ani/right_tex.png
View replaced file @
b1c207ea
View file @
a4336c82
37.5 KB
|
W:
|
H:
39.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
play/assets/scene/textures/ani/right_tex.png.meta
View file @
a4336c82
...
...
@@ -18,12 +18,12 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1
3.5
,
"offsetY":
1.5
,
"offsetX": -1,
"offsetY":
9
,
"trimX": 1,
"trimY": 1,
"width": 2
27
,
"height": 2
51
,
"width": 2
52
,
"height": 2
36
,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 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