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
4e4f00de
Commit
4e4f00de
authored
Dec 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
727383da
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1535 additions
and
24 deletions
+1535
-24
index.html
egret/index.html
+2
-2
MainScene.ts
egret/src/mainScene/MainScene.ts
+12
-6
BaseBlock.ts
egret/src/something/block/BaseBlock.ts
+18
-11
genBlockDisplay.ts
egret/src/something/block/genBlockDisplay.ts
+11
-3
Chapter12.ts
egret/src/something/chapters/Chapter12.ts
+370
-0
Chapter13.ts
egret/src/something/chapters/Chapter13.ts
+88
-0
getChapter.ts
egret/src/something/chapters/getChapter.ts
+2
-0
AiControl.ts
egret/src/something/logic/AiControl.ts
+1
-1
home.json
mock/happyclear/home.json
+1031
-1
No files found.
egret/index.html
View file @
4e4f00de
...
@@ -133,8 +133,8 @@
...
@@ -133,8 +133,8 @@
];
];
// localStorage.clear();
// localStorage.clear();
window
[
'imgver'
]
=
'11112'
window
[
'imgver'
]
=
'11112'
window
[
'total_level'
]
=
18
+
13
*
1
6
;
window
[
'total_level'
]
=
18
+
13
*
1
8
;
window
[
'last_level'
]
=
2
25
;
//必须大于等于total_level
window
[
'last_level'
]
=
2
50
;
//必须大于等于total_level
// localStorage.clear();
// localStorage.clear();
...
...
egret/src/mainScene/MainScene.ts
View file @
4e4f00de
...
@@ -935,6 +935,7 @@ export default class MainScene extends Scene {
...
@@ -935,6 +935,7 @@ export default class MainScene extends Scene {
var
ele
=
e
.
target
.
parent
var
ele
=
e
.
target
.
parent
if
(
ele
instanceof
Element
&&
if
(
ele
instanceof
Element
&&
// ele.type != ElementType.ROCK &&
// ele.type != ElementType.ROCK &&
!
ele
.
hasState
(
StateType
.
BLOCK_LOCK
)
&&
//石门无法消除
ele
.
type
!=
ElementType
.
LOLLIPOP
)
{
ele
.
type
!=
ElementType
.
LOLLIPOP
)
{
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
,
this
);
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
,
this
);
var
index
=
ele
.
index
;
var
index
=
ele
.
index
;
...
@@ -1799,14 +1800,14 @@ export default class MainScene extends Scene {
...
@@ -1799,14 +1800,14 @@ export default class MainScene extends Scene {
/**
/**
* 掉落完后的操作
* 掉落完后的操作
*/
*/
fallCallback
()
{
async
fallCallback
()
{
//掉落后有消除,执行消除
//掉落后有消除,执行消除
if
(
this
.
threeMatch
())
{
if
(
this
.
threeMatch
())
{
this
.
eliminate
()
this
.
eliminate
()
return
return
}
}
//消除结束之后检查石门
//消除结束之后检查石门
this
.
checkAllBlock
();
await
this
.
checkAllBlock
();
//鸡蛋的ai操作,存在判断三消,毛球的ai,也一样,所以放前面,存在三消时都直接执行eliminate了。不执行后续的回调
//鸡蛋的ai操作,存在判断三消,毛球的ai,也一样,所以放前面,存在三消时都直接执行eliminate了。不执行后续的回调
AiControl
.
ins
.
eggMotion
(
this
,
()
=>
{
AiControl
.
ins
.
eggMotion
(
this
,
()
=>
{
//后执行毛球跳动
//后执行毛球跳动
...
@@ -1886,9 +1887,14 @@ export default class MainScene extends Scene {
...
@@ -1886,9 +1887,14 @@ export default class MainScene extends Scene {
}
}
checkAllBlock
()
{
checkAllBlock
()
{
this
.
lattices
.
filter
(
item
=>
item
.
block
).
forEach
((
item
)
=>
{
// this.lattices.filter(item => item.block).forEach((item) => {
item
.
block
.
nextState
();
// item.block.nextState();
});
// });
return
Promise
.
all
(
this
.
lattices
.
filter
(
item
=>
item
.
block
).
map
((
item
)
=>
{
return
item
.
block
.
nextState
();
})
)
}
}
/**
/**
* 果冻蔓延和气泡变色需要重新检查死图
* 果冻蔓延和气泡变色需要重新检查死图
...
@@ -2132,7 +2138,7 @@ export default class MainScene extends Scene {
...
@@ -2132,7 +2138,7 @@ export default class MainScene extends Scene {
//暂时笼子不算个数,算的话,改图片名称,列入ElementType的状态下
//暂时笼子不算个数,算的话,改图片名称,列入ElementType的状态下
}
}
else
if
(
ele
.
hasState
(
StateType
.
BLOCK_LOCK
))
{
else
if
(
ele
.
hasState
(
StateType
.
BLOCK_LOCK
))
{
ele
.
setState
(
StateType
.
BLOCK_LOCK
,
false
);
//这里不需要消除石门上的元素的状态,石门上的元素状态只由石门来修改
}
}
//有褐色毛球的,记录分裂激活
//有褐色毛球的,记录分裂激活
else
if
(
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
))
{
else
if
(
ele
.
hasState
(
StateType
.
HAIRBALLBROWN
))
{
...
...
egret/src/something/block/BaseBlock.ts
View file @
4e4f00de
...
@@ -3,8 +3,9 @@ import { Element } from "../class/Element";
...
@@ -3,8 +3,9 @@ import { Element } from "../class/Element";
import
{
StateType
}
from
"../enum/StateType"
;
import
{
StateType
}
from
"../enum/StateType"
;
export
default
class
BaseBlock
extends
egret
.
DisplayObjectContainer
{
export
default
class
BaseBlock
extends
egret
.
DisplayObjectContainer
{
constructor
()
{
constructor
(
state
)
{
super
();
super
();
this
.
_state
=
state
;
this
.
initUI
();
this
.
initUI
();
}
}
...
@@ -35,11 +36,13 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
...
@@ -35,11 +36,13 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
private
_element
:
Element
;
private
_element
:
Element
;
set
element
(
val
:
Element
)
{
set
element
(
val
:
Element
)
{
if
(
this
.
_element
)
{
this
.
_element
.
setState
(
StateType
.
BLOCK_LOCK
,
false
);
this
.
_element
=
null
;
}
if
(
val
)
{
if
(
val
)
{
this
.
_element
=
val
;
this
.
_element
=
val
;
this
.
updateElementState
();
//刚刚设置元素的时候
this
.
updateElementState
();
//刚刚设置元素的时候
}
else
{
}
}
};
};
...
@@ -52,24 +55,29 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
...
@@ -52,24 +55,29 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
return
this
.
_state
>=
3
;
return
this
.
_state
>=
3
;
}
}
isLock
()
{
return
this
.
_state
<=
2
;
}
//状态0红门 1蓝门 2黄门 3红 4黄 5蓝
//状态0红门 1蓝门 2黄门 3红 4黄 5蓝
private
_state
=
-
1
;
private
_state
=
-
1
;
private
_changing
=
false
;
private
_changing
=
false
;
nextState
(
first
=
false
)
{
async
nextState
(
first
=
false
)
{
//先改数据再改视图
//先改数据再改视图
this
.
_state
++
;
this
.
_state
++
;
if
(
this
.
_state
>
5
)
if
(
this
.
_state
>
5
)
this
.
_state
=
0
;
this
.
_state
=
0
;
this
.
changeState
(
first
);
await
this
.
changeState
(
first
);
}
}
private
updateElementState
()
{
private
updateElementState
()
{
if
(
!
this
.
_element
)
return
;
if
(
this
.
_state
<=
2
)
{
if
(
this
.
_state
<=
2
)
{
this
.
_element
.
scaleX
=
0
;
this
.
_element
.
scaleX
=
0
;
this
.
_element
.
setState
(
StateType
.
BLOCK_LOCK
,
true
);
this
.
_element
.
setState
(
StateType
.
BLOCK_LOCK
,
true
);
}
else
{
}
else
{
this
.
_element
.
scaleX
=
1
;
this
.
_element
.
scaleX
=
1
;
this
.
_element
.
setState
(
StateType
.
BLOCK_LOCK
,
false
);
this
.
_element
.
setState
(
StateType
.
BLOCK_LOCK
,
false
);
}
}
}
}
...
@@ -137,7 +145,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
...
@@ -137,7 +145,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
case
0
:
case
0
:
if
(
!
first
)
{
if
(
!
first
)
{
await
this
.
playToBackAni
();
await
this
.
playToBackAni
();
this
.
updateElementState
();
this
.
updateElementState
();
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgFront
.
scaleX
=
1
;
this
.
_blockBgFront
.
scaleX
=
1
;
}
else
{
}
else
{
...
@@ -158,7 +166,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
...
@@ -158,7 +166,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
break
;
break
;
case
3
:
//翻转了
case
3
:
//翻转了
await
this
.
playToFrontAni
();
await
this
.
playToFrontAni
();
this
.
updateElementState
();
this
.
updateElementState
();
this
.
_block
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_block
.
scaleX
=
1
;
this
.
_block
.
scaleX
=
1
;
this
.
_blockBgRed
.
visible
=
true
;
this
.
_blockBgRed
.
visible
=
true
;
...
@@ -198,6 +206,5 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
...
@@ -198,6 +206,5 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
egret
.
Tween
.
get
(
obj
,
{
loop
:
true
}).
set
({
alpha
:
0
})
egret
.
Tween
.
get
(
obj
,
{
loop
:
true
}).
set
({
alpha
:
0
})
.
to
({
alpha
:
1
},
dur
).
to
({
alpha
:
0
},
dur
)
.
to
({
alpha
:
1
},
dur
).
to
({
alpha
:
0
},
dur
)
.
to
({
alpha
:
1
},
dur
).
to
({
alpha
:
0
},
dur
)
.
to
({
alpha
:
1
},
dur
).
to
({
alpha
:
0
},
dur
)
// .wait(dur * 3);
}
}
}
}
\ No newline at end of file
egret/src/something/block/genBlockDisplay.ts
View file @
4e4f00de
...
@@ -4,13 +4,21 @@ import BlockDarkIce from "./BlockDarkIce";
...
@@ -4,13 +4,21 @@ import BlockDarkIce from "./BlockDarkIce";
import
BlockIce
from
"./BlockIce"
;
import
BlockIce
from
"./BlockIce"
;
export
default
(
type
:
LatticeType
)
=>
{
export
default
(
type
:
LatticeType
)
=>
{
const
typestr
=
type
+
''
;
let
_state
=
-
1
;
if
(
typestr
.
length
==
2
)
{
//是门开
const
arr
=
typestr
.
split
(
''
);
type
=
parseInt
(
arr
[
0
]);
// _state=-1;
_state
=
2
;
}
switch
(
type
)
{
switch
(
type
)
{
case
LatticeType
.
BlOCK
:
case
LatticeType
.
BlOCK
:
return
new
Block
();
return
new
Block
(
_state
);
case
LatticeType
.
BLOCK_AND_ICE
:
case
LatticeType
.
BLOCK_AND_ICE
:
return
new
BlockIce
();
return
new
BlockIce
(
_state
);
case
LatticeType
.
BLOCK_AND_DARK_ICE
:
case
LatticeType
.
BLOCK_AND_DARK_ICE
:
return
new
BlockDarkIce
();
return
new
BlockDarkIce
(
_state
);
default
:
default
:
break
;
break
;
...
...
egret/src/something/chapters/Chapter12.ts
View file @
4e4f00de
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/Chapter13.ts
0 → 100644
View file @
4e4f00de
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/getChapter.ts
View file @
4e4f00de
...
@@ -14,6 +14,7 @@ import { PassTargetData } from "../interface/PassTargetData";
...
@@ -14,6 +14,7 @@ import { PassTargetData } from "../interface/PassTargetData";
import
{
PassType
}
from
"../enum/PassType"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
submitTran
}
from
"../enum/ElementType"
;
import
{
submitTran
}
from
"../enum/ElementType"
;
import
{
Chapters12
}
from
"./Chapter12"
;
import
{
Chapters12
}
from
"./Chapter12"
;
import
{
Chapters13
}
from
"./Chapter13"
;
//所有的关卡
//所有的关卡
const
chapters
:
ChapterData
[]
=
[].
concat
(
const
chapters
:
ChapterData
[]
=
[].
concat
(
...
@@ -29,6 +30,7 @@ const chapters: ChapterData[] = [].concat(
...
@@ -29,6 +30,7 @@ const chapters: ChapterData[] = [].concat(
Chapters10
,
Chapters10
,
Chapters11
,
Chapters11
,
Chapters12
,
Chapters12
,
Chapters13
,
)
)
/**
/**
* 获取关卡数据,返回关卡数据
* 获取关卡数据,返回关卡数据
...
...
egret/src/something/logic/AiControl.ts
View file @
4e4f00de
...
@@ -362,7 +362,7 @@ export class AiControl {
...
@@ -362,7 +362,7 @@ export class AiControl {
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
var
lat
=
thisObj
.
lattices
[
i
];
var
lat
=
thisObj
.
lattices
[
i
];
//是基础元素,有气泡状态
//是基础元素,有气泡状态
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
lat
.
element
.
hasState
(
StateType
.
BUBBLE
))
{
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
lat
.
element
.
hasState
(
StateType
.
BUBBLE
)
&&
(
!
lat
.
block
||
!
lat
.
block
.
isLock
())
)
{
indexs
.
push
(
i
);
indexs
.
push
(
i
);
}
}
}
}
...
...
mock/happyclear/home.json
View file @
4e4f00de
This diff is collapsed.
Click to expand it.
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