Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
崔立强
db-game-template
Commits
eeaddacf
Commit
eeaddacf
authored
Dec 27, 2019
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0b717c2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
workspace.xml
.idea/workspace.xml
+1
-1
Crop.ts
egret/src/Scenes/MainScene/Objs/Crop.ts
+20
-21
No files found.
.idea/workspace.xml
View file @
eeaddacf
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<option
name=
"presentableId"
value=
"Default"
/>
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1577324647364
</updated>
<updated>
1577324647364
</updated>
<workItem
from=
"1577324653437"
duration=
"32303000"
/>
<workItem
from=
"1577324653437"
duration=
"32303000"
/>
<workItem
from=
"1577410840738"
duration=
"
3763
000"
/>
<workItem
from=
"1577410840738"
duration=
"
4120
000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
egret/src/Scenes/MainScene/Objs/Crop.ts
View file @
eeaddacf
...
@@ -429,44 +429,43 @@ export default class Crop extends eui.Component {
...
@@ -429,44 +429,43 @@ export default class Crop extends eui.Component {
}
}
this
.
cropMv
&&
this
.
removeChild
(
this
.
cropMv
)
&&
(
this
.
cropMv
=
null
);
this
.
cropMv
&&
this
.
removeChild
(
this
.
cropMv
)
&&
(
this
.
cropMv
=
null
);
this
.
optionMv
&&
this
.
removeChild
(
this
.
optionMv
)
&&
(
this
.
optionMv
=
null
);
this
.
optionMv
&&
this
.
removeChild
(
this
.
optionMv
)
&&
(
this
.
optionMv
=
null
);
let
_n
ame
=
''
;
let
upN
ame
=
''
;
if
((
petData
[
this
.
petId
].
type
==
'plant'
&&
this
.
state
==
3
)
if
((
petData
[
this
.
petId
].
type
==
'plant'
&&
this
.
state
==
3
)
||
(
petData
[
this
.
petId
].
type
==
'animal'
&&
this
.
state
==
4
)
||
(
petData
[
this
.
petId
].
type
==
'animal'
&&
this
.
state
==
4
)
||
this
.
data
.
data
.
canGather
)
{
||
this
.
data
.
data
.
canGather
)
{
_n
ame
=
'up2'
;
upN
ame
=
'up2'
;
}
else
{
}
else
{
_n
ame
=
'up1'
;
upN
ame
=
'up1'
;
}
}
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
let
mvId
=
(
this
.
state
==
1
)
?
this
.
state
:
this
.
state
-
1
;
let
mvId
=
(
this
.
state
==
1
)
?
this
.
state
:
this
.
state
-
1
;
// console.log(this.data.data.canGather);
// console.log(this.data.data.canGather);
(
this
.
data
.
data
.
canGather
)
?
mvId
=
(
petData
[
this
.
petId
].
type
==
'animal'
?
4
:
3
)
:
mvId
;
(
this
.
data
.
data
.
canGather
)
?
mvId
=
(
petData
[
this
.
petId
].
type
==
'animal'
?
4
:
3
)
:
mvId
;
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
loadSvga
(
getSvga
(
_n
ame
)).
then
(
// 加载升级动画
loadSvga
(
getSvga
(
upN
ame
)).
then
(
// 加载升级动画
(
__m
v
:
egret
.
MovieClip
)
=>
{
(
upM
v
:
egret
.
MovieClip
)
=>
{
loadSvga
(
getSvga
(
`
${
petData
[
this
.
petId
].
key
}${
mvId
}
_birth`
)).
then
(
// 加载出生动画
loadSvga
(
getSvga
(
`
${
petData
[
this
.
petId
].
key
}${
mvId
}
_birth`
)).
then
(
// 加载出生动画
(
_m
v
:
egret
.
MovieClip
)
=>
{
(
birthM
v
:
egret
.
MovieClip
)
=>
{
__m
v
.
gotoAndPlay
(
1
,
1
);
upM
v
.
gotoAndPlay
(
1
,
1
);
__mv
.
x
=
(
_n
ame
==
'up2'
)
?
0
:
10
;
upMv
.
x
=
(
upN
ame
==
'up2'
)
?
0
:
10
;
__mv
.
y
=
(
_n
ame
==
'up2'
)
?
-
35
:
20
;
upMv
.
y
=
(
upN
ame
==
'up2'
)
?
-
35
:
20
;
this
.
addChild
(
__m
v
);
this
.
addChild
(
upM
v
);
__m
v
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
upM
v
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
this
.
removeChild
(
__m
v
);
this
.
removeChild
(
upM
v
);
},
this
);
},
this
);
this
.
addChild
(
_m
v
);
this
.
addChild
(
birthM
v
);
let
pos
=
(
mvId
==
3
&&
this
.
petId
==
4
)
?
petData
[
this
.
petId
][
'catherPos'
]
:
petData
[
this
.
petId
][
'pos'
];
let
pos
=
(
mvId
==
3
&&
this
.
petId
==
4
)
?
petData
[
this
.
petId
][
'catherPos'
]
:
petData
[
this
.
petId
][
'pos'
];
_m
v
.
x
=
pos
[
0
];
birthM
v
.
x
=
pos
[
0
];
_m
v
.
y
=
pos
[
1
];
birthM
v
.
y
=
pos
[
1
];
_m
v
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
birthM
v
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
_m
v
.
stop
();
birthM
v
.
stop
();
let
name
=
`
${
petData
[
this
.
petId
].
key
}${
mvId
}
`
;
let
name
=
`
${
petData
[
this
.
petId
].
key
}${
mvId
}
`
;
loadSvga
(
getSvga
(
name
)).
then
(
loadSvga
(
getSvga
(
name
)).
then
(
(
mv
:
egret
.
MovieClip
)
=>
{
(
mv
:
egret
.
MovieClip
)
=>
{
this
.
removeChild
(
_m
v
);
this
.
removeChild
(
birthM
v
);
this
.
addChild
(
mv
);
this
.
addChild
(
mv
);
this
.
cropMv
=
mv
;
this
.
cropMv
=
mv
;
this
.
cropMv
.
x
=
pos
[
0
];
this
.
cropMv
.
x
=
pos
[
0
];
this
.
cropMv
.
y
=
pos
[
1
];
this
.
cropMv
.
y
=
pos
[
1
];
this
.
cropMv
.
pixelHitTest
=
true
;
this
.
cropMv
.
pixelHitTest
=
true
;
...
@@ -489,8 +488,8 @@ export default class Crop extends eui.Component {
...
@@ -489,8 +488,8 @@ export default class Crop extends eui.Component {
private
addOption
(
name
)
{
private
addOption
(
name
)
{
this
.
optionMv
&&
this
.
removeChild
(
this
.
optionMv
)
&&
(
this
.
optionMv
=
null
);
this
.
optionMv
&&
this
.
removeChild
(
this
.
optionMv
)
&&
(
this
.
optionMv
=
null
);
loadSvga
(
getSvga
(
name
)).
then
(
loadSvga
(
getSvga
(
name
)).
then
(
(
m
v
:
egret
.
DisplayObject
)
=>
{
(
optionM
v
:
egret
.
DisplayObject
)
=>
{
this
.
optionMv
=
m
v
;
this
.
optionMv
=
optionM
v
;
this
.
addChild
(
this
.
optionMv
);
this
.
addChild
(
this
.
optionMv
);
this
.
optionMv
.
x
=
80
;
this
.
optionMv
.
x
=
80
;
this
.
optionMv
.
y
=
-
85
;
this
.
optionMv
.
y
=
-
85
;
...
...
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