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
db2ddbe4
Commit
db2ddbe4
authored
Jun 05, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task
parent
b85feaad
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
108 additions
and
59 deletions
+108
-59
workspace.xml
.idea/workspace.xml
+45
-46
index.html
index.html
+1
-1
Panel.ts
module/views/Panel.ts
+2
-2
res.json
released/resource/res.json
+1
-1
comm_bg.png
resource/panel/comm_bg.png
+0
-0
res.json
resource/res.json
+1
-1
task_buy_icon.png
resource/taskPanel/task_buy_icon.png
+0
-0
ResJson.ts
src/ResJson.ts
+1
-1
staticData.ts
src/const/staticData.ts
+1
-0
ExSuccessPanel.ts
src/panels/ExSuccessPanel.ts
+27
-3
Land.ts
src/parts/Game/Land.ts
+23
-2
UILayer.ts
src/parts/UI/UILayer.ts
+6
-2
No files found.
.idea/workspace.xml
View file @
db2ddbe4
This diff is collapsed.
Click to expand it.
index.html
View file @
db2ddbe4
...
...
@@ -18,7 +18,7 @@
<!-- <script type="text/javascript" src="//cstaticdun.126.net/load.min.js"></script> -->
<!-- <script src="libs/zepto.min.js"></script> -->
<!-- <script src="libs/p2.js"></script> -->
<script
src=
"libs/fyge.min.js"
></script
>
<!-- <script src="libs/fyge.min.js"></script>--
>
<script
src=
"http://localhost:3001/FYGE.js"
></script>
<!-- <script src="libs/svgaParser.min.js"></script>-->
<style>
...
...
module/views/Panel.ts
View file @
db2ddbe4
...
...
@@ -2,7 +2,7 @@ import { Module } from "./Module";
export
class
Panel
extends
Module
{
pr
ivate
isShowing
:
boolean
pr
otected
isShowing
:
boolean
showAni
()
{
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
...
...
@@ -34,4 +34,4 @@ export class Panel extends Module {
hidePanel
()
{
this
.
destroy
();
}
}
\ No newline at end of file
}
released/resource/res.json
View file @
db2ddbe4
...
...
@@ -136,7 +136,7 @@
"atlas"
:
"shopPanel.json"
},
{
"keys"
:
"task_icon.png"
,
"keys"
:
"task_
chat_icon.png,task_collection_icon.png,task_done.png,task_friend_icon.png,task_go.png,task_icon.png,task_item_bg.png,task_shop_icon.png,task_sign_
icon.png"
,
"name"
:
"taskPanel"
,
"atlas"
:
"taskPanel.json"
},
...
...
resource/panel/comm_bg.png
View replaced file @
b85feaad
View file @
db2ddbe4
19.7 KB
|
W:
|
H:
22 KB
|
W:
|
H:
2-up
Swipe
Onion skin
resource/res.json
View file @
db2ddbe4
...
...
@@ -109,7 +109,7 @@
"name"
:
"shopPanel"
},
{
"keys"
:
"task_icon.png"
,
"keys"
:
"task_
buy_icon.png,task_chat_icon.png,task_done.png,task_friend_icon.png,task_go.png,task_icon.png,task_item_bg.png,task_shop_icon.png,task_sign_icon.png,task_vip_
icon.png"
,
"name"
:
"taskPanel"
},
{
...
...
resource/taskPanel/task_buy_icon.png
0 → 100644
View file @
db2ddbe4
15.6 KB
src/ResJson.ts
View file @
db2ddbe4
...
...
@@ -109,7 +109,7 @@ export const ResJson = {
"name"
:
"shopPanel"
},
{
"keys"
:
"task_icon.png"
,
"keys"
:
"task_
buy_icon.png,task_chat_icon.png,task_done.png,task_friend_icon.png,task_go.png,task_icon.png,task_item_bg.png,task_shop_icon.png,task_sign_icon.png,task_vip_
icon.png"
,
"name"
:
"taskPanel"
},
{
...
...
src/const/staticData.ts
View file @
db2ddbe4
...
...
@@ -71,6 +71,7 @@ export const s_PlantData = {
export
const
gameResource
=
[
'gameScene'
,
'plants'
,
'panel'
,
];
for
(
let
k
in
s_PlantData
)
{
...
...
src/panels/ExSuccessPanel.ts
View file @
db2ddbe4
...
...
@@ -2,6 +2,7 @@ import { Panel } from "../../module/views/Panel";
import
{
Tool
}
from
"../Tools"
;
import
Sprite
=
FYGE
.
Sprite
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
TextField
=
FYGE
.
TextField
;
export
default
class
ExSuccessPanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -9,12 +10,33 @@ export default class ExSuccessPanel extends Panel {
}
closeBtn
:
Sprite
;
prizeImg
:
Sprite
;
prizeLabel
:
TextField
;
btn
:
Sprite
;
initUi
()
{
this
.
addChild
(
Tool
.
getSprite
(
"exSuccessPanel_bg.png"
));
// bg and closeBtn
this
.
addChild
(
Tool
.
getSprite
(
'exSuccessPanel_bg.png'
));
this
.
closeBtn
=
this
.
addChild
(
Tool
.
getSprite
(
'closeBtn.png'
));
this
.
closeBtn
.
position
.
set
(
600
,
350
);
// 图片
this
.
prizeImg
=
this
.
addChild
(
Tool
.
getSprite
(
'进度_fill.png'
));
this
.
prizeImg
.
width
=
427
;
this
.
prizeImg
.
height
=
200
;
this
.
prizeImg
.
position
.
set
((
this
.
width
-
this
.
prizeImg
.
width
)
/
2
,
677
);
// 文案
this
.
prizeLabel
=
this
.
addChild
(
new
TextField
());
this
.
prizeLabel
.
text
=
'6字文案'
;
this
.
prizeLabel
.
fillColor
=
'#c28b4c'
;
this
.
prizeLabel
.
size
=
24
;
this
.
prizeLabel
.
position
.
set
((
this
.
width
-
this
.
prizeLabel
.
textWidth
)
/
2
,
910
);
// 按钮
this
.
btn
=
this
.
addChild
(
Tool
.
getSprite
(
'exSuccessPanel_btn.png'
));
this
.
btn
.
position
.
set
((
this
.
width
-
this
.
btn
.
width
)
/
2
,
960
);
}
start
(
data
)
{
...
...
@@ -22,11 +44,13 @@ export default class ExSuccessPanel extends Panel {
}
initEvents
()
{
this
.
closeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
)
this
.
closeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
this
.
btn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
}
removeEvents
()
{
this
.
closeBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
)
this
.
closeBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
this
.
btn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
hidePanel
,
this
);
}
}
src/parts/Game/Land.ts
View file @
db2ddbe4
...
...
@@ -6,7 +6,7 @@ import { RES } from "../../../module/RES";
import
GameLayer
from
"./GameLayer"
;
import
OptionPool
from
"../../const/OptionPool"
;
import
OptionEffect
from
"./Effects/OptionEffect"
;
import
{
OPTION_TYPE
,
PLANT_STATE
,
PLANT_TYPE
,
s_PlantData
}
from
"../../const/staticData"
;
import
{
OPTION_TYPE
,
PLANT_STATE
,
PLANT_TYPE
}
from
"../../const/staticData"
;
import
Plant
from
"./Plant"
;
import
ProgressBar
from
"./ProgressBar"
;
...
...
@@ -145,6 +145,20 @@ export class Land extends Container {
}
}
/**
* 浇水
*/
public
water
()
{
console
.
log
(
"浇水"
);
}
/**
* 收获
*/
public
get
()
{
console
.
log
(
"收获"
);
}
/**
* 在不是种植状态的基础上改变为选中状态
*/
...
...
@@ -198,7 +212,8 @@ export class Land extends Container {
}
private
endTime
()
{
console
.
log
(
111
);
console
.
log
(
this
.
id
,
'倒计时结束'
);
this
.
addOption
(
Math
.
random
()
>
0.5
?
OPTION_TYPE
.
WATER
:
OPTION_TYPE
.
GET
);
}
/**
...
...
@@ -228,6 +243,11 @@ export class Land extends Container {
private
addOption
(
type
:
OPTION_TYPE
)
{
this
.
removeOption
();
this
.
option
=
this
.
addChild
(
OptionPool
.
ins
.
takeOut
(
type
));
if
(
type
==
OPTION_TYPE
.
WATER
)
{
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
water
,
this
);
}
else
if
(
type
==
OPTION_TYPE
.
GET
)
{
this
.
option
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
get
,
this
);
}
this
.
option
.
x
=
160
;
this
.
option
.
y
=
-
50
;
this
.
option
.
play
();
...
...
@@ -238,6 +258,7 @@ export class Land extends Container {
*/
private
removeOption
()
{
if
(
this
.
option
)
{
this
.
option
.
removeAllEventListener
();
this
.
removeChild
(
this
.
option
);
OptionPool
.
ins
.
takeIn
(
this
.
option
);
this
.
option
=
null
;
...
...
src/parts/UI/UILayer.ts
View file @
db2ddbe4
...
...
@@ -5,8 +5,10 @@ import { Tool } from "../../Tools";
import
{
getAdjustBottomHeight
,
getAdjustTopHeight
}
from
"../../const/myLab"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
PanelCtrl
from
"../../../module/ctrls/panelCtrl"
;
import
ExSuccessPanel
from
"../../panels/ExSuccessPanel"
;
import
RulePanel
from
"../../panels/RulePanel"
;
import
TaskPanel
from
"../../panels/TaskPanel"
;
import
WareHousePanel
from
"../../panels/WareHousePanel"
;
import
ShopPanel
from
"../../panels/ShopPanel"
;
export
class
UILayer
extends
Container
{
...
...
@@ -50,17 +52,19 @@ export class UILayer extends Container {
switch
(
e
.
target
)
{
case
this
.
taskBtn
:
console
.
log
(
'点击了任务'
);
PanelCtrl
.
instance
.
show
(
TaskPanel
);
break
;
case
this
.
wareHouseBtn
:
console
.
log
(
'点击了仓库'
);
PanelCtrl
.
instance
.
show
(
WareHousePanel
);
break
;
case
this
.
storeBtn
:
console
.
log
(
'点击了商店'
);
PanelCtrl
.
instance
.
show
(
ShopPanel
);
break
;
case
this
.
ruleBtn
:
console
.
log
(
'点击了规则'
);
PanelCtrl
.
instance
.
show
(
RulePanel
);
// PanelCtrl.instance.show(ExSuccessPanel);
break
;
case
this
.
adBtn
:
console
.
log
(
'点击了广告'
);
...
...
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