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
74a28db1
Commit
74a28db1
authored
Oct 26, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
7ed69a67
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
155 additions
and
100 deletions
+155
-100
MainScene.ts
egret/src/mainScene/MainScene.ts
+90
-79
Tool.ts
egret/src/something/Tool.ts
+8
-1
EleDownAni.ts
egret/src/something/anis/EleDownAni.ts
+42
-0
EleMaskAni.ts
egret/src/something/anis/EleMaskAni.ts
+2
-1
IceAni.ts
egret/src/something/anis/IceAni.ts
+2
-1
PieceToEggAni.ts
egret/src/something/anis/PieceToEggAni.ts
+2
-1
RockAni.ts
egret/src/something/anis/RockAni.ts
+2
-1
ChickenEgg.ts
egret/src/something/class/ChickenEgg.ts
+3
-1
Element.ts
egret/src/something/class/Element.ts
+1
-1
ElementType.ts
egret/src/something/enum/ElementType.ts
+3
-1
FallELeType.ts
egret/src/something/enum/FallELeType.ts
+0
-13
No files found.
egret/src/mainScene/MainScene.ts
View file @
74a28db1
This diff is collapsed.
Click to expand it.
egret/src/something/Tool.ts
View file @
74a28db1
...
@@ -14,9 +14,16 @@ import { StateType } from "./enum/StateType";
...
@@ -14,9 +14,16 @@ import { StateType } from "./enum/StateType";
export
class
Tool
{
export
class
Tool
{
/**
/**
* 每格掉落时间
* 每格掉落时间
* 掉落速度这个定
*/
public
static
latDeltaTime
:
number
=
90
;
/**
* 总行数
*/
*/
public
static
latDeltaTime
=
90
;
public
static
rowNum
=
9
;
public
static
rowNum
=
9
;
/**
* 总列数
*/
public
static
colNum
=
9
;
public
static
colNum
=
9
;
/**
/**
* 格子宽度
* 格子宽度
...
...
egret/src/something/anis/EleDownAni.ts
0 → 100644
View file @
74a28db1
import
{
Tool
}
from
"../Tool"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
EffectType
}
from
"../enum/EffectType"
;
import
{
Element
}
from
"../class/Element"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
/**
* 元素向下的动画
* 没有遮罩
* @param eleC
* @param p
* @param con
* @param callback
*/
export
function
EleDownAni
(
eleC
:
Element
,
p
:
number
[],
wait
:
number
,
con
:
egret
.
DisplayObjectContainer
,
isUp
:
boolean
=
false
,
deltaTime
:
number
,
callback
?:
Function
)
{
let
ele
=
Tool
.
getElement
(
eleC
.
type
);
ele
.
effectType
=
eleC
.
effectType
;
ele
.
x
=
p
[
0
];
ele
.
y
=
p
[
1
]
-
Tool
.
height
*
(
isUp
?
0
:
1
);
egret
.
Tween
.
get
(
ele
)
.
wait
(
wait
)
.
call
(()
=>
{
con
.
addChild
(
ele
);
})
.
to
({
x
:
p
[
0
],
y
:
p
[
1
]
+
Tool
.
height
*
(
isUp
?
1
:
0
)
},
deltaTime
)
.
call
(()
=>
{
//回收元素
con
.
removeChild
(
ele
);
Pool
.
recover
(
RecoverName
.
ELEMENT
,
ele
);
//回调
callback
&&
callback
();
})
}
\ No newline at end of file
egret/src/something/anis/EleMaskAni.ts
View file @
74a28db1
...
@@ -18,6 +18,7 @@ export function EleMaskAni(
...
@@ -18,6 +18,7 @@ export function EleMaskAni(
wait
:
number
,
wait
:
number
,
con
:
egret
.
DisplayObjectContainer
,
con
:
egret
.
DisplayObjectContainer
,
isUp
:
boolean
=
false
,
isUp
:
boolean
=
false
,
deltaTime
:
number
,
callback
?:
Function
callback
?:
Function
)
{
)
{
let
ele
=
Tool
.
getElement
(
eleC
.
type
);
let
ele
=
Tool
.
getElement
(
eleC
.
type
);
...
@@ -37,7 +38,7 @@ export function EleMaskAni(
...
@@ -37,7 +38,7 @@ export function EleMaskAni(
.
call
(()
=>
{
.
call
(()
=>
{
con
.
addChild
(
ele
);
con
.
addChild
(
ele
);
})
})
.
to
({
x
:
p
[
0
],
y
:
p
[
1
]
+
Tool
.
height
*
(
isUp
?
1
:
0
)
},
Tool
.
latD
eltaTime
)
.
to
({
x
:
p
[
0
],
y
:
p
[
1
]
+
Tool
.
height
*
(
isUp
?
1
:
0
)
},
d
eltaTime
)
.
call
(()
=>
{
.
call
(()
=>
{
//回收元素
//回收元素
con
.
removeChild
(
ele
);
con
.
removeChild
(
ele
);
...
...
egret/src/something/anis/IceAni.ts
View file @
74a28db1
import
{
Ani
}
from
"../class/Ani"
;
import
{
Ani
}
from
"../class/Ani"
;
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//原点已是中心
//原点已是中心
export
class
IceAni
extends
Ani
{
export
class
IceAni
extends
Ani
{
...
@@ -10,7 +11,7 @@ export class IceAni extends Ani {
...
@@ -10,7 +11,7 @@ export class IceAni extends Ani {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
aniName
=
"IceAni"
;
this
.
aniName
=
"IceAni"
;
this
.
showImage
=
new
ImageAni
([
"ele
7
_png"
,
"ice2_png"
,
"ice3_png"
,
"ice4_png"
,
"ice5_png"
,
"ice6_png"
]);
this
.
showImage
=
new
ImageAni
([
"ele
"
+
ElementType
.
ICE
+
"
_png"
,
"ice2_png"
,
"ice3_png"
,
"ice4_png"
,
"ice5_png"
,
"ice6_png"
]);
this
.
addChild
(
this
.
showImage
)
this
.
addChild
(
this
.
showImage
)
}
}
...
...
egret/src/something/anis/PieceToEggAni.ts
View file @
74a28db1
...
@@ -3,6 +3,7 @@ import { Pool } from "../Pool";
...
@@ -3,6 +3,7 @@ import { Pool } from "../Pool";
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
playSound
,
SoundType
}
from
"../../soundCtrl"
;
import
{
playSound
,
SoundType
}
from
"../../soundCtrl"
;
import
{
Tool
}
from
"../Tool"
;
import
{
Tool
}
from
"../Tool"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
const
offsetX
=
91
/
2
;
const
offsetX
=
91
/
2
;
const
offsetY
=
62
/
2
;
const
offsetY
=
62
/
2
;
...
@@ -20,7 +21,7 @@ export class PieceToEggAni extends egret.DisplayObjectContainer {
...
@@ -20,7 +21,7 @@ export class PieceToEggAni extends egret.DisplayObjectContainer {
eggPiece5
:
egret
.
Bitmap
;
eggPiece5
:
egret
.
Bitmap
;
constructor
()
{
constructor
()
{
super
()
super
()
var
arr
=
[
"ele
9
_png"
,
"eggPiece1_png"
,
"eggPiece2_png"
,
"eggPiece3_png"
,
"eggPiece4_png"
,
"eggPiece5_png"
];
var
arr
=
[
"ele
"
+
ElementType
.
CHICKEN_EGG
+
"
_png"
,
"eggPiece1_png"
,
"eggPiece2_png"
,
"eggPiece3_png"
,
"eggPiece4_png"
,
"eggPiece5_png"
];
var
objs
=
[
"showImage"
,
"eggPiece1"
,
"eggPiece2"
,
"eggPiece3"
,
"eggPiece4"
,
"eggPiece5"
];
var
objs
=
[
"showImage"
,
"eggPiece1"
,
"eggPiece2"
,
"eggPiece3"
,
"eggPiece4"
,
"eggPiece5"
];
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
...
egret/src/something/anis/RockAni.ts
View file @
74a28db1
import
{
Ani
}
from
"../class/Ani"
;
import
{
Ani
}
from
"../class/Ani"
;
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
//原点已是中心
//原点已是中心
export
class
RockAni
extends
Ani
{
export
class
RockAni
extends
Ani
{
...
@@ -10,7 +11,7 @@ export class RockAni extends Ani {
...
@@ -10,7 +11,7 @@ export class RockAni extends Ani {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
aniName
=
"RockAni"
;
this
.
aniName
=
"RockAni"
;
this
.
showImage
=
new
ImageAni
([
"ele
5
_png"
,
"rock2_png"
,
"rock3_png"
,
"rock4_png"
,
"rock5_png"
,
"rock6_png"
]);
this
.
showImage
=
new
ImageAni
([
"ele
"
+
ElementType
.
ROCK
+
"
_png"
,
"rock2_png"
,
"rock3_png"
,
"rock4_png"
,
"rock5_png"
,
"rock6_png"
]);
this
.
addChild
(
this
.
showImage
)
this
.
addChild
(
this
.
showImage
)
}
}
...
...
egret/src/something/class/ChickenEgg.ts
View file @
74a28db1
import
{
ElementType
}
from
"../enum/ElementType"
;
//四种状态的图片
//四种状态的图片
const
images
=
{
const
images
=
{
3
:
"ele
9
_png"
,
3
:
"ele
"
+
ElementType
.
CHICKEN_EGG
+
"
_png"
,
2
:
"eggStatus2_png"
,
2
:
"eggStatus2_png"
,
1
:
"eggStatus1_png"
,
1
:
"eggStatus1_png"
,
0
:
"eggStatus0_png"
0
:
"eggStatus0_png"
...
...
egret/src/something/class/Element.ts
View file @
74a28db1
...
@@ -161,7 +161,7 @@ export class Element extends eui.Component {
...
@@ -161,7 +161,7 @@ export class Element extends eui.Component {
this
.
showImage
.
y
=
-
texture
.
textureHeight
/
2
;
this
.
showImage
.
y
=
-
texture
.
textureHeight
/
2
;
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage,还有鸡蛋
//特殊逻辑,因为魔力鸟动效要旋转,所以隐藏原图showImage,还有鸡蛋
if
(
source
==
"magicLion_png"
||
source
==
"ele
9
_png"
)
{
if
(
source
==
"magicLion_png"
||
source
==
"ele
"
+
ElementType
.
CHICKEN_EGG
+
"
_png"
)
{
this
.
showImage
.
alpha
=
0
;
this
.
showImage
.
alpha
=
0
;
}
else
{
}
else
{
this
.
showImage
.
alpha
=
1
;
this
.
showImage
.
alpha
=
1
;
...
...
egret/src/something/enum/ElementType.ts
View file @
74a28db1
...
@@ -54,7 +54,8 @@ export const submitTran = {
...
@@ -54,7 +54,8 @@ export const submitTran = {
4
:
8
,
4
:
8
,
5
:
9
,
5
:
9
,
6
:
3
,
6
:
3
,
7
:
2
,
9
:
2
,
10
:
10
}
}
// SCORE(1, "分数"),
// SCORE(1, "分数"),
...
@@ -66,3 +67,4 @@ export const submitTran = {
...
@@ -66,3 +67,4 @@ export const submitTran = {
// LION(7, "狮子"),
// LION(7, "狮子"),
// PIG(8, "猪"),
// PIG(8, "猪"),
// STONE(9, "石头")
// STONE(9, "石头")
// GREYBALL(10, "灰色")
egret/src/something/enum/FallELeType.ts
deleted
100644 → 0
View file @
7ed69a67
/**
* 掉落元素类型
* 没用了
*/
export
enum
FallEleType
{
RANELE
=
0
,
//随机元素无特效
RANEFF
,
//随机元素加随机特效
RABBIT
,
//兔子 下面的顺序和ElementType前5保持一致,不要随便修改
CHICKEN
,
//鸡
CATTLE
,
//牛
LION
,
//狮子
PIG
,
//猪
}
\ 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