Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qiaqia_qx
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
邱旭
qiaqia_qx
Commits
2b7e615e
Commit
2b7e615e
authored
Jun 02, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
19b56259
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
95 deletions
+87
-95
workspace.xml
.idea/workspace.xml
+35
-84
BirthEffect.ts
src/parts/Game/Effects/BirthEffect.ts
+47
-7
GameScene.ts
src/scenes/GameScene.ts
+4
-3
LoadingScene.ts
src/scenes/LoadingScene.ts
+1
-1
No files found.
.idea/workspace.xml
View file @
2b7e615e
This diff is collapsed.
Click to expand it.
src/parts/Game/Effects/BirthEffect.ts
View file @
2b7e615e
...
...
@@ -2,27 +2,67 @@ import IEffect from "../../IEffect";
import
{
PLANT_STATE
,
PLANT_TYPE
}
from
"../../../const/staticData"
;
import
{
RES
}
from
"../../../../module/RES"
;
import
Sprite
=
FYGE
.
Sprite
;
import
Tween
=
FYGE
.
Tween
;
import
Ease
=
FYGE
.
Ease
;
import
Container
=
FYGE
.
Container
;
import
{
Tool
}
from
"../../../Tools"
;
export
class
BirthEffect
extends
Sprite
implements
IEffect
{
export
class
BirthEffect
extends
Container
implements
IEffect
{
private
type
:
PLANT_TYPE
;
private
_type
:
PLANT_TYPE
;
private
_state
:
PLANT_STATE
;
private
img
:
Sprite
;
public
get
type
():
PLANT_TYPE
{
return
this
.
_type
;
}
public
get
state
():
PLANT_STATE
{
return
this
.
_state
;
}
private
sprites
=
[];
constructor
(
type
:
PLANT_TYPE
,
state
:
PLANT_STATE
)
{
super
(
RES
.
getRes
(
`
${
type
}${
state
}
.png`
));
super
();
const
pos
=
[
[
10
,
10
],
[
50
,
50
],
[
60
,
60
],
[
70
,
70
]
];
[
0
,
1
,
2
,
3
].
forEach
((
v
)
=>
{
const
n
=
this
.
addChild
(
Tool
.
getSprite
(
`
${
type
}
_
${
state
}
.png`
));
n
.
anchorTexture
.
set
(
0.5
,
1
);
n
.
scale
.
set
(
0
,
0
);
n
.
position
.
set
(
pos
[
v
][
0
],
pos
[
v
][
1
]);
this
.
sprites
.
push
(
n
);
});
}
public
play
()
{
// 中心点在树根下方,每次记得对一下
// 缩放:0s(0%,0%)-0.23s(110%,110%)-0.33s(100%,100%);
// 位置:0s(原位)-0.23s(上移10px)-0.33s(下移10px至原位);
this
.
stop
();
this
.
sprites
.
forEach
((
v
)
=>
{
const
_y
=
v
.
y
;
Tween
.
get
(
v
)
.
to
({
scaleX
:
1.1
,
scaleY
:
1.1
,
y
:
_y
-
10
},
230
,
Ease
.
quadIn
)
.
to
({
scaleX
:
1
,
scaleY
:
1
,
y
:
_y
},
100
,
Ease
.
quadOut
);
});
}
public
reset
()
{
this
.
stop
();
this
.
sprites
.
forEach
((
v
)
=>
{
v
.
scale
.
set
(
0
,
0
);
});
}
public
stop
()
{
this
.
sprites
.
forEach
((
v
)
=>
{
Tween
.
removeTweens
(
v
);
});
}
}
src/scenes/GameScene.ts
View file @
2b7e615e
...
...
@@ -3,8 +3,8 @@ import { Tool } from "../Tools";
import
GameLayer
from
"../parts/Game/GameLayer"
;
import
{
UILayer
}
from
"../parts/UI/UILayer"
;
import
{
Land
}
from
"../parts/Game/Land"
;
import
OptionPool
from
"../const/OptionPool
"
;
import
{
OPTION_TYPE
}
from
"../const/staticData
"
;
import
{
PLANT_STATE
,
PLANT_TYPE
}
from
"../const/staticData
"
;
import
{
BirthEffect
}
from
"../parts/Game/Effects/BirthEffect
"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
export
class
GameScene
extends
Scene
{
...
...
@@ -34,7 +34,8 @@ export class GameScene extends Scene {
// UI层
this
.
uiLayer
=
this
.
addChild
(
new
UILayer
());
window
[
'a'
]
=
this
.
addChild
(
OptionPool
.
ins
.
takeOut
(
OPTION_TYPE
.
GET
));
window
[
'a'
]
=
this
.
addChild
(
new
BirthEffect
(
PLANT_TYPE
.
Sunflower
,
PLANT_STATE
.
STATE1
));
window
[
'a'
].
position
.
set
(
200
,
600
);
}
...
...
src/scenes/LoadingScene.ts
View file @
2b7e615e
...
...
@@ -77,7 +77,7 @@ export class LoadingScene extends Scene {
private
startLoading
()
{
return
Tween
.
get
(
this
.
progressFill
)
.
to
({
x
:
10
},
2
000
,
Ease
.
quadInOut
);
.
to
({
x
:
10
},
1
000
,
Ease
.
quadInOut
);
}
private
titleEffect
()
{
...
...
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