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
deb521da
Commit
deb521da
authored
Feb 08, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0c645983
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
122 additions
and
15 deletions
+122
-15
MainBase.ts
egret/libs/new_wx/MainBase.ts
+1
-0
monster_shoot.png
egret/resource/assets/mainScene/monster_shoot.png
+0
-0
monster0.svga
egret/resource/assets/svgas/monster0.svga
+0
-0
monster1.svga
egret/resource/assets/svgas/monster1.svga
+0
-0
monster2.svga
egret/resource/assets/svgas/monster2.svga
+0
-0
monster3.svga
egret/resource/assets/svgas/monster3.svga
+0
-0
monster4.svga
egret/resource/assets/svgas/monster4.svga
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
doMonsterAI.ts
egret/src/mainScene/doMonsterAI.ts
+25
-5
MapScene.ts
egret/src/mapScene/MapScene.ts
+5
-0
MonsterShootAni.ts
egret/src/something/anis/MonsterShootAni.ts
+42
-0
Element.ts
egret/src/something/class/Element.ts
+1
-1
Monster.ts
egret/src/something/class/Monster.ts
+21
-8
RecoverName.ts
egret/src/something/enum/RecoverName.ts
+1
-0
home.json
mock/happyclear/home.json
+20
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
deb521da
...
...
@@ -417,6 +417,7 @@ export default class MainBase extends eui.UILayer {
"unlightedStar"
,
"mainSoundBtnOff"
,
"mainMusicBtnOff"
,
"monster_shoot"
,
]
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
RES
.
getResAsync
(
arr
[
i
]
+
"_png"
)
...
...
egret/resource/assets/mainScene/monster_shoot.png
0 → 100644
View file @
deb521da
1006 Bytes
egret/resource/assets/svgas/monster0.svga
0 → 100644
View file @
deb521da
File added
egret/resource/assets/svgas/monster1.svga
0 → 100644
View file @
deb521da
File added
egret/resource/assets/svgas/monster2.svga
0 → 100644
View file @
deb521da
File added
egret/resource/assets/svgas/monster3.svga
0 → 100644
View file @
deb521da
File added
egret/resource/assets/svgas/monster4.svga
0 → 100644
View file @
deb521da
File added
egret/resource/default.res.json
View file @
deb521da
This diff is collapsed.
Click to expand it.
egret/src/mainScene/doMonsterAI.ts
View file @
deb521da
...
...
@@ -3,10 +3,14 @@ import { StateType } from "../something/enum/StateType";
import
MainScene
from
"./MainScene"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
EffectType
}
from
"../something/enum/EffectType"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
MonsterShootAni
,
monstShootAniDur
}
from
"../something/anis/MonsterShootAni"
;
import
{
RecoverName
}
from
"../something/enum/RecoverName"
;
import
{
Pool
}
from
"../something/Pool"
;
/**
* 独眼怪爆炸
*/
export
default
(
thisObj
:
MainScene
)
=>
{
export
default
async
(
thisObj
:
MainScene
)
=>
{
//先找出所有激活的怪物
const
awakeMonsterIndexs
:
number
[]
=
[];
for
(
var
i
=
0
;
i
<
thisObj
.
lattices
.
length
;
i
++
)
{
...
...
@@ -17,7 +21,7 @@ export default (thisObj: MainScene) => {
}
}
//遍历所有基础元素
const
baseElements
:
Element
[]
=
[];
const
baseElements
:
Element
[]
=
[];
for
(
var
i
=
Tool
.
colNum
*
Tool
.
rowNum
-
1
;
i
>=
0
;
i
--
)
{
var
lat
=
thisObj
.
lattices
[
i
];
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
...
...
@@ -31,10 +35,10 @@ export default (thisObj: MainScene) => {
return
(
0.5
-
Math
.
random
());
});
let
genarateEffect
:
Element
[]
=
[];
//生成的特效的列表
let
genarateEffect
:
Element
[]
=
[];
//生成的特效的列表
const
activeMosterEles
:
Element
[]
=
awakeMonsterIndexs
.
map
(
i
=>
thisObj
.
lattices
[
i
].
element
);
const
foundsResult
:
Element
[][]
=
[];
const
foundsResult
:
Element
[][]
=
[];
//遍历激活的怪物
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
const
monsterEle
=
activeMosterEles
[
index
];
...
...
@@ -45,9 +49,25 @@ export default (thisObj: MainScene) => {
foundsResult
[
index
]
=
founds
;
}
for
(
let
index
=
0
;
index
<
activeMosterEles
.
length
;
index
++
)
{
const
monsterEle
=
activeMosterEles
[
index
];
//找到相同颜色的元素
let
founds
=
foundsResult
[
index
];
founds
.
forEach
((
ele
)
=>
{
let
bonusShootAni
:
MonsterShootAni
=
Pool
.
takeOut
(
RecoverName
.
MONSTER_SHOOT_ANI
);
if
(
!
bonusShootAni
)
bonusShootAni
=
new
MonsterShootAni
();
var
r
=
Tool
.
getForwardRotation
([
monsterEle
.
x
,
monsterEle
.
y
],
[
ele
.
x
,
ele
.
y
])
bonusShootAni
.
play
(
r
*
180
/
Math
.
PI
,
[
monsterEle
.
x
,
monsterEle
.
y
],
[
ele
.
x
,
ele
.
y
],
()
=>
{
});
thisObj
.
addChild
(
bonusShootAni
);
});
}
if
(
genarateEffect
.
length
>
0
)
await
wait
(
monstShootAniDur
);
for
(
let
index
=
0
;
index
<
foundsResult
.
length
;
index
++
)
{
const
founds
=
foundsResult
[
index
];
founds
.
forEach
(
ele
=>
{
founds
.
forEach
(
ele
=>
{
ele
.
effectType
=
Math
.
random
()
>
0.5
?
EffectType
.
HORIZONTAL
:
EffectType
.
VERTICAL
;
});
activeMosterEles
[
index
].
monster
.
resetStatus
();
...
...
egret/src/mapScene/MapScene.ts
View file @
deb521da
...
...
@@ -369,6 +369,11 @@ export default class MapScene extends Scene {
RES
.
getResAsync
(
'hbRule_bg_png'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster1.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster2.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster3.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster4.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster5.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
...
...
egret/src/something/anis/MonsterShootAni.ts
0 → 100644
View file @
deb521da
import
{
ImageAni
}
from
"../class/ImageAni"
;
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
import
{
playSound
,
SoundType
}
from
"../../soundCtrl"
;
export
const
monstShootAniDur
:
number
=
500
;
/**
* 需要回调的
* 手动修改this.shoot.rotation=
*/
export
class
MonsterShootAni
extends
egret
.
DisplayObjectContainer
{
shoot
:
egret
.
Bitmap
;
// imageAni: ImageAni
constructor
()
{
super
()
var
texture
=
RES
.
getRes
(
"monster_shoot_png"
)
this
.
shoot
=
new
egret
.
Bitmap
(
texture
);
this
.
shoot
.
anchorOffsetX
=
87
;
this
.
shoot
.
anchorOffsetY
=
28
/
2
;
this
.
addChild
(
this
.
shoot
);
}
private
reset
(
p
:
number
[])
{
this
.
x
=
p
[
0
];
this
.
y
=
p
[
1
];
}
play
(
rotation
:
number
,
from
:
number
[],
p
:
number
[],
callback
:
Function
)
{
this
.
reset
(
from
)
this
.
shoot
.
rotation
=
rotation
;
egret
.
Tween
.
get
(
this
)
.
to
({
x
:
p
[
0
],
y
:
p
[
1
]
},
monstShootAniDur
)
.
call
(()
=>
{
callback
();
if
(
this
.
parent
)
{
this
.
parent
.
removeChild
(
this
)
};
Pool
.
recover
(
RecoverName
.
MONSTER_SHOOT_ANI
,
this
)
})
}
}
\ No newline at end of file
egret/src/something/class/Element.ts
View file @
deb521da
...
...
@@ -137,7 +137,7 @@ export class Element extends eui.Component {
resetToMonsterView
(
res
:
ElementType
)
{
this
.
changeSource
(
"ele"
+
res
+
"_png"
);
this
.
monster
=
new
Monster
(
res
);
this
.
monster
=
new
Monster
(
res
,
this
.
type
);
this
.
addChild
(
this
.
monster
);
this
.
showImage
.
alpha
=
0
;
}
...
...
egret/src/something/class/Monster.ts
View file @
deb521da
import
{
ElementType
}
from
"../enum/ElementType"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
export
class
Monster
extends
eui
.
Component
{
nextStatus
()
{
this
.
_statusNum
++
;
...
...
@@ -18,32 +20,43 @@ export class Monster extends eui.Component {
return
this
.
_statusNum
==
4
;
}
private
showImage
:
eui
.
Image
;
//
private showImage: eui.Image;
/**
* 状态变化 0,1,2,3
*/
private
_statusNum
:
number
;
res
:
ElementType
;
_mv
;
getRes
()
{
return
`ele
${
this
.
res
}
_
${
this
.
_statusNum
}
_png`
;
}
constructor
(
res
:
ElementType
,
n
:
number
=
0
)
{
type
;
constructor
(
res
:
ElementType
,
type
:
number
,
n
:
number
=
0
)
{
super
();
this
.
touchEnabled
=
this
.
touchChildren
=
false
;
this
.
res
=
res
;
this
.
showImage
=
new
eui
.
Image
();
this
.
addChild
(
this
.
showImage
)
this
.
type
=
type
;
// this.showImage = new eui.Image();
// this.addChild(this.showImage)
this
.
_statusNum
=
n
;
this
.
changeSource
();
this
.
initSvga
();
}
async
initSvga
()
{
const
mv
:
any
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/monster'
+
this
.
type
+
'.svga'
);
this
.
_mv
=
mv
;
this
.
addChild
(
mv
);
mv
.
anchorOffsetX
=
87
/
2
;
mv
.
anchorOffsetY
=
92
/
2
;
}
changeSource
()
{
const
source
=
this
.
getRes
();
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
;
//
this.showImage.texture = texture;
this
.
showImage
.
anchorOffsetX
=
texture
.
textureWidth
/
2
;
this
.
showImage
.
anchorOffsetY
=
texture
.
textureHeight
/
2
;
//
this.showImage.anchorOffsetX = texture.textureWidth / 2;
//
this.showImage.anchorOffsetY = texture.textureHeight / 2;
}
// shakeAni() {
// this.showImage.rotation = 0;
...
...
egret/src/something/enum/RecoverName.ts
View file @
deb521da
...
...
@@ -17,6 +17,7 @@ export enum RecoverName {
//带回调的动画,和不带的合并不了,因为可能还有其他参数
BONUSSHOOT_ANI
=
"BonusShootAni"
,
MONSTER_SHOOT_ANI
=
"MONSTER_SHOOT_ANI"
,
JELLYSPREAD_ANI
=
"JellySpreadAni"
,
PIECETOEGG_ANI
=
"PieceToEggAni"
,
BUBBLE_ANI
=
"BubbleAni"
,
...
...
mock/happyclear/home.json
View file @
deb521da
...
...
@@ -1892,6 +1892,26 @@
"levelNum"
:
376
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
377
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
378
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
379
,
"maxScore"
:
47440
,
"stars"
:
1
},
{
"levelNum"
:
380
,
"maxScore"
:
47440
,
"stars"
:
1
}
],
"remainProp"
:
[
...
...
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