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
285e9aa1
Commit
285e9aa1
authored
Jan 10, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b8f9f8cc
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
19 deletions
+113
-19
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-1
ele20.png
egret/resource/assets/mainScene/ele20.png
+0
-0
empty.png
egret/resource/assets/mainScene/empty.png
+0
-0
monster.svga
egret/resource/assets/svgas/monster.svga
+0
-0
default.res.json
egret/resource/default.res.json
+11
-1
MainScene.ts
egret/src/mainScene/MainScene.ts
+7
-6
Tool.ts
egret/src/something/Tool.ts
+7
-5
Chapter14.ts
egret/src/something/chapters/Chapter14.ts
+8
-4
Element.ts
egret/src/something/class/Element.ts
+75
-2
ElementType.ts
egret/src/something/enum/ElementType.ts
+3
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
285e9aa1
...
...
@@ -286,7 +286,7 @@ export default class MainBase extends eui.UILayer {
RES
.
getResAsync
(
"ele"
+
i
+
"Line"
+
"_png"
)
RES
.
getResAsync
(
"ele"
+
i
+
"Exp"
+
"_png"
)
}
for
(
var
i
=
0
;
i
<
2
0
;
i
++
)
{
for
(
var
i
=
0
;
i
<
2
1
;
i
++
)
{
RES
.
getResAsync
(
"ele"
+
i
+
"_png"
)
}
for
(
var
i
=
1
;
i
<=
27
;
i
++
)
{
...
...
@@ -451,6 +451,7 @@ export default class MainBase extends eui.UILayer {
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/sprize.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster.svga'
);
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
egret/resource/assets/mainScene/ele20.png
0 → 100644
View file @
285e9aa1
7.33 KB
egret/resource/assets/mainScene/empty.png
0 → 100644
View file @
285e9aa1
935 Bytes
egret/resource/assets/svgas/monster.svga
0 → 100644
View file @
285e9aa1
File added
egret/resource/default.res.json
View file @
285e9aa1
This diff is collapsed.
Click to expand it.
egret/src/mainScene/MainScene.ts
View file @
285e9aa1
...
...
@@ -752,13 +752,14 @@ export default class MainScene extends Scene {
this
.
elementContainer
.
addChild
(
jelly
);
this
.
lattices
[
i
].
element
=
jelly
;
break
;
//果冻怪物
case
ElementConfigType
.
JELLY_MONSTER
:
// let jelly: Element = Tool.getElement(ElementType.JELLY
)
// jelly
.x = p[0];
// jelly
.y = p[1];
// this.elementContainer.addChild(jelly
);
// this.lattices[i].element = jelly
;
this
.
emptys
.
push
(
i
);
let
monster
:
Element
=
Tool
.
getElement
(
ElementType
.
JELLY_MONSTER
)
monster
.
x
=
p
[
0
];
monster
.
y
=
p
[
1
];
this
.
elementContainer
.
addChild
(
monster
);
this
.
lattices
[
i
].
element
=
monster
;
monster
.
resetMonster
(
);
break
;
//鸡蛋
case
ElementConfigType
.
CHICKEN_EGG
:
...
...
egret/src/something/Tool.ts
View file @
285e9aa1
...
...
@@ -334,7 +334,8 @@ export class Tool {
return
false
}
//上方元素为冰淇淋
else
if
(
lat
.
element
.
type
==
ElementType
.
LOLLIPOP
)
{
else
if
(
lat
.
element
.
type
==
ElementType
.
LOLLIPOP
||
lat
.
element
.
type
==
ElementType
.
JELLY_MONSTER
)
{
return
false
}
//剩下情况
...
...
@@ -430,6 +431,7 @@ export class Tool {
ele
.
type
==
ElementType
.
JELLY
||
ele
.
type
==
ElementType
.
CHICKEN_EGG
||
ele
.
type
==
ElementType
.
LOLLIPOP
||
ele
.
type
==
ElementType
.
JELLY_MONSTER
||
ele
.
type
==
ElementType
.
FESTIVALELE_BIG
||
ele
.
type
==
ElementType
.
FESTIVALELE_SMALL
||
ele
.
hasState
(
StateType
.
LOCK
)
||
...
...
@@ -665,19 +667,19 @@ export class Tool {
if
(
effectElement
.
effectType
==
EffectType
.
MAGICLION
)
{
//上格子
var
up
=
lattices
[
effectElement
.
index
-
Tool
.
colNum
];
if
(
this
.
judgeMove
(
up
)
&&
up
.
element
.
type
!=
ElementType
.
LOLLIPOP
)
return
[
effectElement
,
up
.
element
];
if
(
this
.
judgeMove
(
up
)
&&
up
.
element
.
type
!=
ElementType
.
LOLLIPOP
&&
up
.
element
.
type
!=
ElementType
.
JELLY_MONSTER
)
return
[
effectElement
,
up
.
element
];
//下格子
var
down
=
lattices
[
effectElement
.
index
+
Tool
.
colNum
];
if
(
this
.
judgeMove
(
down
)
&&
down
.
element
.
type
!=
ElementType
.
LOLLIPOP
)
return
[
effectElement
,
down
.
element
];
if
(
this
.
judgeMove
(
down
)
&&
down
.
element
.
type
!=
ElementType
.
LOLLIPOP
&&
up
.
element
.
type
!=
ElementType
.
JELLY_MONSTER
)
return
[
effectElement
,
down
.
element
];
//左格子
var
col
=
Tool
.
indexToRc
(
effectElement
.
index
)[
1
];
//列数
if
(
col
!=
0
)
{
var
left
=
lattices
[
effectElement
.
index
-
1
];
if
(
this
.
judgeMove
(
left
)
&&
left
.
element
.
type
!=
ElementType
.
LOLLIPOP
)
return
[
effectElement
,
left
.
element
];
if
(
this
.
judgeMove
(
left
)
&&
left
.
element
.
type
!=
ElementType
.
LOLLIPOP
&&
up
.
element
.
type
!=
ElementType
.
JELLY_MONSTER
)
return
[
effectElement
,
left
.
element
];
}
if
(
col
!=
Tool
.
colNum
-
1
)
{
var
right
=
lattices
[
effectElement
.
index
+
1
];
if
(
this
.
judgeMove
(
right
)
&&
right
.
element
.
type
!=
ElementType
.
LOLLIPOP
)
return
[
effectElement
,
right
.
element
];
if
(
this
.
judgeMove
(
right
)
&&
right
.
element
.
type
!=
ElementType
.
LOLLIPOP
&&
up
.
element
.
type
!=
ElementType
.
JELLY_MONSTER
)
return
[
effectElement
,
right
.
element
];
}
continue
}
...
...
egret/src/something/chapters/Chapter14.ts
View file @
285e9aa1
...
...
@@ -52,10 +52,14 @@ export const Chapters14: ChapterData[] = [
1
,
12
,
1
,
1
,
12
,
1
,
1
,
12
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
12
,
1
,
1
,
2
,
1
,
1
,
12
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
1
,
1
],
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
1
,
12
,
1
,
1
,
2
,
1
,
1
,
12
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
2
,
1
,
1
,
1
,
1
],
baseElements
:
[
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
,
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
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
8
,
type
:
null
},
{
index
:
10
,
type
:
null
},
{
index
:
16
,
type
:
null
}]
}
}
]
\ No newline at end of file
egret/src/something/class/Element.ts
View file @
285e9aa1
...
...
@@ -25,12 +25,84 @@ import { createCandyDis1Ani } from "../anis/candy/createCandyDis1Ani";
import
{
createCandyDis2Ani
}
from
"../anis/candy/createCandyDis2Ani"
;
import
{
createCandyDis3Ani
}
from
"../anis/candy/createCandyDis3Ani"
;
import
{
createCandyDis4Ani
}
from
"../anis/candy/createCandyDis4Ani"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
/**
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
* 最好到时按,底图,动效,气泡,笼子,毛球,进行分层,如果多个状态要共存时,必须分层,到时气泡的动画,要写再自己的层里
*/
export
class
Element
extends
eui
.
Component
{
_mv
;
async
resetMonster
()
{
const
mv
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster.svga'
);
this
.
_mv
=
mv
;
this
.
addChild
(
mv
);
mv
.
anchorOffsetX
=
150
;
mv
.
anchorOffsetY
=
150
;
mv
.
x
=
-
3
;
mv
.
y
=
-
6
;
// mv.gotoAndPlay(361, true);
// mv.addEventListener(egret.Event.ENTER_FRAME, () => {
// // if (mv.currentFrame == 360) //待机
// // mv.gotoAndPlay(1, true);
// if (mv.currentFrame == 508) { //向上吹
// mv.gotoAndPlay(361, true);
// }
// if (mv.currentFrame == 361 + 100) {
// const tex: egret.Texture = RES.getRes("ele20_png");
// const pic = new egret.Bitmap(tex);
// pic.anchorOffsetX = tex.textureWidth / 2;
// pic.anchorOffsetY = tex.textureHeight;
// pic.x = p[0];
// pic.y = p[1];
// this.stage.addChild(pic);
// egret.Tween.get(pic).set({ scaleX: 0, scaleY: 0 }).to({ scaleX: 1, scaleY: 1 }, 300);
// }
// }, this);
setInterval
(()
=>
{
this
.
toAction
();
},
5000
);
}
toStandByAction
()
{
if
(
!
this
.
_mv
)
return
;
const
mv
=
this
.
_mv
;
const
cb
=
()
=>
{
if
(
mv
.
currentFrame
==
360
)
{
//向上吹
mv
.
gotoAndPlay
(
1
,
true
);
}
};
this
.
_mv
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
mv
.
gotoAndPlay
(
1
,
true
);
}
toAction
()
{
if
(
!
this
.
_mv
)
return
;
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
const
mv
=
this
.
_mv
;
const
cb
=
()
=>
{
if
(
mv
.
currentFrame
==
508
)
{
//向上吹
this
.
toStandByAction
();
}
if
(
mv
.
currentFrame
==
391
)
{
const
tex
:
egret
.
Texture
=
RES
.
getRes
(
"ele20_png"
);
const
pic
=
new
egret
.
Bitmap
(
tex
);
pic
.
anchorOffsetX
=
tex
.
textureWidth
/
2
;
pic
.
anchorOffsetY
=
tex
.
textureHeight
;
pic
.
x
=
p
[
0
];
pic
.
y
=
p
[
1
];
this
.
stage
.
addChild
(
pic
);
egret
.
Tween
.
get
(
pic
).
set
({
scaleX
:
0
,
scaleY
:
0
}).
to
({
scaleX
:
1.1
,
scaleY
:
1.1
},
300
).
wait
(
1000
).
call
(()
=>
{
pic
.
parent
.
removeChild
(
pic
);
});
}
};
this
.
_mv
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
cb
,
this
);
mv
.
gotoAndPlay
(
361
,
true
);
}
private
_candy
:
Candy
;
resetToCandyView
(
baseElement
:
CandyBaseElementType
)
{
const
res
=
transElementRes
(
baseElement
);
...
...
@@ -68,8 +140,8 @@ export class Element extends eui.Component {
const
cb
=
()
=>
{
r
();
};
this
.
showImage
.
alpha
=
0
;
this
.
candy
.
visible
=
false
;
this
.
showImage
.
alpha
=
0
;
this
.
candy
.
visible
=
false
;
var
p
=
Tool
.
getPositionByIndex
(
this
.
index
);
if
(
this
.
type
==
ElementType
.
RABBIT
)
createCandyDis0Ani
(
p
[
0
],
p
[
1
],
this
.
stage
,
cb
);
...
...
@@ -253,6 +325,7 @@ export class Element extends eui.Component {
changeSource
(
source
:
string
)
{
// this.showImage.source = source;
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
if
(
!
texture
)
return
;
this
.
showImage
.
texture
=
texture
this
.
showImage
.
x
=
-
texture
.
textureWidth
/
2
;
...
...
egret/src/something/enum/ElementType.ts
View file @
285e9aa1
...
...
@@ -35,6 +35,9 @@ export enum ElementType {
CANDY_CATTLE
,
//牛
CANDY_LION
,
//狮子
CANDY_PIG
,
//猪
MONSTER_JELLY
,
JELLY_MONSTER
,
}
export
enum
CandyBaseElementType
{
...
...
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