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
70ba928f
Commit
70ba928f
authored
Feb 14, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5efe3dd0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
235 additions
and
165 deletions
+235
-165
index.html
egret/index.html
+2
-2
doFishAI.ts
egret/src/mainScene/doFishAI.ts
+10
-4
MapScene.ts
egret/src/mapScene/MapScene.ts
+1
-0
Chapter16.ts
egret/src/something/chapters/Chapter16.ts
+140
-154
Element.ts
egret/src/something/class/Element.ts
+10
-4
Fish.ts
egret/src/something/class/Fish.ts
+71
-0
home.json
mock/happyclear/home.json
+1
-1
No files found.
egret/index.html
View file @
70ba928f
...
@@ -138,8 +138,8 @@
...
@@ -138,8 +138,8 @@
// localStorage.clear();
// localStorage.clear();
window
[
'imgver'
]
=
'11112'
;
window
[
'imgver'
]
=
'11112'
;
//top 8 ,repeat 22 , bottom 3
//top 8 ,repeat 22 , bottom 3
window
[
'total_level'
]
=
8
+
3
+
22
*
20
;
window
[
'total_level'
]
=
8
+
3
+
22
*
19
;
window
[
'last_level'
]
=
4
51
;
window
[
'last_level'
]
=
4
25
;
var
sharePic
=
document
.
getElementById
(
'pic'
);
var
sharePic
=
document
.
getElementById
(
'pic'
);
...
...
egret/src/mainScene/doFishAI.ts
View file @
70ba928f
...
@@ -3,6 +3,7 @@ import { ElementType } from "../something/enum/ElementType";
...
@@ -3,6 +3,7 @@ import { ElementType } from "../something/enum/ElementType";
import
wait
from
"../../libs/new_tc/wait"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
{
Lattice
}
from
"../something/class/Lattice"
;
import
{
RecoverName
}
from
"../something/enum/RecoverName"
;
/**
/**
* fish爆炸
* fish爆炸
*/
*/
...
@@ -20,19 +21,24 @@ export default async (thisObj: MainScene) => {
...
@@ -20,19 +21,24 @@ export default async (thisObj: MainScene) => {
}
}
for
(
const
index
of
indexs
)
{
for
(
const
index
of
indexs
)
{
const
lat
:
Lattice
=
thisObj
.
lattices
[
index
];
const
lat
:
Lattice
=
thisObj
.
lattices
[
index
];
lat
.
element
[
'fish'
].
toExplose
();
// wait(1000).then(()=>{
const
p
=
Tool
.
getPositionByIndex
(
index
);
var
boomAni
=
thisObj
.
playAni
(
RecoverName
.
BOOM_ANI
,
p
);
boomAni
.
scaleX
=
boomAni
.
scaleY
=
1
;
// });
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
if
(
Tool
.
judgeEliminate
(
thisObj
.
lattices
[
i
])
&&
if
(
Tool
.
judgeEliminate
(
thisObj
.
lattices
[
i
])
&&
(
Math
.
abs
(
thisObj
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
))
{
(
Math
.
abs
(
thisObj
.
lattices
[
i
].
row
-
lat
.
row
)
<
2
&&
Math
.
abs
(
thisObj
.
lattices
[
i
].
column
-
lat
.
column
)
<
2
))
{
if
(
thisObj
.
eliminatedElements
.
indexOf
(
thisObj
.
lattices
[
i
].
index
)
<
0
)
{
if
(
thisObj
.
eliminatedElements
.
indexOf
(
thisObj
.
lattices
[
i
].
index
)
<
0
)
{
thisObj
.
eliminatedElements
.
push
(
thisObj
.
lattices
[
i
].
index
);
thisObj
.
eliminatedElements
.
push
(
thisObj
.
lattices
[
i
].
index
);
}
}
}
}
}
}
}
}
await
wait
(
500
);
await
wait
(
500
);
//然后再消除四周的
// await wait(500+1000);
return
indexs
;
return
indexs
;
}
}
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
70ba928f
...
@@ -371,6 +371,7 @@ export default class MapScene extends Scene {
...
@@ -371,6 +371,7 @@ export default class MapScene extends Scene {
RES
.
getResAsync
(
'hbRule_bg_png'
);
RES
.
getResAsync
(
'hbRule_bg_png'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/fish.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster0.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster0.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
...
...
egret/src/something/chapters/Chapter16.ts
View file @
70ba928f
This diff is collapsed.
Click to expand it.
egret/src/something/class/Element.ts
View file @
70ba928f
...
@@ -29,6 +29,7 @@ import { FestivalEle2 } from "./FestivalEle2";
...
@@ -29,6 +29,7 @@ import { FestivalEle2 } from "./FestivalEle2";
import
{
Monster
}
from
"./Monster"
;
import
{
Monster
}
from
"./Monster"
;
import
{
State
}
from
"./State"
;
import
{
State
}
from
"./State"
;
import
wait
from
"../../../libs/new_tc/wait"
;
import
wait
from
"../../../libs/new_tc/wait"
;
import
{
Fish
}
from
"./Fish"
;
/**
/**
* 考虑到底继承白鹭的啥Component还是Container
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
* 坐标原点需要坐落在格子的中心点
...
@@ -49,7 +50,7 @@ export class Element extends eui.Component {
...
@@ -49,7 +50,7 @@ export class Element extends eui.Component {
await
wait
(
1000
);
await
wait
(
1000
);
this
.
_fishState
++
;
this
.
_fishState
++
;
if
(
this
.
_fishState
==
1
)
{
if
(
this
.
_fishState
==
1
)
{
this
.
changeSource
(
"ele33_1_png"
);
this
[
'fish'
].
toActive
(
);
}
}
}
}
...
@@ -163,10 +164,10 @@ export class Element extends eui.Component {
...
@@ -163,10 +164,10 @@ export class Element extends eui.Component {
resetToFishView
()
{
resetToFishView
()
{
this
.
_fishState
=
0
;
this
.
_fishState
=
0
;
this
.
_isNeb
=
false
;
this
.
_isNeb
=
false
;
this
[
'fish'
]
=
new
Fish
();
this
.
addChild
(
this
[
'fish'
]);
this
.
changeSource
(
"ele33_0_png"
);
this
.
changeSource
(
"ele33_0_png"
);
// this.monster = new Monster(res,this.type);
this
.
showImage
.
alpha
=
0
;
// this.addChild(this.monster);
// this.showImage.alpha = 0;
}
}
private
_candy
:
Candy
;
private
_candy
:
Candy
;
...
@@ -452,6 +453,11 @@ export class Element extends eui.Component {
...
@@ -452,6 +453,11 @@ export class Element extends eui.Component {
this
.
monster
.
removeEvents
();
this
.
monster
.
removeEvents
();
this
.
monster
=
null
;
this
.
monster
=
null
;
}
}
if
(
this
[
'fish'
])
{
this
.
removeChild
(
this
[
'fish'
]);
this
[
'fish'
].
removeEvents
();
this
[
'fish'
]
=
null
;
}
//如果类型是节日红包大
//如果类型是节日红包大
if
(
type
==
ElementType
.
FESTIVALELE_BIG
)
{
if
(
type
==
ElementType
.
FESTIVALELE_BIG
)
{
this
.
festivalEle
=
this
.
festivalEle
||
Pool
.
takeOut
(
RecoverName
.
FESTIVAL_ELE
)
this
.
festivalEle
=
this
.
festivalEle
||
Pool
.
takeOut
(
RecoverName
.
FESTIVAL_ELE
)
...
...
egret/src/something/class/Fish.ts
0 → 100644
View file @
70ba928f
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
{
createMonsterStatusAni
}
from
"../../effect/createMonsterStatusAni"
;
const
frames
=
[
[
1
,
120
],
[
121
,
360
],
[
361
,
600
],
[
601
,
960
],
];
export
class
Fish
extends
eui
.
Component
{
_mv
;
constructor
()
{
super
();
this
.
initSvga
();
}
async
initSvga
()
{
const
mv
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/fish.svga'
);
this
.
_mv
=
mv
;
this
.
addChild
(
mv
);
mv
.
anchorOffsetX
=
80
/
2
;
mv
.
anchorOffsetY
=
80
/
2
;
this
.
addEvents
();
this
.
toStandBy
();
}
toStandBy
()
{
this
.
_mv
.
gotoAndPlay
(
1
);
this
.
_start
=
1
this
.
_end
=
180
}
toActive
()
{
this
.
_mv
.
gotoAndPlay
(
181
);
this
.
_start
=
-
1
this
.
_end
=
-
1
}
toExplose
()
{
this
.
_mv
.
stop
();
// this._mv.gotoAndPlay(361);
// this._start = -1
// this._end = -1
}
private
addEvents
()
{
this
.
_mv
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
private
_start
=
-
1
;
private
_end
=
-
1
;
onEnterFrame
()
{
if
(
this
.
_mv
.
currentFrame
==
240
)
{
this
.
_start
=
241
;
this
.
_end
=
360
;
}
if
(
this
.
_mv
.
currentFrame
==
(
361
+
1
))
{
this
.
_start
=
-
1
;
this
.
_end
=
-
1
;
this
.
_mv
.
stop
();
this
.
removeEvents
();
}
if
(
this
.
_start
!=
-
1
&&
this
.
_end
!=
-
1
)
{
if
(
this
.
_mv
.
currentFrame
==
this
.
_end
)
{
this
.
_mv
.
gotoAndPlay
(
this
.
_start
);
}
}
}
removeEvents
()
{
this
.
_mv
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
}
\ No newline at end of file
mock/happyclear/home.json
View file @
70ba928f
...
@@ -1132,7 +1132,7 @@
...
@@ -1132,7 +1132,7 @@
"maxScore"
:
47440
,
"maxScore"
:
47440
,
"stars"
:
1
"stars"
:
1
},
},
{
{
"levelNum"
:
226
,
"levelNum"
:
226
,
"maxScore"
:
47440
,
"maxScore"
:
47440
,
...
...
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