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
3c6c7cfd
Commit
3c6c7cfd
authored
Nov 12, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
eed920c1
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
116 additions
and
56 deletions
+116
-56
exml.json
egret/.wing/exml.json
+13
-1
index.html
egret/index.html
+8
-7
MainBase.ts
egret/libs/new_wx/MainBase.ts
+1
-1
PlaySceneBase.ts
egret/libs/new_wx/components/PlaySceneBase.ts
+5
-1
StartSceneBase.ts
egret/libs/new_wx/components/StartSceneBase.ts
+45
-20
sceneCtrl.ts
egret/libs/new_wx/ctrls/sceneCtrl.ts
+2
-22
sceneTypes.ts
egret/libs/new_wx/types/sceneTypes.ts
+1
-1
preload.tmproject
egret/resource/TextureMerger/preload.tmproject
+1
-0
e1.png
egret/resource/assets/startScene/e1.png
+0
-0
e2.png
egret/resource/assets/startScene/e2.png
+0
-0
e3.png
egret/resource/assets/startScene/e3.png
+0
-0
e4.png
egret/resource/assets/startScene/e4.png
+0
-0
文案.png
egret/resource/assets/startScene/文案.png
+0
-0
文案.png
egret/resource/assets/文案.png
+0
-0
default.res.json
egret/resource/default.res.json
+31
-1
PlaySkin.exml
egret/resource/skins/PlaySkin.exml
+0
-1
StartSkin.exml
egret/resource/skins/StartSkin.exml
+9
-1
No files found.
egret/.wing/exml.json
View file @
3c6c7cfd
{
"global"
:
{
"globalBindingDataTestObj"
:
[]
"globalBindingDataTestObj"
:
[],
"globalBackgroundAlpha"
:
100
,
"globalBackgroundX"
:
0
,
"globalBackgroundY"
:
0
,
"globalBackgroundWidth"
:
-1
,
"globalBackgroundHeight"
:
-1
,
"globalBackgroundColor"
:
"#ffffff"
,
"globalBackgroundImage"
:
"/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg"
},
"1667fb18fa6"
:
{
"bindingDataTestObj"
:
[
...
...
@@ -30,5 +37,10 @@
"backgroundWidth"
:
-1
,
"backgroundHeight"
:
-1
,
"backgroundAlpha"
:
100
},
"16705cb4eec"
:
{
"backgroundType"
:
"user"
,
"backgroundImage"
:
"/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg"
,
"backgroundAlpha"
:
100
}
}
\ No newline at end of file
egret/index.html
View file @
3c6c7cfd
This diff is collapsed.
Click to expand it.
egret/libs/new_wx/MainBase.ts
View file @
3c6c7cfd
...
...
@@ -41,7 +41,7 @@ export default class MainBase extends eui.UILayer {
const
scenes
=
[
[
ModuleTypes
.
START_SCENE
,
this
.
startSceneConfig
],
[
ModuleTypes
.
P
AL
Y_SCENE
,
this
.
playSceneConfig
]
[
ModuleTypes
.
P
LA
Y_SCENE
,
this
.
playSceneConfig
]
];
panels
.
forEach
(
item
=>
PanelCtrl
.
instance
.
registerPanel
(
item
[
0
],
item
[
1
]));
...
...
egret/libs/new_wx/components/PlaySceneBase.ts
View file @
3c6c7cfd
...
...
@@ -7,6 +7,10 @@ import { ModuleTypes } from "../types/sceneTypes";
import
showAlertPanel
from
"../ctrls/showAlertPanel"
;
export
default
class
PlaySceneBase
extends
Scene
{
score
=
0
;
start
()
{
egret
.
Tween
.
get
(
this
).
set
({
x
:
750
}).
to
({
x
:
0
},
300
);
}
sendSubmit
()
{
submit
(()
=>
{
let
panel
:
Panel
;
...
...
egret/libs/new_wx/components/StartSceneBase.ts
View file @
3c6c7cfd
...
...
@@ -17,6 +17,7 @@ export default class StartSceneBase extends Scene {
startBtn
:
eui
.
Button
;
rankBtn
:
eui
.
Button
;
countdownTxt
:
eui
.
Label
;
elements
:
eui
.
Group
;
countTxt
:
eui
.
Label
;
exemptionTxt
:
eui
.
Label
;
...
...
@@ -26,16 +27,16 @@ export default class StartSceneBase extends Scene {
this
.
startBtn
.
visible
=
false
;
this
.
updateGetInfoView
();
this
.
updateExemptionTxt
();
this
.
showElements
();
this
.
autoStart
();
// this.autoStart();
this
.
addEventListener
(
egret
.
Event
.
ADDED_TO_STAGE
,
()
=>
{
this
.
height
=
this
.
stage
.
stageHeight
;
},
this
);
this
.
playAnimation
();
}
autoStart
()
{
const
n
=
9999
;
const
n
=
3
;
const
timer
=
new
egret
.
Timer
(
1000
,
n
);
timer
.
addEventListener
(
egret
.
TimerEvent
.
TIMER
,
()
=>
{
this
.
updateCountdownTxt
(
n
-
timer
.
currentCount
);
...
...
@@ -52,11 +53,30 @@ export default class StartSceneBase extends Scene {
this
.
countdownTxt
.
text
=
`生活不容易,(
${
n
}
)秒后帮您自动开始游戏`
}
showElements
()
{
async
playAnimation
()
{
this
.
startBtn
.
horizontalCenter
=
750
;
this
.
countTxt
.
horizontalCenter
=
750
;
const
btns
=
[
this
.
ruleBtn
,
this
.
optionBtn
,
this
.
recordBtn
,
this
.
rankBtn
];
btns
.
forEach
(
btn
=>
btn
.
alpha
=
0
)
for
(
const
item
of
[
'e1'
,
'e2'
,
'e3'
,
'e4'
])
{
egret
.
Tween
.
get
(
this
[
item
]).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
getBackOut
(
2
));
}
egret
.
Tween
.
get
(
this
[
'logo'
]).
set
({
x
:
this
[
'logo'
].
x
+
750
}).
wait
(
500
).
to
({
x
:
this
[
'logo'
].
x
},
300
,
egret
.
Ease
.
backOut
).
call
(
async
()
=>
{
egret
.
Tween
.
get
(
this
.
startBtn
).
to
({
horizontalCenter
:
0
},
400
,
egret
.
Ease
.
backOut
);
egret
.
Tween
.
get
(
this
.
countTxt
).
wait
(
400
).
to
({
horizontalCenter
:
0
},
300
,
egret
.
Ease
.
backOut
);
const
btns
=
[
this
.
ruleBtn
,
this
.
optionBtn
,
this
.
recordBtn
,
this
.
rankBtn
];
btns
.
forEach
(
btn
=>
{
egret
.
Tween
.
get
(
btn
).
set
({
alpha
:
0
}).
to
({
alpha
:
1
},
700
,
egret
.
Ease
.
backOut
);
})
egret
.
Tween
.
get
(
btn
).
to
({
alpha
:
1
},
700
,
egret
.
Ease
.
backOut
);
});
await
wait
(
500
);
egret
.
Tween
.
get
(
this
.
startBtn
,
{
loop
:
true
})
.
to
({
scaleY
:
1.1
,
scaleX
:
0.9
},
1000
,
egret
.
Ease
.
bounceOut
)
.
wait
(
500
)
.
to
({
scaleY
:
1
,
scaleX
:
1
},
1000
)
.
to
({
scaleX
:
1.1
,
scaleY
:
0.9
},
1000
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
1000
);
});
}
private
updateGetInfoView
()
{
...
...
@@ -72,21 +92,14 @@ export default class StartSceneBase extends Scene {
if
(
this
.
startBtn
)
{
this
.
startBtn
.
visible
=
true
;
this
.
startBtn
.
enabled
=
getStartBtnEnable
();
egret
.
Tween
.
get
(
this
.
startBtn
).
set
({
horizontalCenter
:
750
}).
to
({
horizontalCenter
:
0
},
400
,
egret
.
Ease
.
elasticOut
);
await
wait
(
500
);
egret
.
Tween
.
get
(
this
.
startBtn
,
{
loop
:
true
})
.
to
({
scaleY
:
1.1
,
scaleX
:
0.9
},
1000
,
egret
.
Ease
.
bounceOut
)
.
wait
(
500
)
.
to
({
scaleY
:
1
,
scaleX
:
1
},
1000
)
.
to
({
scaleX
:
1.1
,
scaleY
:
0.9
},
1000
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
1000
);
}
}
updateCountTxt
()
{
if
(
this
.
countTxt
)
{
this
.
countTxt
.
text
=
getCountTxt
();
egret
.
Tween
.
get
(
this
.
countTxt
).
set
({
horizontalCenter
:
750
}).
wait
(
400
).
to
({
horizontalCenter
:
0
},
300
,
egret
.
Ease
.
backOut
);
}
}
...
...
@@ -132,13 +145,25 @@ export default class StartSceneBase extends Scene {
async
onTap_startBtn
(
e
?:
egret
.
Event
)
{
this
.
stopTimer
();
egret
.
Tween
.
removeTweens
(
this
.
startBtn
);
egret
.
Tween
.
get
(
this
.
startBtn
).
to
({
horizontalCenter
:
750
},
200
);
egret
.
Tween
.
get
(
this
.
countTxt
).
to
({
horizontalCenter
:
-
750
},
200
);
doStart
();
egret
.
Tween
.
get
(
this
[
'logo'
]).
to
({
x
:
this
[
'logo'
].
x
-
750
},
200
);
egret
.
Tween
.
get
(
this
.
startBtn
).
to
({
horizontalCenter
:
-
750
},
200
);
egret
.
Tween
.
get
(
this
.
countTxt
).
to
({
horizontalCenter
:
-
750
},
200
);
const
btns
=
[
this
.
ruleBtn
,
this
.
optionBtn
,
this
.
recordBtn
,
this
.
rankBtn
];
btns
.
forEach
(
btn
=>
{
egret
.
Tween
.
get
(
btn
).
to
({
alpha
:
0
},
200
);
});
await
wait
(
200
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
PALY_SCENE
);
for
(
const
item
of
[
'e1'
,
'e2'
,
'e3'
,
'e4'
])
{
egret
.
Tween
.
get
(
this
[
item
]).
to
({
scaleX
:
0
,
scaleY
:
0
},
300
,
egret
.
Ease
.
backIn
);
}
await
wait
(
300
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
PLAY_SCENE
);
}
private
stopTimer
()
{
if
(
this
.
_timer
)
this
.
_timer
.
stop
();
egret
.
Tween
.
get
(
this
.
countdownTxt
).
to
({
alpha
:
0
},
200
);
}
...
...
egret/libs/new_wx/ctrls/sceneCtrl.ts
View file @
3c6c7cfd
...
...
@@ -32,33 +32,13 @@ export default class SceneCtrl {
}
}
// loadAtlasAndBg(scene, callback) {
// let counter = 2;
// const check = () => {
// if (counter == 0) {
// callback && callback();
// }
// }
// RES.getResAsync(`${scene.skinKey.toLowerCase()}_json`, (sheet: egret.SpriteSheet) => {
// counter--;
// check();
// }, this);
// RES.getResAsync(`${scene.skinKey.toLowerCase()}scenebg_jpg`, () => {
// counter--;
// check();
// }, this);
// }
showAfterLoadAtlas
(
scene
:
Scene
,
data
,
onComplete
:
Function
)
{
Loading
.
instace
.
hide
();
if
(
this
.
_currentScene
)
{
const
oldScene
=
this
.
_currentScene
;
egret
.
Tween
.
get
(
oldScene
).
to
({
alpha
:
0
},
0
).
call
(()
=>
{
oldScene
.
destroy
();
this
.
_parent
.
removeChild
(
oldScene
);
});
}
egret
.
Tween
.
get
(
scene
).
set
({
alpha
:
0
}).
to
({
alpha
:
1
},
500
);
scene
.
loadSkin
();
scene
.
start
();
this
.
addToStage
(
scene
);
...
...
egret/libs/new_wx/types/sceneTypes.ts
View file @
3c6c7cfd
export
enum
ModuleTypes
{
START_SCENE
,
P
AL
Y_SCENE
,
P
LA
Y_SCENE
,
ALERT_PANEL
,
RULE_PANEL
,
...
...
egret/resource/TextureMerger/preload.tmproject
0 → 100644
View file @
3c6c7cfd
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/startScene/e4.png","../assets/startScene/e3.png","../assets/startScene/e2.png","../assets/startScene/e1.png","../assets/startScene/文案.png","../assets/文案.png"]}
\ No newline at end of file
egret/resource/assets/startScene/e1.png
0 → 100644
View file @
3c6c7cfd
6.99 KB
egret/resource/assets/startScene/e2.png
0 → 100644
View file @
3c6c7cfd
20 KB
egret/resource/assets/startScene/e3.png
0 → 100644
View file @
3c6c7cfd
10.9 KB
egret/resource/assets/startScene/e4.png
0 → 100644
View file @
3c6c7cfd
9.35 KB
egret/resource/assets/startScene/文案.png
0 → 100644
View file @
3c6c7cfd
21.7 KB
egret/resource/assets/文案.png
0 → 100644
View file @
3c6c7cfd
22 KB
egret/resource/default.res.json
View file @
3c6c7cfd
...
...
@@ -30,7 +30,7 @@
},
{
"name"
:
"preload"
,
"keys"
:
"playscenebg_jpg,
startscenebg_jp
g"
"keys"
:
"playscenebg_jpg,
e4_png,e3_png,e2_png,e1_png,文案_png,startscenebg_jpg,文案2_pn
g"
}
],
"resources"
:
[
...
...
@@ -209,10 +209,40 @@
"type"
:
"image"
,
"url"
:
"assets/playscene/playscenebg.jpg"
},
{
"name"
:
"e4_png"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/e4.png"
},
{
"name"
:
"e3_png"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/e3.png"
},
{
"name"
:
"e2_png"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/e2.png"
},
{
"name"
:
"e1_png"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/e1.png"
},
{
"name"
:
"文案_png"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/文案.png"
},
{
"name"
:
"startscenebg_jpg"
,
"type"
:
"image"
,
"url"
:
"assets/startScene/startscenebg.jpg"
},
{
"name"
:
"文案2_png"
,
"type"
:
"image"
,
"url"
:
"assets/文案.png"
}
]
}
\ No newline at end of file
egret/resource/skins/PlaySkin.exml
View file @
3c6c7cfd
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"PlaySkin"
width=
"750"
height=
"1663"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
horizontalCenter=
"0"
top=
"0"
source=
"playscenebg_jpg"
/>
<e:Button
id=
"testBtn"
label=
"点击出奖"
y=
"409"
scaleX=
"1"
scaleY=
"1"
horizontalCenter=
"18.5"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
...
...
egret/resource/skins/StartSkin.exml
View file @
3c6c7cfd
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"StartSkin"
width=
"750"
height=
"1624"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<w:Config
id=
"16705cb4eec"
/>
<e:Group
id=
"elements"
horizontalCenter=
"0"
verticalCenter=
"-172"
height=
"664"
width=
"756"
>
<e:Image
id=
"e1"
source=
"e1_png"
x=
"154.5"
y=
"124"
anchorOffsetX=
"38"
anchorOffsetY=
"35.5"
/>
<e:Image
id=
"e2"
source=
"e2_png"
x=
"756"
y=
"531.5"
anchorOffsetX=
"122"
anchorOffsetY=
"131.5"
/>
<e:Image
id=
"e3"
source=
"e3_png"
x=
"604"
y=
"12"
anchorOffsetY=
"20"
anchorOffsetX=
"130"
/>
<e:Image
id=
"e4"
source=
"e4_png"
x=
"0"
y=
"436.5"
anchorOffsetY=
"69.5"
/>
<e:Image
id=
"logo"
source=
"文案_png"
x=
"157"
y=
"121"
/>
</e:Group>
<e:Group
horizontalCenter=
"0"
verticalCenter=
"32"
>
<e:Button
id=
"startBtn"
label=
""
scaleX=
"1"
scaleY=
"1"
anchorOffsetX=
"152.5"
anchorOffsetY=
"49.5"
y=
"108.21"
horizontalCenter=
"0"
>
<e:skinName>
...
...
@@ -10,7 +18,7 @@
</e:skinName>
</e:Button>
<e:Label
id=
"countTxt"
text=
"1/1"
width=
"100%"
verticalAlign=
"middle"
textAlign=
"center"
y=
"183.39"
horizontalCenter=
"0"
/>
<e:Label
id=
"countdownTxt"
text=
"
00:00:00
"
width=
"100%"
verticalAlign=
"middle"
textAlign=
"center"
y=
"0"
horizontalCenter=
"0"
/>
<e:Label
id=
"countdownTxt"
text=
""
width=
"100%"
verticalAlign=
"middle"
textAlign=
"center"
y=
"0"
horizontalCenter=
"0"
/>
</e:Group>
<e:Label
id=
"exemptionTxt"
text=
"*兑换项与活动均与设备制造商Apple Inc.公司无关*"
width=
"100%"
horizontalCenter=
"0"
bottom=
"5"
verticalAlign=
"middle"
textAlign=
"center"
textColor=
"0x333333"
size=
"18"
/>
...
...
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