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
Expand all
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 {
...
@@ -28,7 +28,7 @@ export default class ComponentBase extends eui.Component {
protected
onSkinComplete
()
{
protected
onSkinComplete
()
{
}
}
destroy
()
{
destroy
()
{
this
.
removeEvents
();
this
.
removeEvents
();
}
}
...
...
egret/libs/new_wx/ctrls/sceneCtrl.ts
View file @
251bce34
...
@@ -26,6 +26,7 @@ export default class SceneCtrl {
...
@@ -26,6 +26,7 @@ export default class SceneCtrl {
}
}
change
(
type
:
ModuleTypes
,
data
?,
onComplete
?:
Function
)
{
change
(
type
:
ModuleTypes
,
data
?,
onComplete
?:
Function
)
{
// console.log("sceneCtrl------change",type,data,onComplete);
if
(
type
==
ModuleTypes
.
MAIN_SCENE
){
//游戏页
if
(
type
==
ModuleTypes
.
MAIN_SCENE
){
//游戏页
// console.log("游戏界面单例处理");
// console.log("游戏界面单例处理");
if
(
this
.
mainscene
){
if
(
this
.
mainscene
){
...
@@ -47,25 +48,25 @@ export default class SceneCtrl {
...
@@ -47,25 +48,25 @@ export default class SceneCtrl {
}
}
}
}
}
}
//
else if(type==ModuleTypes.MAP_SCENE){//mapscene
else
if
(
type
==
ModuleTypes
.
MAP_SCENE
){
//mapscene
//
if(this.mapscene){
if
(
this
.
mapscene
){
//
console.log("单例mapscene");
//
console.log("单例mapscene");
//
this.showAfterLoadAtlas(this.mapscene,data,onComplete);
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
//
}else{
}
else
{
//
console.log("新建mapscene");
//
console.log("新建mapscene");
// this.mapscene = new MapScene(
);
this
.
mapscene
=
new
MapScene
(
data
);
//
if (!window['development']) {
if
(
!
window
[
'development'
])
{
//
const promise = Promise.all([
const
promise
=
Promise
.
all
([
//
RES.getResAsync(`${'Map'}_json`),
RES
.
getResAsync
(
`
${
'Map'
}
_json`
),
//
RES.getResAsync(`${'Map'}_png`)]);
RES
.
getResAsync
(
`
${
'Map'
}
_png`
)]);
//
promise.then(() => {
promise
.
then
(()
=>
{
//
this.showAfterLoadAtlas(this.mapscene, data, onComplete);
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
//
});
});
//
} else {
}
else
{
//
this.showAfterLoadAtlas(this.mapscene, data, onComplete);
this
.
showAfterLoadAtlas
(
this
.
mapscene
,
data
,
onComplete
);
//
}
}
//
}
}
//
}
}
else
{
else
{
const
cls
=
this
.
_sceneClassMap
[
type
];
const
cls
=
this
.
_sceneClassMap
[
type
];
const
scene
:
Scene
=
new
cls
();
const
scene
:
Scene
=
new
cls
();
...
...
egret/src/mainScene/MainScene.ts
View file @
251bce34
...
@@ -355,7 +355,7 @@ export default class MainScene extends Scene {
...
@@ -355,7 +355,7 @@ export default class MainScene extends Scene {
festivalContainer
:
egret
.
DisplayObjectContainer
;
festivalContainer
:
egret
.
DisplayObjectContainer
;
constructor
(){
constructor
(){
super
();
super
();
console
.
log
(
'mainscene-------constructor'
);
//
console.log('mainscene-------constructor');
window
[
'gm'
]
=
this
.
gm
;
window
[
'gm'
]
=
this
.
gm
;
//基础ui
//基础ui
//目标
//目标
...
@@ -451,7 +451,7 @@ export default class MainScene extends Scene {
...
@@ -451,7 +451,7 @@ export default class MainScene extends Scene {
super
.
start
();
super
.
start
();
this
.
resetMainScene
();
this
.
resetMainScene
();
console
.
log
(
"mainscene---------start"
,
data
,
data
.
chapter
);
//
console.log("mainscene---------start",data,data.chapter);
// window['gm'] = this.gm;
// window['gm'] = this.gm;
//第几关
//第几关
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
...
@@ -1045,7 +1045,7 @@ export default class MainScene extends Scene {
...
@@ -1045,7 +1045,7 @@ export default class MainScene extends Scene {
var
elements
=
this
.
chapterData
.
map
.
elements
||
Tool
.
setNumber01
(
this
.
chapterData
.
map
.
lattices
.
slice
());
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
();
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
++
)
{
for
(
let
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
// console.log("initElement遍历-------",i);
// console.log("initElement遍历-------",i);
//如果对应格子为空,直接跳过,
//如果对应格子为空,直接跳过,
...
@@ -1462,7 +1462,7 @@ export default class MainScene extends Scene {
...
@@ -1462,7 +1462,7 @@ export default class MainScene extends Scene {
//侦听事件
//侦听事件
initEvents
()
{
initEvents
()
{
console
.
log
(
'mainscene-----------开始监听事件----initEvents'
);
//
console.log('mainscene-----------开始监听事件----initEvents');
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
settingBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
)
this
.
settingBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
)
this
.
questionBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
this
.
questionBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
...
@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene {
...
@@ -1486,7 +1486,7 @@ export default class MainScene extends Scene {
}
}
removeEvents
()
{
removeEvents
()
{
console
.
log
(
'mainscene-----移除事件监听------removeEvents'
);
//
console.log('mainscene-----移除事件监听------removeEvents');
this
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
settingBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
);
this
.
settingBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_settingBtn
,
this
);
this
.
questionBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
this
.
questionBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
...
@@ -5040,7 +5040,7 @@ export default class MainScene extends Scene {
...
@@ -5040,7 +5040,7 @@ export default class MainScene extends Scene {
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
0
]);
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
0
]);
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
1
]);
egret
.
Tween
.
removeTweens
(
this
.
warningCop
[
1
]);
}
}
console
.
log
(
"页面回收"
);
//
console.log("页面回收");
for
(
let
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
){
let
ilattice
=
this
.
lattices
[
i
];
let
ilattice
=
this
.
lattices
[
i
];
if
(
!
ilattice
)
continue
;
if
(
!
ilattice
)
continue
;
...
...
egret/src/mapScene/MapScene.ts
View file @
251bce34
This diff is collapsed.
Click to expand it.
egret/src/something/block/genBlockDisplay.ts
View file @
251bce34
...
@@ -41,9 +41,9 @@ export default (type: LatticeType) => {
...
@@ -41,9 +41,9 @@ export default (type: LatticeType) => {
darkiceblock
=
new
BlockDarkIce
(
_state
,
LatticeType
.
BLOCK_AND_DARK_ICE
);
darkiceblock
=
new
BlockDarkIce
(
_state
,
LatticeType
.
BLOCK_AND_DARK_ICE
);
}
else
{
}
else
{
darkiceblock
.
_state
=
_state
;
darkiceblock
.
_state
=
_state
;
iceblock
.
ice
.
alpha
=
1
;
dark
iceblock
.
ice
.
alpha
=
1
;
iceblock
.
ice
.
visible
=
false
;
dark
iceblock
.
ice
.
visible
=
false
;
iceblock
.
iceCountNum
=
2
;
dark
iceblock
.
iceCountNum
=
2
;
}
}
return
darkiceblock
;
return
darkiceblock
;
default
:
default
:
...
...
egret/src/something/class/Element.ts
View file @
251bce34
...
@@ -262,12 +262,14 @@ export class Element extends eui.Component {
...
@@ -262,12 +262,14 @@ export class Element extends eui.Component {
* @param part
* @param part
*/
*/
setPongoPart
(
part
:
string
){
setPongoPart
(
part
:
string
){
this
.
showImage
.
alpha
=
0
;
this
.
inPongoPart
=
part
;
this
.
inPongoPart
=
part
;
// console.log("我是猩猩的"+part);
// console.log("我是猩猩的"+part);
if
(
part
==
"tl"
){
if
(
part
==
"tl"
){
}
}
this
.
showImage
.
alpha
=
0.5
;
//
this.showImage.alpha = 0.5;
var
state
=
StateType
.
PongoLockState
;
var
state
=
StateType
.
PongoLockState
;
if
(
this
.
hasState
(
state
)){
if
(
this
.
hasState
(
state
)){
...
@@ -979,7 +981,7 @@ export class Element extends eui.Component {
...
@@ -979,7 +981,7 @@ export class Element extends eui.Component {
if
(
this
.
_mv
&&
this
.
_mv
.
parent
){
if
(
this
.
_mv
&&
this
.
_mv
.
parent
){
this
.
_mv
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
_mvEnterFrame1
,
this
);
this
.
_mv
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
_mvEnterFrame1
,
this
);
this
.
_mv
.
parent
.
removeChild
(
this
.
_mv
);
this
.
_mv
.
parent
.
removeChild
(
this
.
_mv
);
console
.
log
(
"有怪物"
,
type
);
//
console.log("有怪物",type);
}
}
if
(
this
.
_fireworks
&&
this
.
_fireworks
.
parent
){
if
(
this
.
_fireworks
&&
this
.
_fireworks
.
parent
){
this
.
_fireworks
.
parent
.
removeChild
(
this
.
_fireworks
);
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