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
d809176e
Commit
d809176e
authored
Nov 25, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b1c9817c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
175 additions
and
35 deletions
+175
-35
main_starbg.png
egret/resource/assets/main/main_starbg.png
+0
-0
main_text.png
egret/resource/assets/main/main_text.png
+0
-0
default.res.json
egret/resource/default.res.json
+11
-1
default.thm.json
egret/resource/default.thm.json
+28
-27
MainSceneSkin.exml
egret/resource/skins/MainSceneSkin.exml
+2
-1
StarSkin.exml
egret/resource/skins/StarSkin.exml
+5
-0
MainScene.ts
egret/src/MainScene.ts
+45
-6
StarComp.ts
egret/src/StarComp.ts
+37
-0
sort.ts
egret/src/sort.ts
+11
-0
index.json
mock/esports/index.json
+36
-0
No files found.
egret/resource/assets/main/main_starbg.png
0 → 100644
View file @
d809176e
15.1 KB
egret/resource/assets/main/main_text.png
0 → 100644
View file @
d809176e
1.88 KB
egret/resource/default.res.json
View file @
d809176e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"name"
:
"noname"
"name"
:
"noname"
},
},
{
{
"keys"
:
"main_star_png,main_pic_png,main_icon5_png,main_icon4_png,main_icon3_png,main_icon2_png,main_icon1_png,main_fu3_png,main_fu2_png,main_fu_png,main_fu_bg_png,main_btn3_png,main_btn2_png,main_btn1_png,main_bg2_png,main_bg1_png"
,
"keys"
:
"main_star_png,main_pic_png,main_icon5_png,main_icon4_png,main_icon3_png,main_icon2_png,main_icon1_png,main_fu3_png,main_fu2_png,main_fu_png,main_fu_bg_png,main_btn3_png,main_btn2_png,main_btn1_png,main_bg2_png,main_bg1_png
,main_text_png,main_starbg_png
"
,
"name"
:
"mainscene"
"name"
:
"mainscene"
},
},
{
{
...
@@ -426,6 +426,16 @@
...
@@ -426,6 +426,16 @@
"url"
:
"assets/main/main_icon5.png"
,
"url"
:
"assets/main/main_icon5.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"main_icon5_png"
"name"
:
"main_icon5_png"
},
{
"url"
:
"assets/main/main_text.png"
,
"type"
:
"image"
,
"name"
:
"main_text_png"
},
{
"url"
:
"assets/main/main_starbg.png"
,
"type"
:
"image"
,
"name"
:
"main_starbg_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
d809176e
{
{
"skins"
:
{},
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"exmls"
:
[
"resource/skins/AdminItemSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/AdminPanelSkin.exml"
,
"resource/skins/AdminItemSkin.exml"
,
"resource/skins/AdminSkin.exml"
,
"resource/skins/AdminPanelSkin.exml"
,
"resource/skins/CostSkin.exml"
,
"resource/skins/AdminSkin.exml"
,
"resource/skins/DreamAdminSkin.exml"
,
"resource/skins/CostSkin.exml"
,
"resource/skins/DreamSkin.exml"
,
"resource/skins/DreamAdminSkin.exml"
,
"resource/skins/HScrollBarSkin.exml"
,
"resource/skins/DreamSkin.exml"
,
"resource/skins/HisDreamSkin.exml"
,
"resource/skins/HScrollBarSkin.exml"
,
"resource/skins/IntroSkin.exml"
,
"resource/skins/HisDreamSkin.exml"
,
"resource/skins/ListItemSkin.exml"
,
"resource/skins/IntroSkin.exml"
,
"resource/skins/ListSkin.exml"
,
"resource/skins/ListItemSkin.exml"
,
"resource/skins/MainSceneSkin.exml"
,
"resource/skins/ListSkin.exml"
,
"resource/skins/MyDreamSkin.exml"
,
"resource/skins/MainSceneSkin.exml"
,
"resource/skins/PassSkin.exml"
,
"resource/skins/MyDreamSkin.exml"
,
"resource/skins/ReFuseSkin.exml"
,
"resource/skins/PassSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ReFuseSkin.exml"
,
"resource/skins/ScrollerSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ShareDreamSkin.exml"
,
"resource/skins/ScrollerSkin.exml"
,
"resource/skins/StarAniSkin.exml"
,
"resource/skins/ShareDreamSkin.exml"
,
"resource/skins/SuccessSkin.exml"
,
"resource/skins/StarAniSkin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/SuccessSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
"resource/skins/ToastSkin.exml"
,
],
"resource/skins/VScrollBarSkin.exml"
"path"
:
"resource/default.thm.json"
],
"path"
:
"resource/default.thm.json"
}
}
\ No newline at end of file
egret/resource/skins/MainSceneSkin.exml
View file @
d809176e
...
@@ -14,10 +14,11 @@
...
@@ -14,10 +14,11 @@
<e:Rect
id=
"imgMask"
width=
"90"
height=
"80.67"
x=
"74.67"
y=
"115"
anchorOffsetY=
"80.67"
anchorOffsetX=
"44.67"
/>
<e:Rect
id=
"imgMask"
width=
"90"
height=
"80.67"
x=
"74.67"
y=
"115"
anchorOffsetY=
"80.67"
anchorOffsetX=
"44.67"
/>
<e:Image
source=
"main_fu3_png"
y=
"37.28"
x=
"0"
/>
<e:Image
source=
"main_fu3_png"
y=
"37.28"
x=
"0"
/>
</e:Group>
</e:Group>
<e:Group
id=
"starWrapper"
width=
"750"
height=
"1006"
x=
"374"
y=
"562"
anchorOffsetX=
"374"
anchorOffsetY=
"562"
>
<e:Group
id=
"starWrapper"
width=
"750"
height=
"1006"
x=
"374"
y=
"562"
anchorOffsetX=
"374"
anchorOffsetY=
"562"
locked=
"true"
>
<e:Image
source=
"main_pic_png"
x=
"30"
y=
"9"
scaleX=
"1"
scaleY=
"1"
/>
<e:Image
source=
"main_pic_png"
x=
"30"
y=
"9"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
</e:Group>
<e:Image
id=
"rulebtn"
source=
"main_btn3_png"
x=
"623"
y=
"32"
locked=
"true"
/>
<e:Image
id=
"rulebtn"
source=
"main_btn3_png"
x=
"623"
y=
"32"
locked=
"true"
/>
<e:Image
id=
"dreambtn"
source=
"main_btn1_png"
x=
"379.73"
y=
"1020.96"
locked=
"true"
/>
<e:Image
id=
"dreambtn"
source=
"main_btn1_png"
x=
"379.73"
y=
"1020.96"
locked=
"true"
/>
<e:Image
id=
"listbtn"
source=
"main_btn2_png"
x=
"22.5"
y=
"1020.96"
locked=
"true"
/>
<e:Image
id=
"listbtn"
source=
"main_btn2_png"
x=
"22.5"
y=
"1020.96"
locked=
"true"
/>
<e:Image
id=
"tips"
source=
"main_text_png"
x=
"615.04"
y=
"215.04"
visible=
"false"
/>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/resource/skins/StarSkin.exml
0 → 100644
View file @
d809176e
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"Star"
width=
"209"
height=
"124"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
source=
"main_starbg_png"
/>
<e:Label
id=
"txt"
text=
"来自江苏的梦想"
y=
"88"
textColor=
"0x73fffa"
verticalAlign=
"middle"
textAlign=
"center"
width=
"209"
height=
"35"
size=
"22"
/>
</e:Skin>
\ No newline at end of file
egret/src/MainScene.ts
View file @
d809176e
...
@@ -13,6 +13,9 @@ import StarAni from "./StarAni";
...
@@ -13,6 +13,9 @@ import StarAni from "./StarAni";
import
{
IntroType
}
from
"./IntroScene"
;
import
{
IntroType
}
from
"./IntroScene"
;
import
{
DreamSceneType
}
from
"./DreamScene"
;
import
{
DreamSceneType
}
from
"./DreamScene"
;
import
{
getEnergyLimit
}
from
"./datas"
;
import
{
getEnergyLimit
}
from
"./datas"
;
import
StarComp
from
"./StarComp"
;
import
{
getProvince
}
from
"./MyDreamScene"
;
import
sort
from
"./sort"
;
let
isFirstShow
=
true
;
let
isFirstShow
=
true
;
let
_myInfo
;
let
_myInfo
;
export
const
getMyInfo
=
()
=>
{
return
_myInfo
};
export
const
getMyInfo
=
()
=>
{
return
_myInfo
};
...
@@ -27,7 +30,7 @@ export const updateMyInfo = () => {
...
@@ -27,7 +30,7 @@ export const updateMyInfo = () => {
export
default
class
MainScene
extends
Scene
{
export
default
class
MainScene
extends
Scene
{
starWrapper
:
eui
.
Group
;
starWrapper
:
eui
.
Group
;
setProgress
(
num
,
energyLimit
)
{
setProgress
(
num
,
energyLimit
)
{
if
(
num
==
null
)
num
=
0
;
if
(
num
==
null
)
num
=
0
;
this
[
'progressTxt'
].
text
=
`
${
num
}
/
${
energyLimit
}
`
;
this
[
'progressTxt'
].
text
=
`
${
num
}
/
${
energyLimit
}
`
;
this
[
'imgMask'
].
scaleY
=
num
>
energyLimit
?
1
:
num
/
energyLimit
;
this
[
'imgMask'
].
scaleY
=
num
>
energyLimit
?
1
:
num
/
energyLimit
;
}
}
...
@@ -36,12 +39,31 @@ export default class MainScene extends Scene {
...
@@ -36,12 +39,31 @@ export default class MainScene extends Scene {
return
new
Promise
((
r
)
=>
{
return
new
Promise
((
r
)
=>
{
this
[
'starWrapper'
][
'isNormal'
]
=
isNormal
;
this
[
'starWrapper'
][
'isNormal'
]
=
isNormal
;
if
(
isNormal
)
{
if
(
isNormal
)
{
this
[
'tips'
].
visible
=
false
;
egret
.
Tween
.
get
(
this
[
'starWrapper'
]).
to
({
x
:
374
,
y
:
562
,
scaleY
:
1
,
scaleX
:
1
},
500
,
egret
.
Ease
.
backIn
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
[
'starWrapper'
]).
to
({
x
:
374
,
y
:
562
,
scaleY
:
1
,
scaleX
:
1
},
500
,
egret
.
Ease
.
backIn
).
call
(()
=>
{
this
.
playShakeAni
();
this
.
playShakeAni
();
this
.
stars
.
forEach
((
item
,
index
)
=>
{
egret
.
Tween
.
removeTweens
(
item
);
item
.
alpha
=
0
;
item
.
touchEnabled
=
false
;
});
});
});
}
else
{
}
else
{
this
.
stopShakeAni
();
this
.
stopShakeAni
();
egret
.
Tween
.
get
(
this
[
'starWrapper'
]).
to
({
x
:
666
+
10
,
y
:
135
+
30
,
scaleX
:
0.15
,
scaleY
:
0.15
},
500
,
egret
.
Ease
.
backIn
);
egret
.
Tween
.
get
(
this
[
'starWrapper'
]).
to
({
x
:
666
+
10
,
y
:
135
+
30
,
scaleX
:
0.15
,
scaleY
:
0.15
},
500
,
egret
.
Ease
.
backIn
).
call
(()
=>
{
this
[
'tips'
].
visible
=
true
;
this
.
stars
.
forEach
((
item
,
index
)
=>
{
wait
(
index
*
1000
).
then
(()
=>
{
item
.
touchEnabled
=
true
;
egret
.
Tween
.
get
(
item
).
to
({
alpha
:
1
},
1000
).
call
(()
=>
{
const
y
=
this
.
pos
[
index
][
1
];
const
stren
=
20
;
const
dur
=
2000
;
egret
.
Tween
.
get
(
item
,{
loop
:
true
}).
set
({
y
:
y
}).
to
({
y
:
y
-
stren
},
dur
).
to
({
y
:
y
},
dur
)
.
to
({
y
:
y
+
stren
},
dur
).
to
({
y
:
y
},
dur
)
});
});
});
});
}
}
});
});
}
}
...
@@ -62,6 +84,10 @@ export default class MainScene extends Scene {
...
@@ -62,6 +84,10 @@ export default class MainScene extends Scene {
this
.
onResume_mainscene
();
this
.
onResume_mainscene
();
MainBase
.
onResume_mainscene
=
this
.
onResume_mainscene
;
MainBase
.
onResume_mainscene
=
this
.
onResume_mainscene
;
const
join_1_index
:
join_1_index
=
DataManager
.
ins
.
getData
(
'yyh_join1_index'
);
this
.
showPanels
(
join_1_index
.
data
);
this
.
updateStars
(
join_1_index
.
data
.
dreamList
);
if
(
isFirstShow
)
{
if
(
isFirstShow
)
{
isFirstShow
=
false
;
isFirstShow
=
false
;
this
.
setNormal
(
1
);
this
.
setNormal
(
1
);
...
@@ -73,14 +99,27 @@ export default class MainScene extends Scene {
...
@@ -73,14 +99,27 @@ export default class MainScene extends Scene {
}
else
{
}
else
{
this
[
'starWrapper'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
ontap_starWrapper
,
this
);
this
[
'starWrapper'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
ontap_starWrapper
,
this
);
}
}
const
join_1_index
:
join_1_index
=
DataManager
.
ins
.
getData
(
'yyh_join1_index'
);
this
.
showPanels
(
join_1_index
.
data
);
const
detail
:
any
=
await
updateMyInfo
()
const
detail
:
any
=
await
updateMyInfo
()
this
.
setProgress
(
detail
.
energy
,
getEnergyLimit
());
this
.
setProgress
(
detail
.
energy
,
getEnergyLimit
());
}
}
stars
:
any
[];
pos
=
[[
70
,
350
],
[
480
,
300
],
[
100
,
800
],
[
300
,
550
],
[
450
,
750
]];
updateStars
(
list
:
any
[])
{
if
(
list
.
length
>
5
)
list
.
length
=
5
;
this
.
stars
=
[];
list
.
forEach
((
item
,
index
)
=>
{
const
star
=
new
StarComp
(
`来自
${
getProvince
(
item
.
address
)}
的梦想`
,
item
.
id
);
star
.
x
=
this
.
pos
[
index
][
0
];
star
.
y
=
this
.
pos
[
index
][
1
];
this
.
addChild
(
star
);
star
.
alpha
=
0
;
this
.
stars
.
push
(
star
);
star
.
touchEnabled
=
false
;
})
}
showPanels
(
data
:
join_1_index_data
)
{
showPanels
(
data
:
join_1_index_data
)
{
if
(
data
.
lightUpWindow
)
if
(
data
.
lightUpWindow
)
PanelCtrl
.
instance
.
show
(
'SuccessPanel'
);
//成功点亮
PanelCtrl
.
instance
.
show
(
'SuccessPanel'
);
//成功点亮
...
...
egret/src/StarComp.ts
0 → 100644
View file @
d809176e
import
ComponentBase
from
"../libs/new_wx/components/ComponentBase"
;
import
SceneCtrl
from
"../libs/new_wx/ctrls/sceneCtrl"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
getcredits
from
"./getcredits"
;
import
{
HisDreamType
}
from
"./HisDreamScene"
;
import
join_1_index
from
"./interfaces/join_1_index"
;
export
default
class
StarComp
extends
ComponentBase
{
constructor
(
txt
,
id
)
{
super
();
this
.
loadSkin
();
this
[
'txt'
].
text
=
txt
;
this
.
once
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
const
credits
=
getcredits
();
NetManager
.
ins
.
yyh_join1_dreamDetail
(()
=>
{
const
join_1_index
:
join_1_index
=
DataManager
.
ins
.
getData
(
'yyh_join1_index'
);
const
detail
=
DataManager
.
ins
.
getData
(
'yyh_join1_dreamDetail'
).
data
;
if
(
new
Date
().
getTime
()
>
join_1_index
.
data
.
assistDeadline
)
SceneCtrl
.
instance
.
change
(
'HisDreamScene'
,
HisDreamType
.
TIMES_OUT
);
else
if
(
detail
.
assist
)
{
//主力了
SceneCtrl
.
instance
.
change
(
'HisDreamScene'
,
HisDreamType
.
HELP_DONE
);
}
else
{
if
(
join_1_index
.
data
.
doAssistCount
>=
join_1_index
.
data
.
doAssistLimit
)
{
//次数限制
SceneCtrl
.
instance
.
change
(
'HisDreamScene'
,
HisDreamType
.
TIMES_LIMIT
);
}
else
if
(
credits
<=
0
)
{
SceneCtrl
.
instance
.
change
(
'HisDreamScene'
,
HisDreamType
.
MONEY_NOT_ENOUPH
);
}
else
{
SceneCtrl
.
instance
.
change
(
'HisDreamScene'
,
HisDreamType
.
ENOUPH_TIMES
);
}
}
},
false
,
id
);
},
this
);
}
get
skinKey
():
string
{
return
"Star"
}
}
\ No newline at end of file
egret/src/sort.ts
0 → 100644
View file @
d809176e
export
default
(
arr
)
=>
{
var
randomNumber
=
function
(){
// randomNumber(a,b) 返回的值大于 0 ,则 b 在 a 的前边;
// randomNumber(a,b) 返回的值等于 0 ,则a 、b 位置保持不变;
// randomNumber(a,b) 返回的值小于 0 ,则 a 在 b 的前边。
return
0.5
-
Math
.
random
()
}
arr
.
sort
(
randomNumber
)
return
arr
;
}
\ No newline at end of file
mock/esports/index.json
View file @
d809176e
...
@@ -13,6 +13,42 @@
...
@@ -13,6 +13,42 @@
"doAssistLimit"
:
11
,
"doAssistLimit"
:
11
,
"energyLimit"
:
999
,
"energyLimit"
:
999
,
"dreamList"
:
[
"dreamList"
:
[
{
"id"
:
1
,
"dreamTitle"
:
"梦想标题"
,
"name"
:
"姓名"
,
"tel"
:
"13711111111"
,
"idNumber"
:
"333333333333333333"
,
"address"
:
"浙江省,杭州市,上城区"
,
"dreamContent"
:
"梦想内容"
,
"dreamPic"
:
"梦想图片"
,
"rank"
:
1
,
"energy"
:
1000
},
{
"id"
:
1
,
"dreamTitle"
:
"梦想标题"
,
"name"
:
"姓名"
,
"tel"
:
"13711111111"
,
"idNumber"
:
"333333333333333333"
,
"address"
:
"浙江省,杭州市,上城区"
,
"dreamContent"
:
"梦想内容"
,
"dreamPic"
:
"梦想图片"
,
"rank"
:
1
,
"energy"
:
1000
},
{
"id"
:
1
,
"dreamTitle"
:
"梦想标题"
,
"name"
:
"姓名"
,
"tel"
:
"13711111111"
,
"idNumber"
:
"333333333333333333"
,
"address"
:
"浙江省,杭州市,上城区"
,
"dreamContent"
:
"梦想内容"
,
"dreamPic"
:
"梦想图片"
,
"rank"
:
1
,
"energy"
:
1000
},
{
{
"id"
:
1
,
"id"
:
1
,
"dreamTitle"
:
"梦想标题"
,
"dreamTitle"
:
"梦想标题"
,
...
...
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