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
85193d72
Commit
85193d72
authored
Jan 02, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
636b34c7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
34 deletions
+78
-34
MainScene.ts
egret/src/mainScene/MainScene.ts
+7
-1
Tool.ts
egret/src/something/Tool.ts
+23
-11
Chapter13.ts
egret/src/something/chapters/Chapter13.ts
+20
-2
ElementConfigType.ts
egret/src/something/enum/ElementConfigType.ts
+10
-10
ElementType.ts
egret/src/something/enum/ElementType.ts
+18
-10
No files found.
egret/src/mainScene/MainScene.ts
View file @
85193d72
...
...
@@ -40,7 +40,7 @@ import { Ice } from '../something/class/Ice';
import
{
Lattice
}
from
'../something/class/Lattice'
;
import
{
EffectType
}
from
'../something/enum/EffectType'
;
import
{
ElementConfigType
,
createCandy
}
from
'../something/enum/ElementConfigType'
;
import
{
codeMsgs
,
ElementType
,
FiveBaseElementTypes
,
submitTran
}
from
'../something/enum/ElementType'
;
import
{
codeMsgs
,
ElementType
,
FiveBaseElementTypes
,
submitTran
,
isCandyElement
}
from
'../something/enum/ElementType'
;
import
{
isIce
,
isSpecialLattice
}
from
'../something/enum/LatticeType'
;
import
{
PassType
}
from
'../something/enum/PassType'
;
import
{
RecoverName
}
from
'../something/enum/RecoverName'
;
...
...
@@ -2352,6 +2352,12 @@ export default class MainScene extends Scene {
//这里面会去算个数
this
.
recoverEle
(
index
)
}
//糖果消失特效
else
if
(
isCandyElement
(
ele
.
type
))
{
this
.
playAni
(
RecoverName
.
ELEDIS_ANI
,
p
)
//这里面会去算个数
this
.
recoverEle
(
index
)
}
//石头
else
if
(
ele
.
type
==
ElementType
.
ROCK
)
{
this
.
removeRock
(
index
);
...
...
egret/src/something/Tool.ts
View file @
85193d72
import
{
Element
}
from
"./class/Element"
;
import
{
Lattice
}
from
"./class/Lattice"
;
import
{
ElementType
,
FiveBaseElementTypes
}
from
"./enum/ElementType
"
;
import
{
RectMask
}
from
"./class/RectMask
"
;
import
{
EffectType
}
from
"./enum/EffectType"
;
import
{
Pool
}
from
"./Pool
"
;
import
{
ElementType
,
FiveBaseElementTypes
,
isCandyElement
,
matchCandy
}
from
"./enum/ElementType
"
;
import
{
RecoverName
}
from
"./enum/RecoverName"
;
import
{
RectMask
}
from
"./class/RectMask
"
;
import
{
StateType
}
from
"./enum/StateType
"
;
import
{
FallType
}
from
"./interface/FallAniData"
;
import
{
GenerateLatData
}
from
"./interface/GenerateLatData"
;
import
{
StateType
}
from
"./enum/StateType
"
;
import
{
Pool
}
from
"./Pool
"
;
//两种,0无棒棒糖,1有
const
offsetYTwo
:
number
[]
=
[];
const
gameAreaHeightTwo
:
number
[]
=
[];
//初始化适配位置,就因为棒棒糖的45偏移
function
initClientScale
()
{
function
initClientScale
()
{
var
stageHeight
=
document
.
body
.
clientHeight
/
document
.
body
.
clientWidth
*
750
;
var
middleHeight
=
80
*
9
;
var
smallestHeight
=
230
+
middleHeight
+
180
;
...
...
@@ -94,7 +94,7 @@ export class Tool {
*/
public
static
init
(
isTwo
:
boolean
=
false
,
hasLollipop
:
boolean
=
false
)
{
//初始化屏幕尺寸
if
(
!
offsetYTwo
.
length
)
initClientScale
();
if
(
!
offsetYTwo
.
length
)
initClientScale
();
//x的偏移
var
ooox
:
number
=
isTwo
?
55
:
15
;
// 49 : 8.25
var
oooy
:
number
=
hasLollipop
?
offsetYTwo
[
1
]
:
offsetYTwo
[
0
];
...
...
@@ -295,7 +295,7 @@ export class Tool {
if
(
this
.
judgeFall
(
lat
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBLACK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLGREY
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBROWN
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBROWN
)
&&
!
lat
.
element
.
hasState
(
StateType
.
BLOCK_LOCK
)
&&
lat
.
element
.
type
!=
ElementType
.
FESTIVALELE_SMALL
)
{
...
...
@@ -311,7 +311,8 @@ export class Tool {
* @param lat
*/
public
static
judgeMatch
(
lat
:
Lattice
)
{
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
//是基础元素
if
(
(
Tool
.
judgeBaseEle
(
lat
)
||
Tool
.
judgeCandyEle
(
lat
))
&&
//是基础元素 or 糖果
lat
.
element
.
effectType
!=
EffectType
.
MAGICLION
&&
//特效不为魔力鸟
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLGREY
)
&&
//不带毛球, 下同
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBLACK
)
&&
...
...
@@ -357,6 +358,16 @@ export class Tool {
return
false
}
public
static
judgeCandyEle
(
lat
:
Lattice
)
{
if
(
lat
&&
lat
.
element
&&
isCandyElement
(
lat
.
element
.
type
)
//是糖果元素
)
{
return
true
}
return
false
}
/**
* 判断在打乱时,格子上元素是否能移动交换
* @param lat 格子
...
...
@@ -364,7 +375,7 @@ export class Tool {
public
static
judgeUpsetMove
(
lat
:
Lattice
)
{
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
//基础元素
!
lat
.
element
.
hasState
(
StateType
.
LOCK
)
&&
//不带锁
!
lat
.
element
.
hasState
(
StateType
.
BLOCK_LOCK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
BLOCK_LOCK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLGREY
)
&&
//不带毛球,下同
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBLACK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBROWN
)
...
...
@@ -383,7 +394,7 @@ export class Tool {
*/
public
static
judgeSetFesEle
(
lat
:
Lattice
)
{
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
//基础元素
!
lat
.
block
&&
!
lat
.
block
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLGREY
)
&&
//不带毛球,下同
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBLACK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBROWN
)
...
...
@@ -797,7 +808,8 @@ export class Tool {
var
latC
=
lattices
[
cur
];
if
(
Tool
.
judgeMatch
(
latP
)
&&
Tool
.
judgeMatch
(
latC
)
&&
latP
.
element
.
type
==
latC
.
element
.
type
)
{
(
latP
.
element
.
type
==
latC
.
element
.
type
||
matchCandy
(
latP
.
element
.
type
,
latC
.
element
.
type
))
)
{
result
[
i
].
push
(
cur
)
}
else
{
result
[
++
i
]
=
[
cur
];
...
...
egret/src/something/chapters/Chapter13.ts
View file @
85193d72
...
...
@@ -242,7 +242,16 @@ export const Chapters13: ChapterData[] = [
baseElementTypes
:
[
0
,
1
,
3
,
4
],
bubbleProbability
:
0
,
stepCount
:
26
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
10
,
count
:
8
},
{
type
:
9
,
count
:
65
}]
},
starScores
:
[
15000
,
20000
,
25000
],
map
:
{
lattices
:
[
3
,
0
,
0
,
3
,
3
,
3
,
0
,
0
,
3
,
0
,
61
,
3
,
3
,
3
,
3
,
3
,
61
,
0
,
0
,
3
,
6
,
3
,
3
,
3
,
6
,
3
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
3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
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
:
3
,
type
:
null
},
{
index
:
4
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
11
,
type
:
null
},
{
index
:
15
,
type
:
null
},
{
index
:
16
,
type
:
null
}]
}
}
...
...
egret/src/something/enum/ElementConfigType.ts
View file @
85193d72
...
...
@@ -78,19 +78,19 @@ export const createCandy = (t: ElementConfigType) => {
const
order
=
Math
.
ceil
(
Math
.
random
()
*
5
);
switch
(
order
)
{
case
1
:
type
=
ElementType
.
CANDY
1
type
=
ElementType
.
CANDY
_RABBIT
break
;
case
2
:
type
=
ElementType
.
CANDY
2
type
=
ElementType
.
CANDY
_CHICKEN
break
;
case
3
:
type
=
ElementType
.
CANDY
3
type
=
ElementType
.
CANDY
_CATTLE
break
;
case
4
:
type
=
ElementType
.
CANDY
4
type
=
ElementType
.
CANDY
_LION
break
;
case
5
:
type
=
ElementType
.
CANDY
5
type
=
ElementType
.
CANDY
_PIG
break
;
default
:
...
...
@@ -98,19 +98,19 @@ export const createCandy = (t: ElementConfigType) => {
}
}
else
if
(
t
==
ElementConfigType
.
CANDY_1
)
{
type
=
ElementType
.
CANDY
1
;
type
=
ElementType
.
CANDY
_RABBIT
;
}
else
if
(
t
==
ElementConfigType
.
CANDY_2
)
{
type
=
ElementType
.
CANDY
2
;
type
=
ElementType
.
CANDY
_CHICKEN
;
}
else
if
(
t
==
ElementConfigType
.
CANDY_3
)
{
type
=
ElementType
.
CANDY
3
;
type
=
ElementType
.
CANDY
_CATTLE
;
}
else
if
(
t
==
ElementConfigType
.
CANDY_4
)
{
type
=
ElementType
.
CANDY
4
;
type
=
ElementType
.
CANDY
_LION
;
}
else
if
(
t
==
ElementConfigType
.
CANDY_5
)
{
type
=
ElementType
.
CANDY
5
;
type
=
ElementType
.
CANDY
_PIG
;
};
return
type
;
}
\ No newline at end of file
egret/src/something/enum/ElementType.ts
View file @
85193d72
...
...
@@ -30,19 +30,27 @@ export enum ElementType {
FESTIVALELE_BIG
,
//节日元素大中间一个13
FESTIVALELE_SMALL
,
//节日元素飞溅的小元素14
CANDY
1
,
CANDY
2
,
CANDY
3
,
CANDY
4
,
CANDY
5
,
CANDY
_RABBIT
,
//兔子
CANDY
_CHICKEN
,
//鸟
CANDY
_CATTLE
,
//牛
CANDY
_LION
,
//狮子
CANDY
_PIG
,
//猪
}
export
const
isCandyElement
=
(
t
:
ElementType
)
=>
{
return
t
==
ElementType
.
CANDY1
||
t
==
ElementType
.
CANDY2
||
t
==
ElementType
.
CANDY3
||
t
==
ElementType
.
CANDY4
||
t
==
ElementType
.
CANDY5
return
t
==
ElementType
.
CANDY_RABBIT
||
t
==
ElementType
.
CANDY_CHICKEN
||
t
==
ElementType
.
CANDY_CATTLE
||
t
==
ElementType
.
CANDY_LION
||
t
==
ElementType
.
CANDY_PIG
};
export
const
matchCandy
=
(
a
:
ElementType
,
b
:
ElementType
,)
=>
{
return
(
a
==
ElementType
.
CANDY_RABBIT
&&
b
==
ElementType
.
RABBIT
)
||
(
a
==
ElementType
.
CANDY_CHICKEN
&&
b
==
ElementType
.
CHICKEN
)
||
(
a
==
ElementType
.
CANDY_CATTLE
&&
b
==
ElementType
.
CATTLE
)
||
(
a
==
ElementType
.
CANDY_LION
&&
b
==
ElementType
.
LION
)
||
(
a
==
ElementType
.
CANDY_PIG
&&
b
==
ElementType
.
PIG
)
};
/**
...
...
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