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
2f3ce460
Commit
2f3ce460
authored
Mar 12, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
83405de5
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
258 additions
and
18 deletions
+258
-18
arrowbg.png
egret/resource/assets/mainScene/arrowbg.png
+0
-0
createSandDisAni.ts
egret/src/effect/createSandDisAni.ts
+2
-2
MainScene.ts
egret/src/mainScene/MainScene.ts
+1
-1
doConveyorAI.ts
egret/src/mainScene/doConveyorAI.ts
+104
-4
doSandAI.ts
egret/src/mainScene/doSandAI.ts
+1
-1
jellyMonsterAI.ts
egret/src/mainScene/jellyMonsterAI.ts
+2
-2
jellyMonsterAni.ts
egret/src/mainScene/jellyMonsterAni.ts
+2
-2
Chapter20 copy.ts
egret/src/something/chapters/Chapter20 copy.ts
+7
-0
Chapter20.ts
egret/src/something/chapters/Chapter20.ts
+81
-1
Candy.ts
egret/src/something/class/Candy.ts
+4
-0
Element.ts
egret/src/something/class/Element.ts
+6
-0
cloneElement.ts
egret/src/something/cloneElement.ts
+27
-0
conveyorTool.ts
egret/src/something/conveyor/conveyorTool.ts
+11
-0
AiControl.ts
egret/src/something/logic/AiControl.ts
+7
-2
hbRainBaseInfo.json
mock/happyclear/hbRainBaseInfo.json
+3
-3
No files found.
egret/resource/assets/mainScene/arrowbg.png
View replaced file @
83405de5
View file @
2f3ce460
5.76 KB
|
W:
|
H:
7.41 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/src/effect/createSandDisAni.ts
View file @
2f3ce460
...
@@ -4,8 +4,8 @@ import { loadSvga } from "../loadSvga";
...
@@ -4,8 +4,8 @@ import { loadSvga } from "../loadSvga";
export
const
createSandDisAni
=
async
(
x
,
y
,
p
)
=>
{
export
const
createSandDisAni
=
async
(
x
,
y
,
p
)
=>
{
const
movieclip
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_dis.svga'
);
const
movieclip
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sand_dis.svga'
);
p
.
addChild
(
movieclip
);
p
.
addChild
(
movieclip
);
movieclip
.
anchorOffsetX
=
100
;
movieclip
.
anchorOffsetX
=
100
;
movieclip
.
anchorOffsetY
=
100
;
movieclip
.
anchorOffsetY
=
100
;
// movieclip.scaleX=movieclip.scaleY=0.5;
// movieclip.scaleX=movieclip.scaleY=0.5;
movieclip
.
x
=
x
;
movieclip
.
x
=
x
;
movieclip
.
y
=
y
;
movieclip
.
y
=
y
;
...
...
egret/src/mainScene/MainScene.ts
View file @
2f3ce460
...
@@ -698,7 +698,7 @@ export default class MainScene extends Scene {
...
@@ -698,7 +698,7 @@ export default class MainScene extends Scene {
var
connectedLat
=
connectedLats
[
i
];
var
connectedLat
=
connectedLats
[
i
];
if
(
!
connectedLat
||
!
connectedLat
.
length
)
continue
;
if
(
!
connectedLat
||
!
connectedLat
.
length
)
continue
;
if
(
!
this
.
lattices
[
connectedLat
[
0
]])
{
if
(
!
this
.
lattices
[
connectedLat
[
0
]])
{
throw
new
Error
(
'联通干了个空的@沈豪洲(牛奶) '
+
JSON
.
stringify
(
connectedLat
))
throw
new
Error
(
'联通干了个空的@沈豪洲(牛奶) '
+
JSON
.
stringify
(
connectedLat
))
}
}
try
{
try
{
this
.
lattices
[
connectedLat
[
0
]].
down
=
connectedLat
[
1
];
this
.
lattices
[
connectedLat
[
0
]].
down
=
connectedLat
[
1
];
...
...
egret/src/mainScene/doConveyorAI.ts
View file @
2f3ce460
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
ConveyorAni
,
{
getConveyorAni
}
from
"../something/conveyor/ConveyorAni"
;
import
ConveyorAni
,
{
getConveyorAni
}
from
"../something/conveyor/ConveyorAni"
;
import
{
ARROW_DIR
,
fillConveyor
,
findTarget
,
getArrowDir
}
from
"../something/conveyor/conveyorTool"
;
import
{
ARROW_DIR
,
fillConveyor
,
findTarget
,
getArrowDir
,
getOneConveyorMask
,
getElementMask
}
from
"../something/conveyor/conveyorTool"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Tool
}
from
"../something/Tool"
;
import
MainScene
from
"./MainScene"
;
import
MainScene
from
"./MainScene"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
cloneElement
from
"../something/cloneElement"
;
export
const
CONVERYOR_ANI_DUR
=
500
;
export
const
CONVERYOR_ANI_DUR
=
500
;
const
getTargetIndexs
=
(
conveyor
:
number
[])
=>
{
const
getTargetIndexs
=
(
conveyor
:
number
[])
=>
{
const
dir
=
getArrowDir
(
conveyor
);
const
dir
=
getArrowDir
(
conveyor
);
...
@@ -15,9 +17,71 @@ const getTargetIndexs = (conveyor: number[]) => {
...
@@ -15,9 +17,71 @@ const getTargetIndexs = (conveyor: number[]) => {
return
list
;
return
list
;
}
}
const
getLastListIndex
=
(
conveyor
)
=>
{
const
dir
=
getArrowDir
(
conveyor
);
const
list
=
fillConveyor
(
conveyor
);
switch
(
dir
)
{
case
ARROW_DIR
.
DOWN
:
case
ARROW_DIR
.
RIGHT
:
return
list
.
length
-
1
case
ARROW_DIR
.
UP
:
case
ARROW_DIR
.
LEFT
:
return
0
;
}
};
const
getLastPosition
=
(
conveyor
,
p
)
=>
{
const
dir
=
getArrowDir
(
conveyor
);
switch
(
dir
)
{
case
ARROW_DIR
.
DOWN
:
p
[
1
]
+=
Tool
.
height
;
break
;
case
ARROW_DIR
.
RIGHT
:
p
[
0
]
+=
Tool
.
height
;
break
;
case
ARROW_DIR
.
UP
:
p
[
1
]
-=
Tool
.
height
;
break
;
case
ARROW_DIR
.
LEFT
:
p
[
0
]
-=
Tool
.
height
;
break
;
};
return
p
;
}
const
getFirstPosition
=
(
conveyor
,
p
)
=>
{
const
dir
=
getArrowDir
(
conveyor
);
switch
(
dir
)
{
case
ARROW_DIR
.
DOWN
:
p
[
1
]
-=
Tool
.
height
;
break
;
case
ARROW_DIR
.
RIGHT
:
p
[
0
]
-=
Tool
.
height
;
break
;
case
ARROW_DIR
.
UP
:
p
[
1
]
+=
Tool
.
height
;
break
;
case
ARROW_DIR
.
LEFT
:
p
[
0
]
+=
Tool
.
height
;
break
;
};
return
p
;
}
const
getTargetConveyor
=
(
thisObj
:
MainScene
,
targetIndex
:
number
)
=>
{
const
conveyors
=
thisObj
.
chapterData
.
map
.
conveyor
;
for
(
const
conveyor
of
conveyors
)
{
if
(
targetIndex
==
conveyor
[
0
]
||
targetIndex
==
conveyor
[
1
])
return
conveyor
;
}
};
export
default
async
(
thisObj
:
MainScene
)
=>
{
export
default
async
(
thisObj
:
MainScene
)
=>
{
//移动的动画,如果是两头的需要一个带遮罩的动画,会涉及元素的复制
//移动的动画,如果是两头的需要一个带遮罩的动画,会涉及元素的复制
//复制的元素为了保险,只做动画用。
//检查与其他元素的兼容性,比如带有svga的独眼怪、果冻怪等等
//检查与其他元素的兼容性,比如带有svga的独眼怪、果冻怪等等
//糖果兼容
const
{
elementContainer
}
=
thisObj
;
const
conveyorList
=
thisObj
.
chapterData
.
map
.
conveyor
;
const
conveyorList
=
thisObj
.
chapterData
.
map
.
conveyor
;
if
(
!
conveyorList
)
return
;
if
(
!
conveyorList
)
return
;
const
elementsList
=
[];
//所有轨道元素组的列表
const
elementsList
=
[];
//所有轨道元素组的列表
...
@@ -59,17 +123,53 @@ export default async (thisObj: MainScene) => {
...
@@ -59,17 +123,53 @@ export default async (thisObj: MainScene) => {
lattices
.
forEach
(
lat
=>
lat
.
element
=
null
);
lattices
.
forEach
(
lat
=>
lat
.
element
=
null
);
});
});
const
promiseList
:
Promise
<
any
>
[]
=
[];
const
promiseList
:
Promise
<
any
>
[]
=
[];
elementsList
.
forEach
((
elements
,
i
)
=>
{
elementsList
.
forEach
((
elements
,
i
)
=>
{
const
conveyor
=
conveyorList
[
i
];
const
targetLattices
=
targetLatticesList
[
i
];
const
targetLattices
=
targetLatticesList
[
i
];
const
targetIndexs
=
targetIndexsList
[
i
];
const
targetIndexs
=
targetIndexsList
[
i
];
const
lattices
=
latticesList
[
i
];
const
lattices
=
latticesList
[
i
];
const
lastListIndex
=
getLastListIndex
(
conveyor
);
elements
.
forEach
((
ele
,
eleIndex
)
=>
{
elements
.
forEach
((
ele
,
eleIndex
)
=>
{
targetLattices
[
eleIndex
].
element
=
ele
;
targetLattices
[
eleIndex
].
element
=
ele
;
if
(
!
ele
)
return
;
const
targetP
=
Tool
.
getPositionByIndex
(
targetIndexs
[
eleIndex
]);
const
targetP
=
Tool
.
getPositionByIndex
(
targetIndexs
[
eleIndex
]);
const
promise
=
new
Promise
((
r
)
=>
{
const
promise
=
new
Promise
((
r
)
=>
{
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
CONVERYOR_ANI_DUR
).
call
(
r
);
//这里判断哪个是尾部的元素.
//移动尾部的真实的元素,clone一个尾部元素作为头部动画,头部动画播放完成后用真实的元素替换掉
if
(
lastListIndex
==
eleIndex
)
{
//轨道最后一个需要用遮罩动画,如果底部没有地图了,那么可以不遮罩
const
lastItemTargetP
=
getLastPosition
(
conveyor
,
[
ele
.
x
,
ele
.
y
]);
const
mask
=
getElementMask
(
ele
.
x
,
ele
.
y
);
elementContainer
.
addChild
(
mask
);
ele
.
mask
=
mask
;
egret
.
Tween
.
get
(
ele
).
to
({
x
:
lastItemTargetP
[
0
],
y
:
lastItemTargetP
[
1
]
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
ele
.
x
=
targetP
[
0
];
ele
.
y
=
targetP
[
1
];
elementContainer
.
removeChild
(
mask
);
ele
.
mask
=
null
;
r
();
});
//clone元素的动画
const
targetIndex
=
targetIndexs
[
eleIndex
];
const
targetConveyor
=
getTargetConveyor
(
thisObj
,
targetIndex
)
const
firstItemTargetP
=
getFirstPosition
(
targetConveyor
,
[
targetP
[
0
],
targetP
[
1
]]);
const
clonedElement
=
cloneElement
(
ele
);
clonedElement
.
x
=
firstItemTargetP
[
0
];
clonedElement
.
y
=
firstItemTargetP
[
1
];
const
mask2
=
getElementMask
(
targetP
[
0
],
targetP
[
1
]);
elementContainer
.
addChild
(
mask2
);
clonedElement
.
mask
=
mask2
;
elementContainer
.
addChild
(
clonedElement
);
egret
.
Tween
.
get
(
clonedElement
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
CONVERYOR_ANI_DUR
).
call
(()
=>
{
elementContainer
.
removeChild
(
mask2
);
elementContainer
.
removeChild
(
clonedElement
);
clonedElement
.
mask
=
null
;
});
}
else
{
egret
.
Tween
.
get
(
ele
).
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
]
},
CONVERYOR_ANI_DUR
).
call
(
r
);
}
});
});
promiseList
.
push
(
promise
)
promiseList
.
push
(
promise
)
});
});
...
@@ -77,7 +177,7 @@ export default async (thisObj: MainScene) => {
...
@@ -77,7 +177,7 @@ export default async (thisObj: MainScene) => {
for
(
const
key
in
thisObj
[
'conveyorAniList'
])
{
for
(
const
key
in
thisObj
[
'conveyorAniList'
])
{
if
(
thisObj
[
'conveyorAniList'
].
hasOwnProperty
(
key
))
{
if
(
thisObj
[
'conveyorAniList'
].
hasOwnProperty
(
key
))
{
const
ani
:
ConveyorAni
=
thisObj
[
'conveyorAniList'
][
key
];
const
ani
:
ConveyorAni
=
thisObj
[
'conveyorAniList'
][
key
];
ani
.
play
();
ani
.
play
();
}
}
}
}
...
...
egret/src/mainScene/doSandAI.ts
View file @
2f3ce460
...
@@ -42,7 +42,7 @@ export default async (thisObj: MainScene) => {
...
@@ -42,7 +42,7 @@ export default async (thisObj: MainScene) => {
sandMoveAni
=
new
SandMoveAni
();
sandMoveAni
=
new
SandMoveAni
();
}
}
thisObj
.
map
.
addChild
(
sandMoveAni
);
thisObj
.
map
.
addChild
(
sandMoveAni
);
promiseList
.
push
(
sandMoveAni
.
play
(
from
,
p
,
sand
));
promiseList
.
push
(
sandMoveAni
.
play
(
from
,
p
,
sand
));
// sands.push(sand);
// sands.push(sand);
}
}
}
}
...
...
egret/src/mainScene/jellyMonsterAI.ts
View file @
2f3ce460
...
@@ -73,10 +73,10 @@ function judgeActionIndex(index: number, lattices: Lattice[]): number {
...
@@ -73,10 +73,10 @@ function judgeActionIndex(index: number, lattices: Lattice[]): number {
var
rand
=
Math
.
floor
(
Math
.
random
()
*
arr
.
length
);
//随机4个方向
var
rand
=
Math
.
floor
(
Math
.
random
()
*
arr
.
length
);
//随机4个方向
var
i
=
arr
.
splice
(
rand
,
1
)[
0
];
var
i
=
arr
.
splice
(
rand
,
1
)[
0
];
if
(
Tool
.
judgeBaseEle
(
lattices
[
i
])
&&
if
(
Tool
.
judgeBaseEle
(
lattices
[
i
])
&&
!
lattices
[
i
].
element
.
hasAnyState
()
!
lattices
[
i
].
element
.
hasAnyState
()
&&
!
lattices
[
i
].
element
.
candy
&&
!
lattices
[
i
].
element
.
candy
&&
!
lattices
[
i
].
element
.
monster
&&
!
lattices
[
i
].
element
.
monster
)
{
)
{
return
i
return
i
}
}
}
}
...
...
egret/src/mainScene/jellyMonsterAni.ts
View file @
2f3ce460
...
@@ -17,10 +17,10 @@ export default (thisobj: MainScene, from: number[], to: number[]) => {
...
@@ -17,10 +17,10 @@ export default (thisobj: MainScene, from: number[], to: number[]) => {
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
)
.
wait
(
300
)
.
wait
(
300
)
.
set
({
anchorOffsetY
:
tex
.
textureHeight
/
2
,
y
:
from
[
1
]
+
20
-
tex
.
textureHeight
/
2
})
.
set
({
anchorOffsetY
:
tex
.
textureHeight
/
2
,
y
:
from
[
1
]
+
20
-
tex
.
textureHeight
/
2
})
.
to
({
x
:
to
[
0
],
y
:
to
[
1
]},
500
)
.
to
({
x
:
to
[
0
],
y
:
to
[
1
]
},
500
)
.
to
({
scaleX
:
0.9
,
scaleY
:
1.1
},
100
)
.
to
({
scaleX
:
0.9
,
scaleY
:
1.1
},
100
)
.
to
({
scaleX
:
1.05
,
scaleY
:
0.95
},
100
)
.
to
({
scaleX
:
1.05
,
scaleY
:
0.95
},
100
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
call
(()
=>
{
.
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
call
(()
=>
{
thisobj
.
removeChild
(
pic
);
thisobj
.
removeChild
(
pic
);
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
egret/src/something/chapters/Chapter20 copy.ts
0 → 100644
View file @
2f3ce460
import
{
ChapterData
}
from
"../interface/ChapterData"
;
import
{
PassType
}
from
"../enum/PassType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//501-525
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
25
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
2
,
count
:
88
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
],
connectedLats
:
[[
31
,
49
]],
conveyor
:
[[
24
,
60
],
[
59
,
56
],
[
47
,
20
]],
conveyorConnectedLats
:
[[
60
,
59
],
[
56
,
47
],
[
20
,
24
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
12
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
13
,
type
:
null
}]
}
}
]
\ No newline at end of file
egret/src/something/chapters/Chapter20.ts
View file @
2f3ce460
...
@@ -3,5 +3,85 @@ import { PassType } from "../enum/PassType";
...
@@ -3,5 +3,85 @@ import { PassType } from "../enum/PassType";
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//501-525
//501-525
export
const
Chapters20
:
ChapterData
[]
=
[
export
const
Chapters20
:
ChapterData
[]
=
[
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
25
,
passTarget
:
{
type
:
1
,
elements
:
[
{
type
:
2
,
count
:
88
}
]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
],
connectedLats
:
[
[
31
,
49
]
],
conveyor
:
[
[
24
,
60
],
[
59
,
56
],
[
47
,
20
]
],
conveyorConnectedLats
:
[
[
60
,
59
],
[
56
,
47
],
[
20
,
24
]
],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
12
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[
{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
13
,
type
:
null
}
]
}
}
{
baseElementTypes
:
[
0
,
1
,
2
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
999
,
passTarget
:
{
type
:
PassType
.
ELEMENT_TARGET
,
elements
:
[
{
type
:
ElementType
.
CHICKEN
,
count
:
995
,
},
],
},
starScores
:
[
1000
,
5000
,
10000
],
map
:
{
lattices
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
conveyor
:
[
// [29,56],
// [51, 33],
[
29
,
56
],
[
57
,
60
],
[
51
,
33
],
[
32
,
30
],
// [57,60],
// [32, 30],
],
conveyorConnectedLats
:
[
// [56,51],
// [33,29],
[
56
,
57
],
[
60
,
51
],
[
33
,
32
],
[
30
,
29
],
// [60,32],
// [30,57],
],
generateLats
:
[
{
index
:
11
,
type
:
[
0
],
cus
:
[]
},
{
index
:
15
,
type
:
[
0
],
cus
:
[]
},
],
// connectedLats: [[76, 11]],
elements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
11
,
11
,
11
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
],
// recycles: [70, 71, 72, 73]
},
}
]
]
\ No newline at end of file
egret/src/something/class/Candy.ts
View file @
2f3ce460
...
@@ -2,6 +2,10 @@ import { CandyBaseElementType } from "../enum/ElementType";
...
@@ -2,6 +2,10 @@ import { CandyBaseElementType } from "../enum/ElementType";
import
{
Element
}
from
"./Element"
;
import
{
Element
}
from
"./Element"
;
export
class
Candy
extends
egret
.
Sprite
{
export
class
Candy
extends
egret
.
Sprite
{
resetStep
(
step
:
number
)
{
this
.
_step
=
step
;
this
.
changeText
();
}
ele
:
Element
;
ele
:
Element
;
nextState
():
any
{
nextState
():
any
{
return
new
Promise
(
async
(
r
)
=>
{
return
new
Promise
(
async
(
r
)
=>
{
...
...
egret/src/something/class/Element.ts
View file @
2f3ce460
...
@@ -418,6 +418,7 @@ export class Element extends eui.Component {
...
@@ -418,6 +418,7 @@ export class Element extends eui.Component {
* @param type 只应该是基础元素和特殊元素
* @param type 只应该是基础元素和特殊元素
*/
*/
reset
(
type
:
ElementType
)
{
reset
(
type
:
ElementType
)
{
this
.
_isMonsterJelly
=
false
;
this
.
_isNeb
=
false
;
this
.
_isNeb
=
false
;
this
.
alpha
=
this
.
scaleX
=
this
.
scaleY
=
1
;
this
.
alpha
=
this
.
scaleX
=
this
.
scaleY
=
1
;
this
.
showImage
.
anchorOffsetX
=
0
;
this
.
showImage
.
anchorOffsetX
=
0
;
...
@@ -488,6 +489,7 @@ export class Element extends eui.Component {
...
@@ -488,6 +489,7 @@ export class Element extends eui.Component {
resetType
(
type
:
ElementType
)
{
resetType
(
type
:
ElementType
)
{
//如果类型一致,return
//如果类型一致,return
if
(
this
.
_type
==
type
)
return
if
(
this
.
_type
==
type
)
return
this
.
_isMonsterJelly
=
false
;
//如果目标类型不是基础元素 或者原先不是基础元素
//如果目标类型不是基础元素 或者原先不是基础元素
if
(
FiveBaseElementTypes
.
indexOf
(
type
)
==
-
1
||
if
(
FiveBaseElementTypes
.
indexOf
(
type
)
==
-
1
||
FiveBaseElementTypes
.
indexOf
(
this
.
_type
)
==
-
1
FiveBaseElementTypes
.
indexOf
(
this
.
_type
)
==
-
1
...
@@ -644,6 +646,10 @@ export class Element extends eui.Component {
...
@@ -644,6 +646,10 @@ export class Element extends eui.Component {
return
this
.
states
[
state
]
return
this
.
states
[
state
]
}
}
getStates
():
any
{
return
this
.
states
;
}
/**
/**
* 克隆一个
* 克隆一个
* 类型
* 类型
...
...
egret/src/something/cloneElement.ts
0 → 100644
View file @
2f3ce460
import
{
Tool
}
from
"./Tool"
;
import
{
Element
}
from
"./class/Element"
;
export
default
(
fromElement
:
Element
)
=>
{
let
ele
=
Tool
.
getElement
(
fromElement
.
type
);
//特效加上
ele
.
effectType
=
fromElement
.
effectType
;
//状态加上
for
(
var
i
=
0
;
i
<
fromElement
.
getStates
().
length
;
i
++
)
{
let
state
=
fromElement
.
getStates
()[
i
];
if
(
!
state
)
continue
;
ele
.
setState
(
i
,
true
,
fromElement
.
type
)
}
//位置信息
ele
.
x
=
fromElement
.
x
;
ele
.
y
=
fromElement
.
y
;
if
(
fromElement
.
isMonsterJelly
)
{
ele
.
isMonsterJelly
=
true
;
}
if
(
fromElement
.
candy
)
{
ele
.
resetToCandyView
(
fromElement
.
candy
.
baseElement
);
ele
.
candy
.
resetStep
(
fromElement
.
candy
.
step
);
}
return
ele
;
}
\ No newline at end of file
egret/src/something/conveyor/conveyorTool.ts
View file @
2f3ce460
...
@@ -121,4 +121,15 @@ export const getOneConveyorMask = (list: number[], dir) => {
...
@@ -121,4 +121,15 @@ export const getOneConveyorMask = (list: number[], dir) => {
s
.
graphics
.
endFill
();
s
.
graphics
.
endFill
();
}
}
return
s
;
return
s
;
}
export
const
getElementMask
=
(
x
,
y
)
=>
{
const
shape
=
new
egret
.
Shape
();
shape
.
x
=
x
;
shape
.
y
=
y
;
shape
.
graphics
.
beginFill
(
0
,
1
);
shape
.
graphics
.
drawRect
(
-
Tool
.
width
/
2
,
-
Tool
.
width
/
2
,
Tool
.
width
,
Tool
.
height
);
shape
.
graphics
.
endFill
();
return
shape
;
}
}
\ No newline at end of file
egret/src/something/logic/AiControl.ts
View file @
2f3ce460
...
@@ -78,6 +78,10 @@ export class AiControl {
...
@@ -78,6 +78,10 @@ export class AiControl {
this
.
hasFesEleBig
=
judgeFesEleBigExist
(
lattices
)
this
.
hasFesEleBig
=
judgeFesEleBigExist
(
lattices
)
}
}
updateEggs
(
lattices
:
Lattice
[])
{
this
.
eggs
=
getEggs
(
lattices
);
}
fesEleMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
fesEleMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
//无节日大红包,直接回调,
//无节日大红包,直接回调,
if
(
!
this
.
hasFesEleBig
)
{
if
(
!
this
.
hasFesEleBig
)
{
...
@@ -300,6 +304,7 @@ export class AiControl {
...
@@ -300,6 +304,7 @@ export class AiControl {
* @param callback
* @param callback
*/
*/
eggMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
eggMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
this
.
updateEggs
(
thisObj
.
lattices
);
//无蛋,直接回调
//无蛋,直接回调
if
(
!
this
.
eggs
.
length
)
{
if
(
!
this
.
eggs
.
length
)
{
callback
();
callback
();
...
@@ -743,10 +748,10 @@ function judgeActionIndex(index: number, lattices: Lattice[]): number {
...
@@ -743,10 +748,10 @@ function judgeActionIndex(index: number, lattices: Lattice[]): number {
var
rand
=
Math
.
floor
(
Math
.
random
()
*
arr
.
length
);
var
rand
=
Math
.
floor
(
Math
.
random
()
*
arr
.
length
);
var
i
=
arr
.
splice
(
rand
,
1
)[
0
];
var
i
=
arr
.
splice
(
rand
,
1
)[
0
];
if
(
Tool
.
judgeBaseEle
(
lattices
[
i
])
&&
if
(
Tool
.
judgeBaseEle
(
lattices
[
i
])
&&
!
lattices
[
i
].
element
.
hasAnyState
()
&&
!
lattices
[
i
].
element
.
hasAnyState
()
&&
!
lattices
[
i
].
element
.
candy
&&
!
lattices
[
i
].
element
.
candy
&&
!
lattices
[
i
].
element
.
monster
!
lattices
[
i
].
element
.
monster
)
{
)
{
return
i
return
i
}
}
}
}
...
...
mock/happyclear/hbRainBaseInfo.json
View file @
2f3ce460
...
@@ -5,18 +5,18 @@
...
@@ -5,18 +5,18 @@
"timestamp"
:
1573210800000
,
"timestamp"
:
1573210800000
,
"data"
:
{
"data"
:
{
"currentRemainTimes"
:
0
,
"currentRemainTimes"
:
0
,
"currentSession
1
"
:
{
"currentSession"
:
{
"sessionIndex"
:
6
,
"sessionIndex"
:
6
,
"startTime"
:
1573210800000
,
"startTime"
:
1573210800000
,
"endTime"
:
1573299903000
,
"endTime"
:
1573299903000
,
"limitScore"
:
10
"limitScore"
:
10
},
},
"nextSession
1
"
:
{
"nextSession"
:
{
"sessionIndex"
:
10
,
"sessionIndex"
:
10
,
"startTime"
:
1573440915952
,
"startTime"
:
1573440915952
,
"endTime"
:
1573299903000
,
"endTime"
:
1573299903000
,
"limitScore"
:
10
"limitScore"
:
10
},
},
"canJoin
1
"
:
true
"canJoin"
:
true
}
}
}
}
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