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
649bd363
Commit
649bd363
authored
Oct 10, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
55eca18d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
4 deletions
+67
-4
MainScene.ts
egret/src/mainScene/MainScene.ts
+2
-2
ChickenEgg.ts
egret/src/something/class/ChickenEgg.ts
+57
-0
AiControl.ts
egret/src/something/logic/AiControl.ts
+8
-2
No files found.
egret/src/mainScene/MainScene.ts
View file @
649bd363
...
@@ -215,7 +215,7 @@ export default class MainScene extends Scene {
...
@@ -215,7 +215,7 @@ export default class MainScene extends Scene {
super
.
start
();
super
.
start
();
//第几关
//第几关
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
this
.
chapter
=
81
;
//
this.chapter = 81;
this
.
chapterTxt
.
text
=
"第"
+
this
.
chapter
+
"关"
;
this
.
chapterTxt
.
text
=
"第"
+
this
.
chapter
+
"关"
;
//关卡数据,1期定制,70,后面35关地图一致,步数减少
//关卡数据,1期定制,70,后面35关地图一致,步数减少
var
mapDataIndex
=
this
.
chapter
;
var
mapDataIndex
=
this
.
chapter
;
...
@@ -1802,7 +1802,7 @@ export default class MainScene extends Scene {
...
@@ -1802,7 +1802,7 @@ export default class MainScene extends Scene {
//鸡蛋
//鸡蛋
else
if
(
ele
.
type
==
ElementType
.
CHICKEN_EGG
)
{
else
if
(
ele
.
type
==
ElementType
.
CHICKEN_EGG
)
{
//额外逻辑,鸡蛋动效,或者累计小鸡数量
//额外逻辑,鸡蛋动效,或者累计小鸡数量
}
}
}
}
}
}
...
...
egret/src/something/class/ChickenEgg.ts
View file @
649bd363
/**
* 鸡蛋的状态
*
*/
export
class
ChickenEgg
extends
eui
.
Image
{
/**
* 小鸡数量
*/
private
chickenNum
:
number
=
0
;
/**
* 鸡蛋状态变化 3 2 1 0 再往后,直接加孵鸡次数
*/
private
_statusNum
:
number
;
get
statusNum
()
{
return
this
.
_statusNum
}
set
statusNum
(
value
:
number
)
{
if
(
value
>=
0
)
{
this
.
_statusNum
=
value
;
}
else
{
this
.
_statusNum
=
0
;
this
.
chickenNum
++
;
}
}
constructor
(
n
:
number
=
3
)
{
super
()
this
.
source
=
"ele7_png"
;
//图片需要居中
this
.
chickenNum
=
0
;
this
.
_statusNum
=
n
;
}
reset
(
n
:
number
=
3
)
{
//图片修改
this
.
chickenNum
=
0
;
this
.
_statusNum
=
n
;
}
/**
* 孵蛋动作
*/
hatch
(
callback
:
Function
)
{
if
(
!
this
.
chickenNum
)
{
callback
();
return
}
}
}
\ No newline at end of file
egret/src/something/logic/AiControl.ts
View file @
649bd363
...
@@ -70,7 +70,12 @@ export class AiControl {
...
@@ -70,7 +70,12 @@ export class AiControl {
}
}
}
}
}
}
/**
* 鸡蛋得孵化逻辑
* 与果冻不同,需要执行一次threeMatch,如无再执行callback,否则执行eleminate
* @param thisObj
* @param callback
*/
private
eggMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
private
eggMotion
(
thisObj
:
MainScene
,
callback
:
Function
)
{
if
(
!
this
.
hasEgg
)
{
if
(
!
this
.
hasEgg
)
{
callback
();
callback
();
...
@@ -120,7 +125,6 @@ function judgeEggExist(lattices: Lattice[]) {
...
@@ -120,7 +125,6 @@ function judgeEggExist(lattices: Lattice[]) {
*/
*/
function
getJellySpreadAni
(
lattices
:
Lattice
[])
{
function
getJellySpreadAni
(
lattices
:
Lattice
[])
{
var
indexs
:
number
[]
=
[];
var
indexs
:
number
[]
=
[];
var
hasJelly
:
boolean
=
false
;
for
(
var
i
=
0
;
i
<
lattices
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
lattices
.
length
;
i
++
)
{
var
lattice
=
lattices
[
i
]
var
lattice
=
lattices
[
i
]
//没有格子或没有元素或不是果冻 跳过
//没有格子或没有元素或不是果冻 跳过
...
@@ -165,3 +169,5 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
...
@@ -165,3 +169,5 @@ function judgeSpread(index: number, lattices: Lattice[]): number {
}
}
return
null
return
null
}
}
//
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