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
c47ff5ff
Commit
c47ff5ff
authored
Dec 18, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e7d34f26
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
88 additions
and
12 deletions
+88
-12
MainScene.ts
egret/src/mainScene/MainScene.ts
+18
-3
Block.ts
egret/src/something/block/Block.ts
+10
-1
BlockBase.ts
egret/src/something/block/BlockBase.ts
+2
-1
BlockDarkIce.ts
egret/src/something/block/BlockDarkIce.ts
+31
-2
BlockIce.ts
egret/src/something/block/BlockIce.ts
+19
-1
centerAnchor.ts
egret/src/something/block/centerAnchor.ts
+4
-0
Chapter2.ts
egret/src/something/chapters/Chapter2.ts
+2
-2
Lattice.ts
egret/src/something/class/Lattice.ts
+1
-1
ElementConfigType.ts
egret/src/something/enum/ElementConfigType.ts
+1
-1
No files found.
egret/src/mainScene/MainScene.ts
View file @
c47ff5ff
...
@@ -2671,8 +2671,9 @@ export default class MainScene extends Scene {
...
@@ -2671,8 +2671,9 @@ export default class MainScene extends Scene {
* @param lat
* @param lat
*/
*/
iceBroken
(
lat
:
Lattice
)
{
iceBroken
(
lat
:
Lattice
)
{
if
(
lat
&&
lat
.
ice
)
{
if
(
!
lat
)
return
;
var
ice
=
lat
.
ice
;
if
(
lat
.
ice
)
{
//带冰的lattice
const
ice
=
lat
.
ice
;
ice
.
countNum
--
;
ice
.
countNum
--
;
if
(
ice
.
countNum
==
0
)
{
if
(
ice
.
countNum
==
0
)
{
this
.
map
.
removeChild
(
ice
);
this
.
map
.
removeChild
(
ice
);
...
@@ -2683,9 +2684,23 @@ export default class MainScene extends Scene {
...
@@ -2683,9 +2684,23 @@ export default class MainScene extends Scene {
}
else
{
}
else
{
ice
.
alpha
=
0.6
;
ice
.
alpha
=
0.6
;
}
}
var
p
=
Tool
.
getPositionByIndex
(
lat
.
index
);
const
p
=
Tool
.
getPositionByIndex
(
lat
.
index
);
//动画
//动画
this
.
playAni
(
RecoverName
.
ICE_ANI
,
p
);
this
.
playAni
(
RecoverName
.
ICE_ANI
,
p
);
}
else
if
(
lat
.
block
)
{
//石门(可能带冰)
const
block
=
lat
.
block
;
block
.
iceCountNum
--
;
if
(
block
.
iceCountNum
==
0
)
{
block
.
ice
&&
this
.
map
.
removeChild
(
block
.
ice
);
block
.
ice
=
null
;
this
.
goElementTarget
(
ElementType
.
ICE
,
[
block
.
ice
.
x
,
block
.
ice
.
y
]);
}
else
{
block
.
ice
.
alpha
=
0.6
;
}
const
p
=
Tool
.
getPositionByIndex
(
lat
.
index
);
//动画
this
.
playAni
(
RecoverName
.
ICE_ANI
,
p
);
}
}
}
}
...
...
egret/src/something/block/Block.ts
View file @
c47ff5ff
import
BlockBase
from
"./BlockBase"
;
import
BlockBase
from
"./BlockBase"
;
import
centerAnchor
from
"./centerAnchor"
;
export
default
class
Block
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
export
default
class
Block
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
initUI
();
this
.
initUI
();
...
@@ -18,6 +19,12 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
...
@@ -18,6 +19,12 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgYellow
);
this
.
addChild
(
this
.
_blockBgYellow
);
centerAnchor
(
this
.
_block
);
centerAnchor
(
this
.
_blockBgFront
);
centerAnchor
(
this
.
_blockBgBlue
);
centerAnchor
(
this
.
_blockBgRed
);
centerAnchor
(
this
.
_blockBgYellow
);
this
.
_block
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
...
@@ -27,6 +34,8 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
...
@@ -27,6 +34,8 @@ export default class Block extends egret.DisplayObjectContainer implements Bloc
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
_block
.
visible
=
true
;
}
}
private
_blockBgYellow
:
egret
.
Bitmap
;
private
_blockBgYellow
:
egret
.
Bitmap
;
...
...
egret/src/something/block/BlockBase.ts
View file @
c47ff5ff
...
@@ -19,5 +19,6 @@ export const genBlockDisplay = (type: LatticeType) => {
...
@@ -19,5 +19,6 @@ export const genBlockDisplay = (type: LatticeType) => {
}
}
export
default
interface
BlockBase
{
export
default
interface
BlockBase
{
iceCountNum
:
number
;
ice
:
egret
.
Bitmap
;
}
}
\ No newline at end of file
egret/src/something/block/BlockDarkIce.ts
View file @
c47ff5ff
import
BlockBase
from
"./BlockBase"
;
import
BlockBase
from
"./BlockBase"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
export
default
class
BlockDarkIce
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
import
centerAnchor
from
"./centerAnchor"
;
export
default
class
BlockDarkIce
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
initUI
();
this
.
initUI
();
...
@@ -12,12 +13,23 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
...
@@ -12,12 +13,23 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
this
.
_blockBgBlue
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_blue_png'
));
this
.
_blockBgBlue
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_blue_png'
));
this
.
_blockBgRed
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_red_png'
));
this
.
_blockBgRed
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_red_png'
));
this
.
_blockBgYellow
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_yellow_png'
));
this
.
_blockBgYellow
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_yellow_png'
));
this
.
ice
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"ele"
+
ElementType
.
ICE
+
"_png"
));
this
.
ice
.
alpha
=
1
;
this
.
addChild
(
this
.
ice
);
this
.
addChild
(
this
.
_block
);
this
.
addChild
(
this
.
_block
);
this
.
addChild
(
this
.
_blockBgFront
);
this
.
addChild
(
this
.
_blockBgFront
);
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgYellow
);
this
.
addChild
(
this
.
_blockBgYellow
);
centerAnchor
(
this
.
_block
);
centerAnchor
(
this
.
_blockBgFront
);
centerAnchor
(
this
.
_blockBgBlue
);
centerAnchor
(
this
.
_blockBgRed
);
centerAnchor
(
this
.
_blockBgYellow
);
centerAnchor
(
this
.
ice
);
this
.
ice
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
...
@@ -27,8 +39,25 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
...
@@ -27,8 +39,25 @@ export default class BlockDarkIce extends egret.DisplayObjectContainer implement
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
_block
.
visible
=
true
;
}
iceCountNum
=
2
;
checkRemoveIce
()
{
}
resetToBack
()
{
}
}
resetToFront
()
{
}
ice
:
egret
.
Bitmap
;
private
_blockBgYellow
:
egret
.
Bitmap
;
private
_blockBgYellow
:
egret
.
Bitmap
;
private
_blockBgRed
:
egret
.
Bitmap
;
private
_blockBgRed
:
egret
.
Bitmap
;
private
_blockBgBlue
:
egret
.
Bitmap
;
private
_blockBgBlue
:
egret
.
Bitmap
;
...
...
egret/src/something/block/BlockIce.ts
View file @
c47ff5ff
import
BlockBase
from
"./BlockBase"
;
import
BlockBase
from
"./BlockBase"
;
import
{
ElementType
}
from
"../enum/ElementType"
;
import
centerAnchor
from
"./centerAnchor"
;
export
default
class
BlockIce
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
export
default
class
BlockIce
extends
egret
.
DisplayObjectContainer
implements
BlockBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
initUI
();
this
.
initUI
();
...
@@ -12,23 +14,39 @@ export default class BlockIce extends egret.DisplayObjectContainer implements B
...
@@ -12,23 +14,39 @@ export default class BlockIce extends egret.DisplayObjectContainer implements B
this
.
_blockBgBlue
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_blue_png'
));
this
.
_blockBgBlue
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_blue_png'
));
this
.
_blockBgRed
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_red_png'
));
this
.
_blockBgRed
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_red_png'
));
this
.
_blockBgYellow
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_yellow_png'
));
this
.
_blockBgYellow
=
new
egret
.
Bitmap
(
RES
.
getRes
(
'common_block_bg_yellow_png'
));
this
.
ice
=
new
egret
.
Bitmap
(
RES
.
getRes
(
"ele"
+
ElementType
.
ICE
+
"_png"
));
this
.
ice
.
alpha
=
0.6
;
this
.
addChild
(
this
.
ice
);
this
.
addChild
(
this
.
_block
);
this
.
addChild
(
this
.
_block
);
this
.
addChild
(
this
.
_blockBgFront
);
this
.
addChild
(
this
.
_blockBgFront
);
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgBlue
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgRed
);
this
.
addChild
(
this
.
_blockBgYellow
);
this
.
addChild
(
this
.
_blockBgYellow
);
centerAnchor
(
this
.
_block
);
centerAnchor
(
this
.
_blockBgFront
);
centerAnchor
(
this
.
_blockBgBlue
);
centerAnchor
(
this
.
_blockBgRed
);
centerAnchor
(
this
.
_blockBgYellow
);
centerAnchor
(
this
.
ice
);
this
.
ice
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_block
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgFront
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
this
.
_blockBgBlue
.
visible
=
false
;
this
.
_blockBgRed
.
visible
=
false
;
this
.
_blockBgRed
.
visible
=
false
;
this
.
_blockBgYellow
.
visible
=
false
;
this
.
_blockBgYellow
.
visible
=
false
;
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgBlue
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgYellow
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
addAni
(
this
.
_blockBgRed
);
this
.
_block
.
visible
=
true
;
}
}
iceCountNum
=
1
;
ice
:
egret
.
Bitmap
;
private
_blockBgYellow
:
egret
.
Bitmap
;
private
_blockBgYellow
:
egret
.
Bitmap
;
private
_blockBgRed
:
egret
.
Bitmap
;
private
_blockBgRed
:
egret
.
Bitmap
;
private
_blockBgBlue
:
egret
.
Bitmap
;
private
_blockBgBlue
:
egret
.
Bitmap
;
...
...
egret/src/something/block/centerAnchor.ts
0 → 100644
View file @
c47ff5ff
export
default
(
d
:
egret
.
DisplayObject
)
=>
{
d
.
anchorOffsetX
=
d
.
width
/
2
;
d
.
anchorOffsetY
=
d
.
height
/
2
;
}
\ No newline at end of file
egret/src/something/chapters/Chapter2.ts
View file @
c47ff5ff
...
@@ -23,7 +23,7 @@ export const Chapters2: ChapterData[] = [
...
@@ -23,7 +23,7 @@ export const Chapters2: ChapterData[] = [
starScores
:
[
4000
,
8000
,
12000
],
starScores
:
[
4000
,
8000
,
12000
],
map
:
{
map
:
{
lattices
:
[
lattices
:
[
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
4
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
...
@@ -34,7 +34,7 @@ export const Chapters2: ChapterData[] = [
...
@@ -34,7 +34,7 @@ export const Chapters2: ChapterData[] = [
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
],
],
elements
:
[
elements
:
[
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
1
,
1
,
1
,
1
,
1
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
0
,
...
...
egret/src/something/class/Lattice.ts
View file @
c47ff5ff
...
@@ -17,7 +17,7 @@ export class Lattice {
...
@@ -17,7 +17,7 @@ export class Lattice {
/**
/**
* 石门,冰石门,深冰石门
* 石门,冰石门,深冰石门
*/
*/
block
:
BlockBase
;
block
:
BlockBase
;
/**
/**
* 上面的元素(null,消除元素,石头,冰激凌等),
* 上面的元素(null,消除元素,石头,冰激凌等),
*/
*/
...
...
egret/src/something/enum/ElementConfigType.ts
View file @
c47ff5ff
...
@@ -15,7 +15,7 @@ export enum ElementConfigType {
...
@@ -15,7 +15,7 @@ export enum ElementConfigType {
*/
*/
ROCK
=
2
,
ROCK
=
2
,
/**
/**
*
石头
*
棒棒糖
*/
*/
LOLLIPOP
=
3
,
LOLLIPOP
=
3
,
/**
/**
...
...
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