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
09997e13
Commit
09997e13
authored
May 06, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草坪暂存
parent
93fd0008
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
220 additions
and
452 deletions
+220
-452
index.html
egret/index.html
+2
-2
MainScene.ts
egret/src/mainScene/MainScene.ts
+19
-6
doSandAI.ts
egret/src/mainScene/doSandAI.ts
+2
-1
Tool.ts
egret/src/something/Tool.ts
+6
-0
BaseBlock.ts
egret/src/something/block/BaseBlock.ts
+16
-0
BlockGrass.ts
egret/src/something/block/BlockGrass.ts
+13
-0
genBlockDisplay.ts
egret/src/something/block/genBlockDisplay.ts
+15
-0
Chapter28.ts
egret/src/something/chapters/Chapter28.ts
+15
-440
getChapter.ts
egret/src/something/chapters/getChapter.ts
+4
-2
LatticeType.ts
egret/src/something/enum/LatticeType.ts
+1
-1
RecoverName.ts
egret/src/something/enum/RecoverName.ts
+2
-0
home.json
mock/happyclear/home.json
+125
-0
No files found.
egret/index.html
View file @
09997e13
...
...
@@ -127,8 +127,8 @@
// localStorage.clear();
window
[
'imgver'
]
=
'11112'
;
//top 8 ,repeat 22 , bottom 3
window
[
'total_level'
]
=
8
+
3
+
22
*
3
2
;
window
[
'last_level'
]
=
7
00
;
window
[
'total_level'
]
=
8
+
3
+
22
*
3
3
;
window
[
'last_level'
]
=
7
25
;
var
sharePic
=
document
.
getElementById
(
'pic'
);
sharePic
.
onclick
=
function
()
{
...
...
egret/src/mainScene/MainScene.ts
View file @
09997e13
...
...
@@ -1128,7 +1128,7 @@ export default class MainScene extends Scene {
latticeDisplay
=
getSandDisplayBlock
();
}
this
.
lattices
[
i
].
sand
=
latticeDisplay
as
Sand
;
}
else
if
(
isGrass
(
latticesD
[
i
])){
//草坪,在石门关闭状态下是否显示
}
else
if
(
onlyGrass
(
latticesD
[
i
])){
//单草坪
latticeDisplay
=
Pool
.
takeOut
(
RecoverName
.
GRASS
);
if
(
!
latticeDisplay
){
latticeDisplay
=
new
Grass
();
...
...
@@ -1137,7 +1137,14 @@ export default class MainScene extends Scene {
}
else
{
latticeDisplay
=
genBlockDisplay
(
latticesD
[
i
]);
this
.
lattices
[
i
].
block
=
latticeDisplay
as
BaseBlock
;
let
latticeblock
=
latticeDisplay
as
BaseBlock
;
this
.
lattices
[
i
].
block
=
latticeblock
;
if
(
isGrass
(
latticesD
[
i
])){
this
.
lattices
[
i
].
grass
=
latticeblock
.
grass
;
console
.
log
(
"石门上的grass"
,
i
,
this
.
lattices
[
i
].
grass
);
}
}
if
(
latticeDisplay
)
{
this
.
mapupContainer
.
addChild
(
latticeDisplay
);
...
...
@@ -1934,6 +1941,7 @@ export default class MainScene extends Scene {
// }
var
grassArr
=
new
Array
();
var
canturgrass
=
this
.
judgeTurfing
(
index
);
console
.
log
(
"能够蔓延出去"
,
canturgrass
);
//新增石头阻挡
var
elimitarr
=
this
.
getEliPassCannoStone
(
rc
[
0
],
rc
[
1
]);
for
(
var
j
=
0
;
j
<
elimitarr
.
length
;
j
++
){
...
...
@@ -6055,10 +6063,15 @@ export default class MainScene extends Scene {
grassDisplay
=
new
Grass
();
}
lat
.
grass
=
grassDisplay
;
this
.
mapupContainer
.
addChild
(
grassDisplay
);
var
grasspos
=
Tool
.
getPositionByIndex
(
index
);
grassDisplay
.
x
=
grasspos
[
0
];
grassDisplay
.
y
=
grasspos
[
1
];
if
(
lat
.
block
){
lat
.
block
.
grass
=
grassDisplay
;
lat
.
block
.
addChild
(
grassDisplay
);
}
else
{
this
.
mapupContainer
.
addChild
(
grassDisplay
);
var
grasspos
=
Tool
.
getPositionByIndex
(
index
);
grassDisplay
.
x
=
grasspos
[
0
];
grassDisplay
.
y
=
grasspos
[
1
];
}
// }
}
}
...
...
egret/src/mainScene/doSandAI.ts
View file @
09997e13
...
...
@@ -71,7 +71,8 @@ const judgeActionIndex = (index: number, lattices: Lattice[],worms:number[][]):
!
lattices
[
i
].
ice
&&
!
lattices
[
i
].
grass
&&
!
lattices
[
i
].
element
.
monster
&&
!
Tool
.
judgeInWormHole
(
i
,
worms
)
!
Tool
.
judgeInWormHole
(
i
,
worms
)
&&
!
lattices
[
i
].
grass
)
||
(
lattices
[
i
]
&&
lattices
[
i
].
element
&&
lattices
[
i
].
element
.
inPongoPart
)
//猩猩支持流沙
)
{
...
...
egret/src/something/Tool.ts
View file @
09997e13
...
...
@@ -1318,15 +1318,19 @@ export class Tool {
//判断草坪能否铺出去,炮台铺草坪另算
public
static
judgeTurfing
(
lat
:
Lattice
){
if
(
!
lat
||!
lat
.
element
){
console
.
log
(
"铺出去111111111111"
);
return
false
;
}
if
(
lat
.
ice
&&
lat
.
ice
.
alpha
!=
0
){
console
.
log
(
"铺出去222222222222"
);
return
false
;
}
if
(
lat
.
block
&&
lat
.
block
.
ice
&&
lat
.
block
.
canIceBroken
&&
lat
.
block
.
ice
.
alpha
!=
0
)
{
console
.
log
(
"铺出去333333333"
);
return
false
;
}
if
(
lat
.
sand
){
console
.
log
(
"铺出去44444444444"
);
return
false
;
}
let
ele
=
lat
.
element
;
...
...
@@ -1337,9 +1341,11 @@ export class Tool {
}
else
if
(
ele
.
type
==
ElementType
.
Pongo
&&!
ele
.
hasState
(
StateType
.
PongoLockState
)){
return
true
;
}
console
.
log
(
"铺出去55555555555555"
);
return
false
;
}
if
(
!
lat
.
grass
){
console
.
log
(
"铺出去66666666666666"
);
return
false
;
}
return
true
;
...
...
egret/src/something/block/BaseBlock.ts
View file @
09997e13
...
...
@@ -2,6 +2,7 @@ import centerAnchor from "./centerAnchor";
import
{
Element
}
from
"../class/Element"
;
import
{
StateType
}
from
"../enum/StateType"
;
import
{
LatticeType
}
from
"../enum/LatticeType"
;
import
{
Grass
}
from
"../class/Grass"
;
export
default
class
BaseBlock
extends
egret
.
DisplayObjectContainer
{
_inited
=
false
;
...
...
@@ -55,6 +56,7 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
iceCountNum
?:
number
;
ice
:
egret
.
Bitmap
;
grass
:
Grass
;
/**
* 石门反转了可以消除了
*/
...
...
@@ -103,6 +105,11 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this
.
ice
.
scaleX
=
0
;
egret
.
Tween
.
get
(
this
.
ice
).
to
({
scaleX
:
1
},
dur
);
}
if
(
this
.
grass
){
this
.
grass
.
visible
=
true
;
this
.
grass
.
scaleX
=
0
;
egret
.
Tween
.
get
(
this
.
grass
).
to
({
scaleX
:
1
},
dur
);
}
if
(
this
.
_element
)
{
this
.
_element
.
scaleX
=
0
;
egret
.
Tween
.
get
(
this
.
_element
).
to
({
scaleX
:
1
},
dur
);
...
...
@@ -132,6 +139,11 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this
.
ice
.
scaleX
=
1
;
egret
.
Tween
.
get
(
this
.
ice
).
to
({
scaleX
:
0
},
dur
);
}
if
(
this
.
grass
){
this
.
grass
.
visible
=
true
;
this
.
grass
.
scaleX
=
1
;
egret
.
Tween
.
get
(
this
.
grass
).
to
({
scaleX
:
0
},
dur
);
}
if
(
this
.
_element
)
{
this
.
_element
.
scaleX
=
1
;
egret
.
Tween
.
get
(
this
.
_element
).
to
({
scaleX
:
0
},
dur
);
...
...
@@ -187,6 +199,10 @@ export default class BaseBlock extends egret.DisplayObjectContainer {
this
.
ice
.
visible
=
true
;
this
.
ice
.
scaleX
=
1
;
}
if
(
this
.
grass
){
this
.
grass
.
visible
=
true
;
this
.
grass
.
scaleX
=
1
;
}
if
(
this
.
_element
){
this
.
_element
.
visible
=
true
;
this
.
_element
.
scaleX
=
1
;
...
...
egret/src/something/block/BlockGrass.ts
0 → 100644
View file @
09997e13
import
BaseBlock
from
"./BaseBlock"
;
import
{
Grass
}
from
"../class/Grass"
;
export
default
class
BlockGrass
extends
BaseBlock
{
initUI
(){
super
.
initUI
();
this
.
grass
=
new
Grass
();
this
.
addChild
(
this
.
grass
);
this
.
grass
.
visible
=
false
;
}
}
\ No newline at end of file
egret/src/something/block/genBlockDisplay.ts
View file @
09997e13
...
...
@@ -4,6 +4,7 @@ import BlockDarkIce from "./BlockDarkIce";
import
BlockIce
from
"./BlockIce"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
BlockGrass
from
"./BlockGrass"
;
export
default
(
type
:
LatticeType
)
=>
{
const
typestr
=
type
+
''
;
...
...
@@ -61,6 +62,20 @@ export default (type: LatticeType) => {
}
return
darkiceblock
;
case
LatticeType
.
BLOCK_AND_GRASS
:
let
grassblock
=
Pool
.
takeOut
(
RecoverName
.
GRASS_BLOCK
);
if
(
!
grassblock
){
grassblock
=
new
BlockGrass
(
_state
,
LatticeType
.
BLOCK_AND_GRASS
);
}
else
{
grassblock
.
_state
=
_state
;
grassblock
.
nextState
(
true
);
}
if
(
grassblock
.
_state
==
0
||
grassblock
.
_state
==
1
||
grassblock
.
_state
==
2
){
grassblock
.
grass
.
visible
=
false
;
}
else
{
grassblock
.
grass
.
visible
=
true
;
}
return
grassblock
;
default
:
break
;
}
...
...
egret/src/something/chapters/Chapter28.ts
View file @
09997e13
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/getChapter.ts
View file @
09997e13
...
...
@@ -29,6 +29,7 @@ import { Chapters24 } from "./Chapter24";
import
{
Chapters25
}
from
"./Chapter25"
;
import
{
Chapters26
}
from
"./Chapter26"
;
import
{
Chapters27
}
from
"./Chapter27"
;
import
{
Chapters28
}
from
"./Chapter28"
;
//所有的关卡
const
chapters
:
ChapterData
[]
=
[].
concat
(
Chapters1
,
...
...
@@ -57,7 +58,8 @@ const chapters: ChapterData[] = [].concat(
Chapters24
,
Chapters25
,
Chapters26
,
Chapters27
Chapters27
,
Chapters28
)
// console.log(chapters)
chapters
.
forEach
((
chapter
,
index
)
=>
{
...
...
@@ -78,7 +80,7 @@ chapters.forEach((chapter,index) => {
*/
export
function
getChapterData
(
index
:
number
):
ChapterData
{
//没有数据就返回第一关数据
return
chapters
[
676
];
return
chapters
[
701
];
return
chapters
[
index
]
||
chapters
[
1
];
}
...
...
egret/src/something/enum/LatticeType.ts
View file @
09997e13
...
...
@@ -42,5 +42,5 @@ export const onlyGrass = (type:LatticeType)=>{
return
type
==
LatticeType
.
GRASS
;
}
export
const
isGrass
=
(
type
:
LatticeType
)
=>
{
return
type
==
LatticeType
.
GRASS
||
type
==
LatticeType
.
BLOCK_AND_GRASS
;
return
type
==
LatticeType
.
GRASS
||
type
==
LatticeType
.
BLOCK_AND_GRASS
||
type
==
Number
(
LatticeType
.
BLOCK_AND_GRASS
+
"1"
)
;
}
\ No newline at end of file
egret/src/something/enum/RecoverName.ts
View file @
09997e13
...
...
@@ -92,4 +92,6 @@ export enum RecoverName {
CANNOLIGHT
=
'CANNOLIGHT'
,
//炮台聚能
GRASS
=
'GRASS'
,
GRASS_BLOCK
=
'GRASS_BLOCK'
,
}
\ No newline at end of file
mock/happyclear/home.json
View file @
09997e13
...
...
@@ -3513,6 +3513,131 @@
"levelNum"
:
700
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
701
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
702
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
703
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
704
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
705
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
706
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
707
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
708
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
709
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
710
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
711
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
712
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
713
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
714
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
715
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
716
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
717
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
718
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
719
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
720
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
721
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
722
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
723
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
724
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
725
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
"remainProp"
:
[
...
...
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