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
ff43736c
Commit
ff43736c
authored
Mar 27, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整炮台配置
parent
e7adeb9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
15 deletions
+51
-15
MainScene.ts
egret/src/mainScene/MainScene.ts
+7
-7
Tool.ts
egret/src/something/Tool.ts
+34
-1
Chapter22.ts
egret/src/something/chapters/Chapter22.ts
+5
-5
ElementConfigType.ts
egret/src/something/enum/ElementConfigType.ts
+5
-2
No files found.
egret/src/mainScene/MainScene.ts
View file @
ff43736c
...
...
@@ -870,7 +870,10 @@ export default class MainScene extends Scene {
this
.
elementContainer
.
addChild
(
egg
);
this
.
lattices
[
i
].
element
=
egg
;
break
;
case
ElementConfigType
.
CANNO
:
case
ElementConfigType
.
CANNO_DIR_TOP
:
case
ElementConfigType
.
CANNO_DIR_BOTTOM
:
case
ElementConfigType
.
CANNO_DIR_LEFT
:
case
ElementConfigType
.
CANNO_DIR_RIGHT
:
let
canno
:
Element
=
Tool
.
getElement
(
ElementType
.
CANNO
);
canno
.
x
=
p
[
0
];
canno
.
y
=
p
[
1
];
...
...
@@ -908,11 +911,11 @@ export default class MainScene extends Scene {
const
baseElement
=
elements
[
i
];
const
isCandyEle
=
elementConfig
==
ElementConfigType
.
CANDY
;
const
isMonsterEle
=
elementConfig
==
ElementConfigType
.
MONSTER
;
const
isCanno
=
elementConfig
==
ElementConfigType
.
CANNO
;
const
isCanno
=
Tool
.
IsCanno
(
elementConfig
)
;
//不是基础元素,跳过,
if
(
!
Tool
.
judgeBaseEle
(
this
.
lattices
[
i
])
&&
!
isCandyEle
&&
!
isMonsterEle
&&
!
isCanno
)
continue
;
//是0,跳过
if
(
!
baseElement
&&
!
isCandyEle
&&
!
isMonsterEle
)
continue
if
(
!
baseElement
&&
!
isCandyEle
&&
!
isMonsterEle
&&
!
isCanno
)
continue
const
ele
:
Element
=
this
.
lattices
[
i
].
element
;
if
(
isCandyEle
)
{
//糖果元素
...
...
@@ -931,9 +934,7 @@ export default class MainScene extends Scene {
ele
.
resetToMonsterView
(
elementMonsterResMap
[
ele
.
type
]);
}
else
if
(
isCanno
){
//是炮台
var
dirarr
:
number
[]
=
Tool
.
returnTO
(
elements
[
i
]);
var
dirnum
=
dirarr
[
1
]
||
1
;
var
dirType
=
connoDirection
[
dirnum
];
var
dirType
=
Tool
.
getCannoDir
(
elementConfig
);
ele
.
resetToCannoView
(
dirType
);
}
else
{
...
...
@@ -2148,7 +2149,6 @@ export default class MainScene extends Scene {
// }
// }
if
(
emitcanno
){
console
.
log
(
"大炮发射"
);
this
.
fireCanno
(
emitcanno
);
return
;
}
...
...
egret/src/something/Tool.ts
View file @
ff43736c
...
...
@@ -2,13 +2,14 @@ import { Element } from "./class/Element";
import
{
Lattice
}
from
"./class/Lattice"
;
import
{
RectMask
}
from
"./class/RectMask"
;
import
{
EffectType
}
from
"./enum/EffectType"
;
import
{
ElementType
,
FiveBaseElementTypes
}
from
"./enum/ElementType"
;
import
{
ElementType
,
FiveBaseElementTypes
,
forwardDirection
}
from
"./enum/ElementType"
;
import
{
RecoverName
}
from
"./enum/RecoverName"
;
import
{
StateType
}
from
"./enum/StateType"
;
import
{
FallType
}
from
"./interface/FallAniData"
;
import
{
GenerateLatData
}
from
"./interface/GenerateLatData"
;
import
{
Pool
}
from
"./Pool"
;
import
HoneyPotElement
from
"./class/HoneyPotElement"
;
import
{
ElementConfigType
}
from
"./enum/ElementConfigType"
;
//两种,0无棒棒糖,1有
const
offsetYTwo
:
number
[]
=
[];
...
...
@@ -1216,4 +1217,36 @@ export class Tool {
}
return
outArr
}
/**
* 判断是否是炮台
* @param type
*/
public
static
IsCanno
(
type
:
ElementConfigType
){
if
(
type
==
ElementConfigType
.
CANNO_DIR_TOP
||
type
==
ElementConfigType
.
CANNO_DIR_BOTTOM
||
type
==
ElementConfigType
.
CANNO_DIR_LEFT
||
type
==
ElementConfigType
.
CANNO_DIR_RIGHT
){
return
true
;
}
return
false
;
}
public
static
getCannoDir
(
type
:
ElementConfigType
){
if
(
type
==
ElementConfigType
.
CANNO_DIR_TOP
){
return
forwardDirection
.
up
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_BOTTOM
){
return
forwardDirection
.
down
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_LEFT
){
return
forwardDirection
.
left
;
}
else
if
(
type
==
ElementConfigType
.
CANNO_DIR_RIGHT
){
return
forwardDirection
.
right
;
}
else
{
console
.
error
(
"未定义跑跳"
);
}
}
}
\ No newline at end of file
egret/src/something/chapters/Chapter22.ts
View file @
ff43736c
...
...
@@ -42,19 +42,19 @@ export const Chapters22: ChapterData[] = [
[
71
,
17
]
],
elements
:
[
1
,
1
8
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
18
,
1
,
1
,
1
9
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
20
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
6
,
1
,
1
,
1
,
1
,
1
,
6
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
1
,
22
,
1
,
1
,
16
,
1
,
1
,
1
,
1
,
5
,
6
,
1
,
1
,
2
,
1
,
1
,
6
,
5
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
],
baseElements
:
[
0
,
4
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
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
,
...
...
egret/src/something/enum/ElementConfigType.ts
View file @
ff43736c
...
...
@@ -68,7 +68,10 @@ export enum ElementConfigType {
HONEY_POT
=
16
,
FLOWER
=
17
,
/** 大炮 */
CANNO
=
18
,
CANNO_DIR_TOP
=
18
,
CANNO_DIR_BOTTOM
=
19
,
CANNO_DIR_LEFT
=
20
,
CANNO_DIR_RIGHT
=
21
,
/** 大炮石头 */
CANNO_BLOCK
=
19
,
CANNO_BLOCK
=
22
,
}
\ No newline at end of file
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