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
adeee341
Commit
adeee341
authored
Aug 23, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
1a096253
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
23 deletions
+37
-23
MainScene.ts
egret/src/mainScene/MainScene.ts
+35
-9
Chapters.ts
egret/src/something/Chapters.ts
+1
-0
home.json
mock/happyclear/home.json
+1
-14
No files found.
egret/src/mainScene/MainScene.ts
View file @
adeee341
...
...
@@ -58,7 +58,7 @@ const aniClass = {
"EleDisAni"
:
EleDisAni
,
"MagicLionAni"
:
MagicLionAni
,
}
const
baseScore
=
20
;
const
baseScore
=
20
;
/**
* 直线特效(4) 1.5倍
* 爆炸特效(L) 2.0倍
...
...
@@ -683,9 +683,12 @@ export default class MainScene extends Scene {
this
.
choosed
.
parent
.
removeChild
(
this
.
choosed
)
}
let
fun
:
Function
;
this
.
elementContainer
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
=
function
()
{
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
,
this
);
this
.
sendPropUse
(
prop
);
this
.
elementContainer
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
=
function
(
e
)
{
if
(
e
.
target
.
parent
instanceof
Element
&&
e
.
target
.
parent
.
type
!=
ElementType
.
ROCK
)
{
this
.
elementContainer
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
fun
,
this
);
var
index
=
e
.
target
.
parent
.
index
;
this
.
sendPropUse
(
prop
,
index
);
}
},
this
)
}
else
{
if
(
!
this
.
stepCircle
)
{
...
...
@@ -701,7 +704,7 @@ export default class MainScene extends Scene {
this
.
addChild
(
this
.
stepCircle
)
}
}
sendPropUse
(
prop
:
PropType
)
{
sendPropUse
(
prop
:
PropType
,
index
?:
number
)
{
Loading2
.
instace
.
show
();
this
.
removeChild
(
this
.
propGuide
);
NetManager
.
ins
.
hc_useProp
((
s
)
=>
{
...
...
@@ -709,24 +712,47 @@ export default class MainScene extends Scene {
//还原事件
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
if
(
prop
==
PropType
.
BOOM
||
prop
==
PropType
.
HAMMER
)
{
this
.
enableMouseEvt
(
false
)
this
.
elementContainer
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
mouseDownE
,
this
);
this
.
elementContainer
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_MOVE
,
this
.
mouseMoveE
,
this
);
}
else
{
this
.
removeChild
(
this
.
stepCircle
)
showToast
(
"步数增加成功"
)
}
if
(
!
s
)
return
//成功的
switch
(
prop
)
{
case
PropType
.
BOOM
:
playSound
(
SoundType
.
line
)
var
rc
=
Tool
.
indexToRc
(
index
);
var
p
=
Tool
.
getPositionByIndex
(
index
);
this
.
playAni
(
RecoverName
.
CROSS_ANI
,
p
);
for
(
var
i
=
0
;
i
<
this
.
lattices
.
length
;
i
++
)
{
var
lat
=
this
.
lattices
[
i
];
if
(
Tool
.
judgeEliminate
(
lat
)
&&
(
lat
.
row
==
rc
[
0
]
||
lat
.
column
==
rc
[
1
]))
{
this
.
eliminatedElements
.
push
(
i
);
if
(
!
lat
.
element
.
isLock
)
{
//3倍
this
.
pushScoreAni
(
baseScore
*
1
*
3
,
Tool
.
getPositionByIndex
(
i
))
}
}
}
setTimeout
(()
=>
{
this
.
eliminate
();
},
200
)
break
;
case
PropType
.
HAMMER
:
this
.
eliminatedElements
.
push
(
index
);
this
.
eliminate
();
break
;
case
PropType
.
CHANCE_NUM
:
this
.
steps
+=
5
;
showToast
(
"步数增加成功"
);
break
;
}
//更新道具数量
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
prop
)
}
mouseDownE
(
e
:
egret
.
TextEvent
)
{
...
...
@@ -2125,7 +2151,7 @@ export default class MainScene extends Scene {
var
txt
=
codeMsgs
[
data
.
code
]
||
"活动太火爆了
\n
请稍后再来"
;
showToast
(
txt
);
setTimeout
(()
=>
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAP_SCENE
,
createData
());
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAP_SCENE
,
createData
());
},
1300
)
}
}
...
...
egret/src/something/Chapters.ts
View file @
adeee341
...
...
@@ -597,4 +597,5 @@ export const Chapters: ChapterData[] = [
starScores
:
[
11000
,
22000
,
45000
]
},
//////////////////////
]
\ No newline at end of file
mock/happyclear/home.json
View file @
adeee341
...
...
@@ -7,20 +7,7 @@
"wealth"
:
13
,
"totalStars"
:
120
,
"levels"
:
[],
"remainProp"
:
[
{
"type"
:
2
,
"num"
:
4
},
{
"type"
:
3
,
"num"
:
4
},
{
"type"
:
4
,
"num"
:
5
}
],
"remainProp"
:
[],
"remainEnargy"
:
15
,
"askForEnergy"
:
false
,
"canReceiveTreasureBoxNum"
:
10
,
...
...
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