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
5e5729df
Commit
5e5729df
authored
Nov 05, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
05d0d630
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
14 deletions
+28
-14
MainScene.ts
egret/src/mainScene/MainScene.ts
+11
-4
FlyTargetAni.ts
egret/src/something/anis/FlyTargetAni.ts
+11
-6
FestivalTarget.ts
egret/src/something/uis/FestivalTarget.ts
+6
-4
No files found.
egret/src/mainScene/MainScene.ts
View file @
5e5729df
...
...
@@ -65,6 +65,7 @@ import { GameGuide } from '../something/uis/GameGuide';
import
{
PropBtnCon
}
from
'../something/uis/PropBtnCon'
;
import
{
ChapterNum
}
from
'../something/uis/ChapterNum'
;
import
{
CurScoreNum
}
from
'../something/uis/CurScoreNum'
;
import
{
FestivalTarget
}
from
'../something/uis/FestivalTarget'
;
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
...
...
@@ -157,6 +158,8 @@ export default class MainScene extends Scene {
//通关的目标元素的计数,下标和元素类型ElementType枚举一致
passElements
:
number
[];
elementTargets
:
ElementTargets
;
//节日元素目标
festivalTarget
:
FestivalTarget
;
//所有元素的消耗数量,需要传给后端
hasEliminatedElements
:
number
[];
//得分的动画,首先特效组合的单独算分,然后把所有符合的放入,在波及的特效触发时不算分
...
...
@@ -232,8 +235,11 @@ export default class MainScene extends Scene {
//初始化目标信息
this
.
initTarget
();
//添加节日元素,条件可能会变
if
(
data
&&
data
.
aaa
){
if
(
111
)
{
this
.
festivalTarget
=
new
FestivalTarget
();
this
.
festivalTarget
.
x
=
580
;
this
.
festivalTarget
.
y
=
115
;
this
.
addChildAt
(
this
.
festivalTarget
,
1
);
}
//初始化索引信息,包括10*10的,
Tool
.
init
(
Tool
.
getColOddEven
(
this
.
chapterData
.
map
.
lattices
),
!!
(
this
.
passElements
&&
this
.
passElements
[
ElementType
.
LOLLIPOP
]));
...
...
@@ -438,7 +444,6 @@ export default class MainScene extends Scene {
const
{
index
,
row
}
=
endRowNumHash
[
key
];
if
(
endRowNum
==
row
)
this
.
recycleIndexs
.
push
(
index
)
}
console
}
//如果有数据,直接用数据,
else
{
...
...
@@ -2607,7 +2612,9 @@ export default class MainScene extends Scene {
if
(
this
.
passElements
[
type
]
!=
0
)
{
this
.
passElements
[
type
]
--
;
var
p
=
this
.
elementTargets
.
targets
[
type
].
localToGlobal
(
40
*
0.8
,
40
*
0.8
)
FlyTargetAni
(
type
,
fromP
,
[
p
.
x
,
p
.
y
],
this
);
this
.
addChild
(
FlyTargetAni
(
type
,
fromP
,
[
p
.
x
,
p
.
y
],
()
=>
{
this
.
elementTargets
.
targets
[
type
].
count
--
;
}))
}
//数量增加
this
.
hasEliminatedElements
[
type
]
++
;
...
...
egret/src/something/anis/FlyTargetAni.ts
View file @
5e5729df
...
...
@@ -9,25 +9,30 @@ export function FlyTargetAni(
type
:
ElementType
,
fromP
:
number
[],
targetP
:
number
[],
c
on
:
egret
.
DisplayObjectContainer
c
allback
:
Function
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"ele"
+
type
+
"_png"
);
//弄一个替代的
let
eleC
:
BitmapRecycle
=
Pool
.
takeOut
(
RecoverName
.
BITMAPRECYCLE
);
if
(
!
eleC
)
{
eleC
=
new
BitmapRecycle
(
texture
);
}
else
{
}
else
{
eleC
.
reset
(
texture
);
}
eleC
.
x
=
fromP
[
0
];
eleC
.
y
=
fromP
[
1
];
con
.
addChild
(
eleC
);
egret
.
Tween
.
get
(
eleC
)
.
to
({
x
:
targetP
[
0
],
y
:
targetP
[
1
],
scaleX
:
0.3
,
scaleY
:
0.3
},
500
+
(
Math
.
random
()
*
100
)
>>
0
)
.
call
(()
=>
{
//回收
con
.
removeChild
(
eleC
);
Pool
.
recover
(
RecoverName
.
BITMAPRECYCLE
,
eleC
);
con
[
"elementTargets"
].
targets
[
type
].
count
--
;
if
(
eleC
.
parent
)
{
eleC
.
parent
.
removeChild
(
eleC
);
Pool
.
recover
(
RecoverName
.
BITMAPRECYCLE
,
eleC
);
}
//回调
callback
();
// con["elementTargets"].targets[type].count--;
})
return
eleC
}
\ No newline at end of file
egret/src/something/uis/FestivalTarget.ts
View file @
5e5729df
...
...
@@ -37,13 +37,15 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this
.
addChild
(
showImage
);
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"rightMark_png"
);
this
.
zeroMark
=
new
egret
.
Bitmap
(
texture
);
this
.
zeroMark
.
x
=
35
;
this
.
zeroMark
.
y
=
35
;
this
.
zeroMark
.
x
=
23
;
this
.
zeroMark
.
y
=
50
;
this
.
zeroMark
.
visible
=
false
;
this
.
addChild
(
this
.
zeroMark
);
this
.
countNum
=
new
TargetNumber
();
this
.
countNum
.
x
=
55
;
this
.
countNum
.
y
=
45
;
this
.
countNum
.
x
=
40
;
this
.
countNum
.
y
=
60
;
this
.
addChild
(
this
.
countNum
);
this
.
count
=
6
;
}
}
\ 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