Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
wfc13
Commits
ec0044b8
Commit
ec0044b8
authored
Aug 09, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
0f544424
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
900 additions
and
183 deletions
+900
-183
index.html
project/index.html
+1
-1
Main.ts
project/src/Main.ts
+1
-1
ResJson.ts
project/src/ResJson.ts
+898
-14
LoadingScene.ts
project/src/template/LoadingScene.ts
+0
-79
StartScene.ts
project/src/template/StartScene.ts
+0
-88
No files found.
project/index.html
View file @
ec0044b8
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
<!-- 构建的js -->
<!-- 构建的js -->
<script
src=
"output.js"
crossorigin=
"anonymous"
></script>
<script
src=
"output.js"
crossorigin=
"anonymous"
></script>
<!-- <script src="https://yun.duiba.com.cn/db_games/activity/template/162849
3535
/output.js" crossorigin="anonymous"></script> -->
<!-- <script src="https://yun.duiba.com.cn/db_games/activity/template/162849
4686
/output.js" crossorigin="anonymous"></script> -->
...
...
project/src/Main.ts
View file @
ec0044b8
...
@@ -73,7 +73,7 @@ export class Main {
...
@@ -73,7 +73,7 @@ export class Main {
//显示场景
//显示场景
if
(
isShare
())
{
if
(
isShare
())
{
changeScene
(
ShareScene
,
{
query
:
getQueryParams
()
}
);
changeScene
(
ShareScene
);
}
else
{
}
else
{
const
alreadyAcquiredResult
=
await
sendWebNet
(
WebNetName
.
alreadyAcquired
)
const
alreadyAcquiredResult
=
await
sendWebNet
(
WebNetName
.
alreadyAcquired
)
...
...
project/src/ResJson.ts
View file @
ec0044b8
This diff is collapsed.
Click to expand it.
project/src/template/LoadingScene.ts
deleted
100644 → 0
View file @
0f544424
import
{
changeScene
}
from
"../../module/ctrls"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
ProgressBarS
}
from
"../common/ProgressBarS"
;
import
getObject
from
"../getObject"
;
import
{
getWebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
StartScene
}
from
"./StartScene"
;
export
class
LoadingScene
extends
Scene
{
get
groupNames
()
{
return
[
"loading"
]
}
get
skinName
()
{
return
"loading"
}
progressBar
:
ProgressBarS
;
initUi
()
{
// //进度条
var
pro
=
getObject
(
this
,
'loading_progressfront'
);
console
.
log
(
pro
)
//进度条托管
this
.
progressBar
=
new
ProgressBarS
(
pro
);
}
async
start
()
{
super
.
start
()
console
.
log
(
this
)
//监听进度条事件
this
.
addEventListener
(
FYGE
.
Event
.
PROGRESS
,
this
.
progressEvent
,
this
)
//首次进度一点
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.2
)
//做些啥?
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.3
);
// 接口示例
// var res1 = await sendWebNet(WebNetName.index)
// //做些啥?
// if (!res1.success) return
//判断是否结束
//
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.5
);
//资源1
await
RES
.
loadGroup
(
"StartScene"
)
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.6
);
//资源2
// await RES.loadGroup("mapCrabEffect")
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.7
);
//资源
// await RES
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.8
);
//随便异步示例
await
new
Promise
((
r
)
=>
{
setTimeout
(
r
,
100
)
})
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
1
);
}
progressEvent
(
e
:
FYGE
.
Event
)
{
let
pro
=
e
.
data
;
FYGE
.
Tween
.
removeTweens
(
this
.
progressBar
)
FYGE
.
Tween
.
get
(
this
.
progressBar
)
.
to
({
value
:
pro
},
2000
)
.
call
(()
=>
{
if
(
pro
>=
1
)
{
this
.
removeEventListener
(
FYGE
.
Event
.
PROGRESS
,
this
.
progressEvent
,
this
);
// changeScene(StartScene,getWebData(WebNetName.index).data)
}
})
}
}
project/src/template/StartScene.ts
deleted
100644 → 0
View file @
0f544424
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
showPanel
,
showWaiting
,
hideWaiting
,
showToast
,
changeScene
}
from
"../../module/ctrls"
;
import
{
RulePanel
}
from
"../panels/rule"
;
import
{
Tools
}
from
"../Tools"
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
G_EVENT
}
from
"../common/G_EVENT"
;
import
{
PlayScene
}
from
"./PlayScene"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
StartScene
extends
Scene
{
get
groupNames
()
{
return
[
"StartScene"
]
}
get
skinName
()
{
return
"StartScene"
}
taskBtn
:
FYGE
.
Button
;
lotBtn
:
FYGE
.
Button
;
rankBtn
:
FYGE
.
Button
;
timesTxt
:
FYGE
.
TextField
;
startBtn
:
FYGE
.
Button
;
ruleBtn
:
FYGE
.
Button
;
recordBtn
:
FYGE
.
Button
;
initUi
()
{
// this.y -= layers.stageOffsetY;
//次数文案居中
Tools
.
changeTextAlign
(
this
.
timesTxt
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
300
);
//加滚动
if
(
layers
.
stageHeight
<
1624
)
{
var
scroll
=
new
FYGE
.
ScrollPage
(
750
,
layers
.
stageHeight
,
1624
-
layers
.
stageOffsetY
,
true
,
true
)
// 所有内容加入滚动
// this.children.forEach((c)=>{ //这种方式有问题,因为子级的索引
// scroll.view.addChild(c);
// })
scroll
.
view
.
addChildren
(...
this
.
removeChildren
());
// scroll.view.addChildren.apply(scroll.view,this.removeChildren())
// //滚动加入加入父级
this
.
addChild
(
scroll
);
}
}
async
start
(
data
)
{
super
.
start
()
//次数文案修改
this
.
timesTxt
.
text
=
"剩余次数:"
+
this
.
data
.
gameCounts
+
"次"
;
}
initEvents
()
{
super
.
initEvents
();
//开始游戏
// this.startBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => {
// showWaiting();
// var res = await sendWebNet(WebNetName)
// hideWaiting();
// if (res.success) {
// changeScene(PlayScene, { ...res.data });
// } else {
// //TODO
// }
// }, this)
//规则按钮
this
.
ruleBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
showPanel
(
RulePanel
)
},
this
)
//我的奖品按钮
this
.
recordBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
//弄个延时
Tools
.
btnDelay
(
this
.
recordBtn
)
//跳转,链接待定
location
.
href
=
window
[
"recordUrl"
];
},
this
)
//排行榜按钮
this
.
rankBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
console
.
log
(
"点击了排行榜弹框"
)
},
this
)
//任务弹框
this
.
taskBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
console
.
log
(
"点击了任务弹框"
)
},
this
)
//监听下次数修改
GDispatcher
.
addEventListener
(
G_EVENT
.
UPDATE_SCENE
,
this
.
updateScene
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
//移除次数监听
GDispatcher
.
removeEventListener
(
G_EVENT
.
UPDATE_SCENE
,
this
.
updateScene
,
this
);
//其他的按钮事件不写了,没存引用,反正destroy会把挂在场景上的所有显示对象的事件都清除
}
}
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