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
a0ad980b
Commit
a0ad980b
authored
Jun 08, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ac06d6d7
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
123 additions
and
137 deletions
+123
-137
workspace.xml
.idea/workspace.xml
+29
-99
game_bg.jpg
released/resource/gameScene/game_bg.jpg
+0
-0
loading_bg.jpg
released/resource/loadingScene/loading_bg.jpg
+0
-0
res.json
released/resource/res.json
+58
-33
GameLayer.ts
src/parts/Game/GameLayer.ts
+13
-3
Land.ts
src/parts/Game/Land.ts
+18
-0
ProgressBar.ts
src/parts/Game/ProgressBar.ts
+5
-1
UILayer.ts
src/parts/UI/UILayer.ts
+0
-1
No files found.
.idea/workspace.xml
View file @
a0ad980b
This diff is collapsed.
Click to expand it.
released/resource/gameScene/game_bg.jpg
View replaced file @
ac06d6d7
View file @
a0ad980b
522 KB
|
W:
|
H:
63.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
released/resource/loadingScene/loading_bg.jpg
View replaced file @
ac06d6d7
View file @
a0ad980b
524 KB
|
W:
|
H:
69.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
released/resource/res.json
View file @
a0ad980b
This diff is collapsed.
Click to expand it.
src/parts/Game/GameLayer.ts
View file @
a0ad980b
import
Container
=
FYGE
.
Container
;
import
Container
=
FYGE
.
Container
;
import
{
Land
}
from
"./Land"
;
import
{
Land
}
from
"./Land"
;
import
PlantList
from
"./PlantList"
;
import
PlantList
from
"./PlantList"
;
import
{
PLANT_STATE
,
PLANT_TYPE
}
from
"../../const/staticData"
;
import
{
PLANT_STATE
,
PLANT_TYPE
,
s_PlantData
}
from
"../../const/staticData"
;
import
{
Tool
}
from
"../../Tools"
;
import
{
UILayer
}
from
"../UI/UILayer"
;
import
{
layers
}
from
"../../../module/views/layers"
;
/**
/**
* GameLayer
* GameLayer
...
@@ -28,8 +31,6 @@ export default class GameLayer extends Container {
...
@@ -28,8 +31,6 @@ export default class GameLayer extends Container {
private
constructor
()
{
private
constructor
()
{
super
();
super
();
window
[
'gameLayer'
]
=
this
;
this
.
initLand
();
this
.
initLand
();
// 种植列表
// 种植列表
...
@@ -56,6 +57,8 @@ export default class GameLayer extends Container {
...
@@ -56,6 +57,8 @@ export default class GameLayer extends Container {
];
];
this
.
initPlant
(
initData
);
this
.
initPlant
(
initData
);
this
.
getEffect
(
PLANT_TYPE
.
Cashew
,
1
);
}
}
/**
/**
...
@@ -94,6 +97,13 @@ export default class GameLayer extends Container {
...
@@ -94,6 +97,13 @@ export default class GameLayer extends Container {
});
});
}
}
public
getEffect
(
type
:
PLANT_TYPE
,
id
:
number
)
{
const
getEffect
=
this
.
addChild
(
Tool
.
getSprite
(
`种植框_
${
s_PlantData
[
type
].
name
}
.png`
));
getEffect
.
position
.
set
(
this
.
landList
[
id
-
1
].
x
+
185
,
this
.
landList
[
id
-
1
].
y
+
55
);
let
x
=
375
;
let
y
=
layers
.
stageWidth
-
layers
.
stageOffsetY
;
}
public
initEvent
()
{
public
initEvent
()
{
}
}
...
...
src/parts/Game/Land.ts
View file @
a0ad980b
...
@@ -89,6 +89,12 @@ export class Land extends Container {
...
@@ -89,6 +89,12 @@ export class Land extends Container {
public
addPlant
(
type
:
PLANT_TYPE
)
{
public
addPlant
(
type
:
PLANT_TYPE
)
{
this
.
plant
.
plant
(
type
);
this
.
plant
.
plant
(
type
);
this
.
changeState
(
LAND_STATE
.
PLANT
);
this
.
changeState
(
LAND_STATE
.
PLANT
);
this
.
progressBar
.
setData
({
type
:
type
,
timestamp
:
Date
.
now
(),
fullTime
:
3
,
});
this
.
progressBar
.
show
();
}
}
/**
/**
...
@@ -97,6 +103,12 @@ export class Land extends Container {
...
@@ -97,6 +103,12 @@ export class Land extends Container {
*/
*/
public
updatePlant
(
state
:
PLANT_STATE
)
{
public
updatePlant
(
state
:
PLANT_STATE
)
{
this
.
plant
.
updatePlant
(
state
);
this
.
plant
.
updatePlant
(
state
);
this
.
progressBar
.
setData
({
type
:
this
.
plant
.
type
,
timestamp
:
Date
.
now
(),
fullTime
:
3
,
});
this
.
progressBar
.
show
();
}
}
/**
/**
...
@@ -115,6 +127,7 @@ export class Land extends Container {
...
@@ -115,6 +127,7 @@ export class Land extends Container {
timestamp
:
Date
.
now
(),
timestamp
:
Date
.
now
(),
fullTime
:
3
,
fullTime
:
3
,
});
});
this
.
progressBar
.
show
();
}
}
/**
/**
...
@@ -123,6 +136,9 @@ export class Land extends Container {
...
@@ -123,6 +136,9 @@ export class Land extends Container {
public
clearPlant
()
{
public
clearPlant
()
{
this
.
plant
.
clearPlant
();
this
.
plant
.
clearPlant
();
this
.
changeState
(
LAND_STATE
.
DEFAULT
);
this
.
changeState
(
LAND_STATE
.
DEFAULT
);
this
.
progressBar
.
setData
({
type
:
PLANT_TYPE
.
NONE
,
});
}
}
/**
/**
...
@@ -163,6 +179,8 @@ export class Land extends Container {
...
@@ -163,6 +179,8 @@ export class Land extends Container {
*/
*/
public
get
(
e
:
MouseEvent
)
{
public
get
(
e
:
MouseEvent
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
this
.
removeOption
();
this
.
clearPlant
();
console
.
log
(
"收获"
);
console
.
log
(
"收获"
);
}
}
...
...
src/parts/Game/ProgressBar.ts
View file @
a0ad980b
...
@@ -57,7 +57,11 @@ export default class ProgressBar extends Container {
...
@@ -57,7 +57,11 @@ export default class ProgressBar extends Container {
* @param data
* @param data
*/
*/
public
setData
(
data
)
{
public
setData
(
data
)
{
if
(
data
.
type
==
PLANT_TYPE
.
NONE
)
return
;
if
(
data
.
type
==
PLANT_TYPE
.
NONE
)
{
Tween
.
removeTweens
(
this
);
this
.
visible
=
false
;
return
;
}
this
.
nameLabel
.
text
=
s_PlantData
[
data
.
type
].
name
;
this
.
nameLabel
.
text
=
s_PlantData
[
data
.
type
].
name
;
this
.
nameLabel
.
position
.
set
(
80
+
(
56
-
this
.
nameLabel
.
textWidth
)
/
2
,
139
);
this
.
nameLabel
.
position
.
set
(
80
+
(
56
-
this
.
nameLabel
.
textWidth
)
/
2
,
139
);
...
...
src/parts/UI/UILayer.ts
View file @
a0ad980b
...
@@ -5,7 +5,6 @@ import { Tool } from "../../Tools";
...
@@ -5,7 +5,6 @@ import { Tool } from "../../Tools";
import
{
getAdjustBottomHeight
,
getAdjustTopHeight
}
from
"../../const/myLab"
;
import
{
getAdjustBottomHeight
,
getAdjustTopHeight
}
from
"../../const/myLab"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
PanelCtrl
from
"../../../module/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../../module/ctrls/panelCtrl"
;
import
RulePanel
from
"../../panels/RulePanel"
;
import
TaskPanel
from
"../../panels/TaskPanel"
;
import
TaskPanel
from
"../../panels/TaskPanel"
;
import
WareHousePanel
from
"../../panels/WareHousePanel"
;
import
WareHousePanel
from
"../../panels/WareHousePanel"
;
import
ShopPanel
from
"../../panels/ShopPanel"
;
import
ShopPanel
from
"../../panels/ShopPanel"
;
...
...
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