Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
wildfirecode13
xiaoxiaole
Commits
251bce34
Commit
251bce34
authored
Apr 23, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化暂存
parent
9ce49c8a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
388 additions
and
141 deletions
+388
-141
ComponentBase.ts
egret/libs/new_wx/components/ComponentBase.ts
+1
-1
sceneCtrl.ts
egret/libs/new_wx/ctrls/sceneCtrl.ts
+20
-19
MainScene.ts
egret/src/mainScene/MainScene.ts
+6
-6
MapScene.ts
egret/src/mapScene/MapScene.ts
+354
-110
genBlockDisplay.ts
egret/src/something/block/genBlockDisplay.ts
+3
-3
Element.ts
egret/src/something/class/Element.ts
+4
-2
No files found.
egret/libs/new_wx/components/ComponentBase.ts
View file @
251bce34
...
...
@@ -28,7 +28,7 @@ export default class ComponentBase extends eui.Component {
protected
onSkinComplete
()
{
}
destroy
()
{
this
.
removeEvents
();
}
...
...
egret/libs/new_wx/ctrls/sceneCtrl.ts
View file @
251bce34
...
...
@@ -26,6 +26,7 @@ export default class SceneCtrl {
}
change
(
type
:
ModuleTypes
,
data
?,
onComplete
?:
Function
)
{
// console.log("sceneCtrl------change",type,data,onComplete);
if
(
type
==
ModuleTypes
.
MAIN_SCENE
){
//游戏页
// console.log("游戏界面单例处理");
if
(
this
.
mainscene
){
...
...
@@ -47,25 +48,25 @@ export default class SceneCtrl {
}
}
}
//
else if(type==ModuleTypes.MAP_SCENE){//mapscene
//
if(this.mapscene){
//
console.log("单例mapscene");
//
this.showAfterLoadAtlas(this.mapscene,data,onComplete);
//
}else{
//
console.log("新建mapscene");
// this.mapscene = new MapScene(
);
//
if (!window['development']) {
//
const promise = Promise.all([
//
RES.getResAsync(`${'Map'}_json`),
//
RES.getResAsync(`${'Map'}_png`)]);
//
promise.then(() => {
//
this.showAfterLoadAtlas(this.mapscene, data, onComplete);
//
});
//
} else {
//
this.showAfterLoadAtlas(this.mapscene, data, onComplete);
//
}
//
}
//
}
else
if
(
type
==
ModuleTypes
.
MAP_SCENE
){
//mapscene
if
(
this
.
mapscene
){
//
console.log("单例mapscene");
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
}
else
{
//
console.log("新建mapscene");
this
.
mapscene
=
new
MapScene
(
data
);
if
(
!
window
[
'development'
])
{
const
promise
=
Promise
.
all
([
RES
.
getResAsync
(
`
${
'Map'
}
_json`
),
RES
.
getResAsync
(
`
${
'Map'
}
_png`
)]);
promise
.
then
(()
=>
{
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
});
}
else
{
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
}
}
}
else
{
const
cls
=
this
.
_sceneClassMap
[
type
];
const
scene
:
Scene
=
new
cls
();
...
...
egret/src/mainScene/MainScene.ts
View file @
251bce34
...
...
@@ -355,7 +355,7 @@ export default class MainScene extends Scene {
festivalContainer
:
egret
.
DisplayObjectContainer
;
constructor
(){
super
();
console
.
log
(
'mainscene-------constructor'
);
//
console.log('mainscene-------constructor');
window
[
'gm'
]
=
this
.
gm
;
//基础ui
//目标
...
...
@@ -451,7 +451,7 @@ export default class MainScene extends Scene {
super
.
start
();
this
.
resetMainScene
();
console
.
log
(
"mainscene---------start"
,
data
,
data
.
chapter
);
//
console.log("mainscene---------start",data,data.chapter);
// window['gm'] = this.gm;
//第几关
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
...
...
@@ -1045,7 +1045,7 @@ export default class MainScene extends Scene {
var
elements
=
this
.
chapterData
.
map
.
elements
||
Tool
.
setNumber01
(
this
.
chapterData
.
map
.
lattices
.
slice
());
//猩猩初始时加入
var
pongoArr
:
Array
<
{
tl
:
number
,
tr
:
number
,
bl
:
number
,
br
:
number
}
>
=
new
Array
();
console
.
log
(
"开始initElement"
,
this
.
chapter
);
//
console.log("开始initElement",this.chapter);
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
// console.log("initElement遍历-------",i);
//如果对应格子为空,直接跳过,
...
...
@@ -1462,7 +1462,7 @@ export default class MainScene extends Scene {
//侦听事件
initEvents
()
{
console
.
log
(
'mainscene-----------开始监听事件----initEvents'
);
//
console.log('mainscene-----------开始监听事件----initEvents');
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
settingBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
)
this
.
questionBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
...
...
@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene {
}
removeEvents
()
{
console
.
log
(
'mainscene-----移除事件监听------removeEvents'
);
//
console.log('mainscene-----移除事件监听------removeEvents');
this
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
settingBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
);
this
.
questionBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
...
...
@@ -5040,7 +5040,7 @@ export default class MainScene extends Scene {
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
0
]);
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
1
]);
}
console
.
log
(
"页面回收"
);
//
console.log("页面回收");
for
(
let
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
){
let
ilattice
=
this
.
lattices
[
i
];
if
(
!
ilattice
)
continue
;
...
...
egret/src/mapScene/MapScene.ts
View file @
251bce34
...
...
@@ -99,7 +99,7 @@ export default class MapScene extends Scene {
onLoad
()
{
super
.
onLoad
().
then
(()
=>
{
});
// console.log('mapScene----------onLoad');
function
hbRainBaseInfo
()
{
return
new
Promise
((
resolve
,
reject
)
=>
NetManager
.
ins
.
hbRainBaseInfo
(()
=>
resolve
()));
}
...
...
@@ -122,27 +122,25 @@ export default class MapScene extends Scene {
});
}
async
start
(
data
?)
{
super
.
start
();
this
.
addIcon
();
// 添加Icon
pic
:
egret
.
Bitmap
;
creatPic
(){
if
(
!
this
.
pic
){
let
light
=
RES
.
getRes
(
'lightani_png'
);
this
.
pic
=
new
egret
.
Bitmap
(
light
);
this
.
pic
.
anchorOffsetX
=
76
;
this
.
pic
.
anchorOffsetY
=
61
;
}
}
initMapScene
(){
// console.log('initMapScene--------------');
// 添加Icon
this
.
addIcon
();
this
.
hcRedBoobBaseInfo
();
this
.
updateSignBtn
();
this
.
updateMyInfo
();
this
.
updateAdData
();
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
// 查询邀请信息,控制邀请有礼角标
this
.
updateIconLayout
();
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
playBg
();
}
stopGamebg
();
NetManager
.
ins
.
getSignInfo
(()
=>
{
const
parmas
=
[];
const
panels
=
[];
...
...
@@ -242,31 +240,242 @@ export default class MapScene extends Scene {
}
},
window
[
'signActivityId'
]);
this
.
initSound
();
this
.
_data
=
data
;
//滚动的背景变黑
this
[
'rectbg'
].
height
=
this
.
stage
.
stageHeight
;
//进度条的遮罩
this
[
'progressfront'
].
mask
=
this
[
'rect'
];
this
[
'rect'
].
scaleX
=
0.5
this
[
'rect'
].
scaleX
=
0.5
;
//进度条文本发光
setGlow
(
this
[
'totalStarTxt'
],
0x0083e8
,
1
);
this
.
topPart
=
data
.
top
;
this
.
repeatsPart
=
data
.
list
;
this
.
bottomPart
=
data
.
bottom
;
this
.
topPart
=
this
.
_data
.
top
;
this
.
repeatsPart
=
this
.
_data
.
list
;
this
.
bottomPart
=
this
.
_data
.
bottom
;
this
.
scroll
.
height
=
this
.
stage
.
stageHeight
;
this
.
scrollGroup
.
addChild
(
data
.
top
);
this
.
scrollGroup
.
addChild
(
this
.
_
data
.
top
);
data
.
list
.
forEach
((
ele
,
index
)
=>
{
this
.
_
data
.
list
.
forEach
((
ele
,
index
)
=>
{
this
.
scrollGroup
.
addChild
(
ele
);
ele
.
y
=
data
.
top
.
height
+
(
index
*
ele
.
height
);
ele
.
y
=
this
.
_
data
.
top
.
height
+
(
index
*
ele
.
height
);
});
this
.
scrollGroup
.
addChild
(
this
.
_data
.
bottom
);
this
.
_data
.
bottom
.
y
=
this
.
_data
.
top
.
height
+
(
this
.
_data
.
list
.
length
*
this
.
_data
.
list
[
0
].
height
);
//下一个挑战关卡,水花动效
this
.
creatPic
();
setTimeout
(()
=>
{
try
{
const
key
=
'main2'
;
Promise
.
all
([
RES
.
getResAsync
(
`
${
key
}
_json`
),
RES
.
getResAsync
(
`
${
key
}
_png`
)]);
}
catch
(
error
)
{
}
// console.log("开始加载一系列资源");
RES
.
getResAsync
(
'candydis0_json'
);
RES
.
getResAsync
(
'candydis1_json'
);
RES
.
getResAsync
(
'candydis2_json'
);
RES
.
getResAsync
(
'candydis3_json'
);
RES
.
getResAsync
(
'candydis4_json'
);
RES
.
getResAsync
(
'candydie0_json'
);
RES
.
getResAsync
(
'candydie1_json'
);
RES
.
getResAsync
(
'candydie2_json'
);
RES
.
getResAsync
(
'candydie3_json'
);
RES
.
getResAsync
(
'candydie4_json'
);
RES
.
getResAsync
(
'candysub_json'
);
RES
.
getResAsync
(
'monsterState_json'
);
RES
.
getResAsync
(
'honeymc_json'
);
RES
.
getResAsync
(
'candydiebg_json'
);
RES
.
getResAsync
(
'redrainbg_jpg'
);
RES
.
getResAsync
(
'hbRule_bg_png'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/fish.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster0.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster4.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_dispear.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_change.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_bubble.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_standby.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_move.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_dis.svga'
);
// loadSvga(getResPath() + 'resource/assets/svgas/fireworks.svga');
// console.log("一系列资源加载完毕");
if
(
!
window
[
'development'
])
{
RES
.
getResAsync
(
`inviterulepanel_json`
);
}
},
20
*
1000
);
loadFireworks
();
}
this
.
scrollGroup
.
addChild
(
data
.
bottom
);
data
.
bottom
.
y
=
data
.
top
.
height
+
(
data
.
list
.
length
*
data
.
list
[
0
].
height
);
constructor
(
data
?){
super
();
this
.
_data
=
data
;
this
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
this
.
initMapScene
,
this
);
}
async
start
(
data
?)
{
// console.log("mapscene---------------start");
super
.
start
();
this
.
_avatarsCache
=
new
Array
();
// this.addIcon(); // 添加Icon
this
.
hcRedBoobBaseInfo
();
// this.updateSignBtn();
// this.updateMyInfo();
// this.updateAdData();
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
// 查询邀请信息,控制邀请有礼角标
this
.
updateIconLayout
();
// this['avatar'].mask = this['avatarMask'];
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
playBg
();
}
stopGamebg
();
// NetManager.ins.getSignInfo(() => {
// const parmas = [];
// const panels = [];
// const result = this.sendInvite(panels, parmas);
// if (result) {
// this.updateSign();
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// return;
// }
// const date = new Date();
// date.setHours(0, 0, 0, 0);
// const nowTimerStr = date.getTime() + '';
// const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
// const nowTimerStr2 = date.getTime() + '';
// const oldTimerStr2 = localStorage.getItem('nowTimer2Str' + window['CFG'].consumerId);
// const hc_advert = DataManager.ins.getData('hc_advert').data || {};
// let { noticeAdvert } = hc_advert;
// if (noticeAdvert == null) {
// noticeAdvert = { enable: false }
// }
// if (noticeAdvert && noticeAdvert.enable && nowTimerStr2 != oldTimerStr2) {
// // if (!adTag) {
// panels.push('ad');
// // adTag = true;
// // }
// localStorage.setItem('nowTimer2Str' + window['CFG'].consumerId, nowTimerStr2);
// }
// const backData = DataManager.ins.getData('hc_hasBackReward');
// if (backData.success) {
// backData.success = false;
// panels.push('BackIndex');
// }
// const { signInfoVO } = DataManager.ins.getData('getSignInfo');
// if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到
// if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr && getSignBtn()) {
// panels.push('sign');
// localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
// }
// }
// this.updateSign();
// // 红包雨强提示
// const hbRainRes = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
// if (hbRainRes.data) {
// if (hbRainRes.data.currentSession || hbRainRes.data.nextSession) {
// const sessionId = hbRainRes.data.currentSession ? hbRainRes.data.currentSession.sessionIndex : hbRainRes.data.nextSession.sessionIndex; // 场次ID
// const nowTimerStr3 = date.getTime() + sessionId + '';
// const oldTimerStr3 = localStorage.getItem('nowTimer3Str' + window['CFG'].consumerId);
// if (nowTimerStr3 != oldTimerStr3) {
// panels.push('HbCutTime');
// localStorage.setItem('nowTimer3Str' + window['CFG'].consumerId, nowTimerStr3);
// }
// }
// }
// // 任务中心可领奖强提示
// let canShow = localStorage.getItem('taskCenter' + window['CFG'].consumerId);
// if (canShow == 'true') {
// const taskInfoRes = DataManager.ins.getData(NetName.GET_TASKINFO);
// if (taskInfoRes && taskInfoRes.data && taskInfoRes.data.length > 0) {
// for (let i = 0; i < taskInfoRes.data.length; i++) {
// if (taskInfoRes.data[i].count > 0) {
// panels.push('task');
// break;
// }
// }
// }
// }
// localStorage.setItem('taskCenter' + window['CFG'].consumerId, 'false');
// let res = DataManager.ins.getData('hc_redBombBaseInfo');
// if (res && res.data) {
// let _t = res.data.redBombSwitchTime || "";
// if (res.data.remain > 0) {
// let showBomb = localStorage.getItem('showBomb' + window['CFG'].consumerId);
// if (showBomb != _t.toString() && _t != "") {
// localStorage.setItem('showBomb' + window['CFG'].consumerId, _t.toString());
// panels.push('BombTips2Panel');
// }
// }
// }
// if (!readCache() && getHomeData().levels.length <= 0) { //引导
// const guide = new GuideCon(() => {
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// });
// this.addChild(guide);
// guide.play(1)
// // console.log(guide)
// } else { //不用引导
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// }
// }, window['signActivityId']);
this
.
initSound
();
this
.
_data
=
data
;
//滚动的背景变黑
// this['rectbg'].height = this.stage.stageHeight;
// //进度条的遮罩
// this['progressfront'].mask = this['rect'];
// this['rect'].scaleX = 0.5
// //进度条文本发光
// setGlow(this['totalStarTxt'], 0x0083e8, 1);
// this.topPart = data.top;
// this.repeatsPart = data.list;
// this.bottomPart = data.bottom;
// console.log(data);
// this.scroll.height = this.stage.stageHeight;
// this.scrollGroup.addChild(data.top);
// data.list.forEach((ele, index) => {
// this.scrollGroup.addChild(ele);
// ele.y = data.top.height + (index * ele.height);
// });
// this.scrollGroup.addChild(data.bottom);
// data.bottom.y = data.top.height + (data.list.length * data.list[0].height);
let
target
;
const
homeData
=
getHomeData
();
...
...
@@ -296,21 +505,26 @@ export default class MapScene extends Scene {
}
// 当前关卡的水花动效
if
(
homeData
.
levels
.
length
<
window
[
'total_level'
])
{
const
targetIcon
=
MapScene
.
iconHash
[
target
];
const
light
=
RES
.
getRes
(
'lightani_png'
);
// console.log(homeData.levels,window['last_level'],target);
if
(
homeData
.
levels
.
length
<
window
[
'last_level'
])
{
// console.log("添加水花动画0000000000"
);
const
pic
=
this
[
'pic'
]
||
new
egret
.
Bitmap
(
light
);
//76 61
pic
.
x
=
targetIcon
.
x
+
50
;
pic
.
y
=
targetIcon
.
y
+
37
+
7
;
targetIcon
.
mappart
.
addChildAt
(
pic
,
1
);
this
.
creatPic
();
const
targetIcon
=
MapScene
.
iconHash
[
target
];
targetIcon
.
mappart
.
addChildAt
(
this
.
pic
,
1
);
// targetIcon.parent.addChildAt(pic, 0);
pic
.
anchorOffsetX
=
76
;
pic
.
anchorOffsetY
=
61
;
this
.
pic
.
x
=
targetIcon
.
x
+
50
;
this
.
pic
.
y
=
targetIcon
.
y
+
37
+
7
;
// pic.x = 50 - 2;
// pic.y = 37 + 10;
egret
.
Tween
.
get
(
pic
,
{
loop
:
true
}).
to
({
scaleX
:
2
,
scaleY
:
2
,
alpha
:
0
},
1000
).
wait
(
1000
);
this
[
'pic'
]
=
pic
;
egret
.
Tween
.
get
(
this
.
pic
,
{
loop
:
true
})
.
set
({
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
})
.
to
({
scaleX
:
2
,
scaleY
:
2
,
alpha
:
0
},
1000
).
wait
(
1000
);
}
...
...
@@ -336,70 +550,71 @@ export default class MapScene extends Scene {
}
},
this
);
//关于滚动,可以仅在第一次打开时自动滚到到最新位置,其余情况不动
let
lastOrder
=
homeData
.
levels
.
length
+
1
;
if
(
homeData
.
levels
.
length
>=
window
[
'total_level'
])
lastOrder
=
window
[
'total_level'
];
this
.
scroll
.
viewport
.
scrollV
=
this
.
getScrollV
(
lastOrder
,
this
.
stage
.
stageHeight
);
// console.warn(this.getScrollV(lastOrder, this.stage.stageHeight));
setTimeout
(()
=>
{
try
{
const
key
=
'main2'
;
Promise
.
all
([
RES
.
getResAsync
(
`
${
key
}
_json`
),
RES
.
getResAsync
(
`
${
key
}
_png`
)]);
}
catch
(
error
)
{
}
console
.
log
(
"开始加载一系列资源"
);
RES
.
getResAsync
(
'candydis0_json'
);
RES
.
getResAsync
(
'candydis1_json'
);
RES
.
getResAsync
(
'candydis2_json'
);
RES
.
getResAsync
(
'candydis3_json'
);
RES
.
getResAsync
(
'candydis4_json'
);
RES
.
getResAsync
(
'candydie0_json'
);
RES
.
getResAsync
(
'candydie1_json'
);
RES
.
getResAsync
(
'candydie2_json'
);
RES
.
getResAsync
(
'candydie3_json'
);
RES
.
getResAsync
(
'candydie4_json'
);
RES
.
getResAsync
(
'candysub_json'
);
RES
.
getResAsync
(
'monsterState_json'
);
RES
.
getResAsync
(
'honeymc_json'
);
RES
.
getResAsync
(
'candydiebg_json'
);
RES
.
getResAsync
(
'redrainbg_jpg'
);
RES
.
getResAsync
(
'hbRule_bg_png'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/fish.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster0.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster4.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_dispear.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_change.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/honeypot_bubble.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_standby.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_move.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_dis.svga'
);
// loadSvga(getResPath() + 'resource/assets/svgas/fireworks.svga');
console
.
log
(
"一系列资源加载完毕"
);
if
(
!
window
[
'development'
])
{
RES
.
getResAsync
(
`inviterulepanel_json`
);
}
},
20
*
1000
);
loadFireworks
();
//
setTimeout(() => {
//
try {
//
const key = 'main2';
//
Promise.all([
//
RES.getResAsync(`${key}_json`),
//
RES.getResAsync(`${key}_png`)]);
//
} catch (error) {
//
}
//
console.log("开始加载一系列资源");
//
RES.getResAsync('candydis0_json');
//
RES.getResAsync('candydis1_json');
//
RES.getResAsync('candydis2_json');
//
RES.getResAsync('candydis3_json');
//
RES.getResAsync('candydis4_json');
//
RES.getResAsync('candydie0_json');
//
RES.getResAsync('candydie1_json');
//
RES.getResAsync('candydie2_json');
//
RES.getResAsync('candydie3_json');
//
RES.getResAsync('candydie4_json');
//
RES.getResAsync('candysub_json');
//
RES.getResAsync('monsterState_json');
//
RES.getResAsync('honeymc_json');
//
RES.getResAsync('candydiebg_json');
//
RES.getResAsync('redrainbg_jpg');
//
RES.getResAsync('hbRule_bg_png');
//
loadSvga(getResPath() + 'resource/assets/svgas/fish.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster0.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster1.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster2.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster3.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster4.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/invite.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/monster.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot1.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot2.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot3.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_dispear.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_change.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/honeypot_bubble.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/sand_standby.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/sand_move.svga');
//
loadSvga(getResPath() + 'resource/assets/svgas/sand_dis.svga');
//
// loadSvga(getResPath() + 'resource/assets/svgas/fireworks.svga');
//
console.log("一系列资源加载完毕");
//
if (!window['development']) {
//
RES.getResAsync(`inviterulepanel_json`);
//
}
//
}, 20 * 1000);
//
loadFireworks();
this
.
scroll
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
...
...
@@ -526,14 +741,17 @@ export default class MapScene extends Scene {
}
destroy
()
{
// console.log("map销毁");
super
.
destroy
();
this
.
removeIcon
();
this
.
actIcon
.
destory
();
if
(
this
[
'pic'
])
{
egret
.
Tween
.
removeTweens
(
this
[
'pic'
]);
(
this
[
'pic'
].
parent
as
egret
.
DisplayObjectContainer
).
removeChild
(
this
[
'pic'
]);
// this.removeIcon();
// this.actIcon.destory();
if
(
this
.
pic
)
{
egret
.
Tween
.
removeTweens
(
this
.
pic
);
if
(
this
.
pic
.
parent
){
this
.
pic
.
parent
.
removeChild
(
this
.
pic
);
}
}
if
(
this
.
inviteTimer
)
{
...
...
@@ -1013,15 +1231,41 @@ export default class MapScene extends Scene {
this
[
'soundOffBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_sound
,
this
);
this
[
'musicOffBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_music
,
this
);
this
[
'musicBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_music
,
this
);
this
[
'recordBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
PanelCtrl
.
instance
.
show
(
'bag'
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
5
));
},
this
);
this
[
'recordBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
recordClick
,
this
);
// 消消乐查询信息
GDispatcher
.
addEvent
(
'getInviteInfo'
,
this
.
getInviteInfo
,
this
);
}
protected
removeEvents
(){
this
[
'goldBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_goldBtn
,
this
);
this
[
'guide'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_guide
,
this
);
// this['act2Btn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_act2btn, this);
this
[
'inviteBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_inviteBtn
,
this
);
this
[
'friendBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_friendBtn
,
this
);
this
[
'adBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_adBtn
,
this
);
this
[
'signBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_signBtn
,
this
);
this
[
'bloodBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_bloodBtn
,
this
);
this
[
'settingBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
toggleSettings
,
this
);
this
[
'shopBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shopBtn
,
this
);
this
[
'questionBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
);
this
[
'box'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_boxLayer
,
this
);
this
[
'boxani'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_box
,
this
);
this
[
'soundBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_sound
,
this
);
this
[
'soundOffBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_sound
,
this
);
this
[
'musicOffBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_music
,
this
);
this
[
'musicBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_music
,
this
);
this
[
'recordBtn'
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
recordClick
,
this
);
// 消消乐查询信息
GDispatcher
.
removeEvent
(
'getInviteInfo'
,
this
.
getInviteInfo
,
this
);
}
recordClick
(){
PanelCtrl
.
instance
.
show
(
'bag'
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
5
));
}
initSound
()
{
this
[
'soundBtn'
].
visible
=
getSoundOn
();
this
[
'soundOffBtn'
].
visible
=
!
getSoundOn
();
...
...
@@ -1074,7 +1318,7 @@ export default class MapScene extends Scene {
}
async
onTap_box
()
{
console
.
log
(
1
)
//
console.log(1)
// const data = getHomeData();
// if (data.canReceiveTreasureBoxNum > 0) {
this
[
'boxani'
].
touchEnabled
=
false
;
...
...
egret/src/something/block/genBlockDisplay.ts
View file @
251bce34
...
...
@@ -41,9 +41,9 @@ export default (type: LatticeType) => {
darkiceblock
=
new
BlockDarkIce
(
_state
,
LatticeType
.
BLOCK_AND_DARK_ICE
);
}
else
{
darkiceblock
.
_state
=
_state
;
iceblock
.
ice
.
alpha
=
1
;
iceblock
.
ice
.
visible
=
false
;
iceblock
.
iceCountNum
=
2
;
dark
iceblock
.
ice
.
alpha
=
1
;
dark
iceblock
.
ice
.
visible
=
false
;
dark
iceblock
.
iceCountNum
=
2
;
}
return
darkiceblock
;
default
:
...
...
egret/src/something/class/Element.ts
View file @
251bce34
...
...
@@ -262,12 +262,14 @@ export class Element extends eui.Component {
* @param part
*/
setPongoPart
(
part
:
string
){
this
.
showImage
.
alpha
=
0
;
this
.
inPongoPart
=
part
;
// console.log("我是猩猩的"+part);
if
(
part
==
"tl"
){
}
this
.
showImage
.
alpha
=
0.5
;
//
this.showImage.alpha = 0.5;
var
state
=
StateType
.
PongoLockState
;
if
(
this
.
hasState
(
state
)){
...
...
@@ -979,7 +981,7 @@ export class Element extends eui.Component {
if
(
this
.
_mv
&&
this
.
_mv
.
parent
){
this
.
_mv
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
_mvEnterFrame1
,
this
);
this
.
_mv
.
parent
.
removeChild
(
this
.
_mv
);
console
.
log
(
"有怪物"
,
type
);
//
console.log("有怪物",type);
}
if
(
this
.
_fireworks
&&
this
.
_fireworks
.
parent
){
this
.
_fireworks
.
parent
.
removeChild
(
this
.
_fireworks
);
...
...
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