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
045ab394
Commit
045ab394
authored
Jul 17, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d0bd5453
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
index.html
egret/index.html
+1
-0
StartScene.ts
egret/src/startScene/StartScene.ts
+17
-7
No files found.
egret/index.html
View file @
045ab394
...
...
@@ -46,6 +46,7 @@
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script>
window
[
'gameoverTime'
]
=
0
;
window
[
'withdrawLink'
]
=
'http://www.kuwo.cn/cp/duiba/mall/login?dbredirect=https%3A%2F%2Factivity.m.duiba.com.cn%2Fhdtool%2Findex%3Fid%3D3441638%26dbnewopen'
;
window
[
'shareLink'
]
=
'https://www.baidu.com/s?wd=sharelink&rsv_spt=1&rsv_iqid=0xe5865f150006f034&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_sug3=9&rsv_sug1=8&rsv_sug7=100&rsv_t=9bbc4M4X1%2Fk3rQi28vbPaGQ36Xiib5u2Y9MwMG7SD76vUS4OHgKFiNjX1JGwrlT5uZge&rsv_sug2=0&inputT=1248&rsv_sug4=1248'
;
window
[
'EGG_MAX'
]
=
50
;
...
...
egret/src/startScene/StartScene.ts
View file @
045ab394
...
...
@@ -114,6 +114,8 @@ export default class StartScene extends Scene {
updateCountTxt
()
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
NetName
.
kwIndex
);
this
.
countTxt
.
text
=
`剩
${
data
.
leftTimes
}
次`
;
if
(
Date
.
now
()
>
window
[
'gameoverTime'
])
this
.
countTxt
.
text
=
`剩0次`
;
}
async
updateCountData
()
{
...
...
@@ -150,6 +152,10 @@ export default class StartScene extends Scene {
}
async
onTap_dojoinBtn
()
{
if
(
Date
.
now
()
>
window
[
'gameoverTime'
])
{
showToast
(
'本期音乐扭蛋机活动已结束,敬请期待下期活动~'
);
return
;
}
const
{
data
}
=
DataManager
.
ins
.
getData
(
NetName
.
kwIndex
);
if
(
data
.
leftTimes
<=
0
)
{
showToast
(
'对不起,剩余次数不足
\
n无法进行扭蛋'
);
...
...
@@ -258,15 +264,15 @@ export default class StartScene extends Scene {
const
eggOrder
=
Math
.
ceil
(
Math
.
random
()
*
3
);
const
eggani
:
MovieClip
=
this
[
'eggani'
+
eggOrder
];
eggani
.
goto
(
0
);
eggani
.
visible
=
true
;
eggani
.
visible
=
true
;
eggani
[
'__xx__'
]
=
0
;
return
new
Promise
((
r
)
=>
{
egret
.
Tween
.
get
(
eggani
).
set
({
scaleX
:
0
,
scaleY
:
0
,
x
:
375
+
100
,
y
:
496
+
300
}).
to
({
scaleX
:
0.3
,
scaleY
:
0.3
},
500
,
egret
.
Ease
.
getBackOut
(
5
)).
call
(()
=>
{
egret
.
Tween
.
get
(
eggani
).
set
({
scaleX
:
0
,
scaleY
:
0
,
x
:
375
+
100
,
y
:
496
+
300
}).
to
({
scaleX
:
0.3
,
scaleY
:
0.3
},
500
,
egret
.
Ease
.
getBackOut
(
5
)).
call
(()
=>
{
egret
.
Tween
.
get
(
eggani
,
{
onChange
:
()
=>
{
const
p0
=
{
x
:
375
+
100
,
y
:
496
+
300
};
const
p1
=
{
x
:
375
+
100
,
y
:
496
};
const
p2
=
{
x
:
375
-
100
,
y
:
496
-
100
};
const
p0
=
{
x
:
375
+
100
,
y
:
496
+
300
};
const
p1
=
{
x
:
375
+
100
,
y
:
496
};
const
p2
=
{
x
:
375
-
100
,
y
:
496
-
100
};
const
value
=
eggani
[
'__xx__'
];
eggani
.
x
=
(
1
-
value
)
*
(
1
-
value
)
*
p0
.
x
+
2
*
value
*
(
1
-
value
)
*
p1
.
x
+
value
*
value
*
p2
.
x
;
eggani
.
y
=
(
1
-
value
)
*
(
1
-
value
)
*
p0
.
y
+
2
*
value
*
(
1
-
value
)
*
p1
.
y
+
value
*
value
*
p2
.
y
;
...
...
@@ -332,6 +338,10 @@ export default class StartScene extends Scene {
}
onTap_taskBtn
()
{
if
(
Date
.
now
()
>
window
[
'gameoverTime'
])
{
showToast
(
'本期音乐扭蛋机活动已结束,敬请期待下期活动~'
);
return
;
}
NetManager
.
ins
.
clickLog
(
this
.
getlogItem
(
2
));
PanelCtrl
.
instance
.
show
(
ExtraModuleNames
.
TASK_PANEL
);
}
...
...
@@ -339,13 +349,13 @@ export default class StartScene extends Scene {
onTap_widthdrawBtn
(
e
:
egret
.
Event
)
{
NetManager
.
ins
.
clickLog
(
this
.
getlogItem
(
3
));
console
.
log
(
'onTap_widthdrawBtn'
)
location
.
href
=
window
[
'withdrawLink'
];
location
.
href
=
window
[
'withdrawLink'
];
}
onTap_ruleBtn
(
e
:
egret
.
Event
)
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
}
onTap_recordBtn
(
e
:
egret
.
Event
)
{
window
.
location
.
href
=
TwFun
.
getRecordUrl
(
'01'
,[
4470
]);
window
.
location
.
href
=
TwFun
.
getRecordUrl
(
'01'
,
[
4470
]);
}
get
skinKey
()
{
return
'Start'
}
...
...
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