Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game2048
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
熊东起
game2048
Commits
82a944d8
Commit
82a944d8
authored
Apr 24, 2020
by
huangwenjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音效及业务逻辑
parent
c3efc5cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
PlayScene.ts
src/scenes/playScene/PlayScene.ts
+30
-6
No files found.
src/scenes/playScene/PlayScene.ts
View file @
82a944d8
import
{
QuitPanel
}
from
'./../../panels/QuitPanel'
;
import
{
PropOutPanel
}
from
'./../../panels/PropOutPanel'
;
import
{
showWaiting
,
hideWaiting
}
from
'./../../../module/ctrls/waitingCtrl'
;
import
{
showWaiting
,
hideWaiting
}
from
'./../../../module/ctrls/waitingCtrl'
;
import
{
PropType
}
from
'./../../commonNet'
;
import
{
PropType
}
from
'./../../commonNet'
;
import
{
UnlockPanel
}
from
'./../../panels/UnlockPanel'
;
import
{
UnlockPanel
}
from
'./../../panels/UnlockPanel'
;
...
@@ -18,6 +20,8 @@ import { Graphics } from '../../../engine/2d/graphics';
...
@@ -18,6 +20,8 @@ import { Graphics } from '../../../engine/2d/graphics';
import
Tween
from
'../../../engine/tween/Tween'
;
import
Tween
from
'../../../engine/tween/Tween'
;
import
{
RES
}
from
'../../../module/RES'
;
import
{
RES
}
from
'../../../module/RES'
;
import
{
getTools
,
getSoundStatus
,
useTools
}
from
'../../commonNet'
import
{
getTools
,
getSoundStatus
,
useTools
}
from
'../../commonNet'
import
PanelCtrl
from
'../../../module/ctrls/panelCtrl'
;
import
{
showPanel
}
from
'../../../module/ctrls'
;
export
class
PlayScene
extends
Scene
{
export
class
PlayScene
extends
Scene
{
get
groupNames
()
{
return
[
"playScene"
]
}
get
groupNames
()
{
return
[
"playScene"
]
}
...
@@ -259,6 +263,11 @@ export class PlayScene extends Scene {
...
@@ -259,6 +263,11 @@ export class PlayScene extends Scene {
this
.
bombBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_bombBtn
,
this
)
this
.
bombBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_bombBtn
,
this
)
this
.
filterBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_filterBtn
,
this
)
this
.
filterBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_filterBtn
,
this
)
this
.
musicBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_musicBtn
,
this
)
this
.
musicBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_musicBtn
,
this
)
this
.
goBackBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_goBackBtn
,
this
)
}
onClick_goBackBtn
()
{
showPanel
(
QuitPanel
,
{
grade
:
this
.
unlockGrade
,
score
:
this
.
score
})
}
}
onClick_musicBtn
()
{
onClick_musicBtn
()
{
...
@@ -313,7 +322,11 @@ export class PlayScene extends Scene {
...
@@ -313,7 +322,11 @@ export class PlayScene extends Scene {
exchangeTarget1
exchangeTarget1
exchangeTarget2
exchangeTarget2
onClick_exchangeBtn
()
{
onClick_exchangeBtn
()
{
if
(
this
.
exchanging
||
this
.
exchangeCount
<=
0
)
{
if
(
this
.
exchanging
)
{
return
}
if
(
this
.
exchangeCount
<=
0
)
{
showPanel
(
PropOutPanel
)
return
return
}
}
this
.
exchangeBtn
.
mouseEnable
=
false
this
.
exchangeBtn
.
mouseEnable
=
false
...
@@ -528,7 +541,11 @@ export class PlayScene extends Scene {
...
@@ -528,7 +541,11 @@ export class PlayScene extends Scene {
}
}
onClick_bombBtn
()
{
onClick_bombBtn
()
{
if
(
this
.
bombing
||
this
.
bombCount
<=
0
)
{
if
(
this
.
bombing
)
{
return
}
if
(
this
.
bombCount
<=
0
)
{
showPanel
(
PropOutPanel
)
return
return
}
}
this
.
bombing
=
true
this
.
bombing
=
true
...
@@ -549,6 +566,7 @@ export class PlayScene extends Scene {
...
@@ -549,6 +566,7 @@ export class PlayScene extends Scene {
this
.
bombing
=
false
this
.
bombing
=
false
return
return
}
}
getTools
()
// 炸弹动效
// 炸弹动效
var
arr
=
[];
var
arr
=
[];
for
(
var
i
=
1
;
i
<=
20
;
i
++
)
arr
.
push
(
RES
.
getRes
(
"bomb("
+
i
+
").png"
));
for
(
var
i
=
1
;
i
<=
20
;
i
++
)
arr
.
push
(
RES
.
getRes
(
"bomb("
+
i
+
").png"
));
...
@@ -625,7 +643,6 @@ export class PlayScene extends Scene {
...
@@ -625,7 +643,6 @@ export class PlayScene extends Scene {
useTools
((
s
)
=>
{
useTools
((
s
)
=>
{
hideWaiting
()
hideWaiting
()
if
(
!
s
)
{
if
(
!
s
)
{
this
.
filterBtn
.
mouseEnable
=
true
this
.
filterBtn
.
mouseEnable
=
true
this
.
removeChild
(
this
.
filterMask
)
this
.
removeChild
(
this
.
filterMask
)
this
.
removeChild
(
this
.
doFilterBtn
)
this
.
removeChild
(
this
.
doFilterBtn
)
...
@@ -633,7 +650,7 @@ export class PlayScene extends Scene {
...
@@ -633,7 +650,7 @@ export class PlayScene extends Scene {
this
.
removeAnis
()
this
.
removeAnis
()
return
return
}
}
getTools
()
var
arr
=
[];
var
arr
=
[];
for
(
var
i
=
1
;
i
<=
17
;
i
++
)
arr
.
push
(
RES
.
getRes
(
"filting ("
+
i
+
").png"
));
for
(
var
i
=
1
;
i
<=
17
;
i
++
)
arr
.
push
(
RES
.
getRes
(
"filting ("
+
i
+
").png"
));
for
(
let
x
=
0
;
x
<
4
;
x
++
)
{
for
(
let
x
=
0
;
x
<
4
;
x
++
)
{
...
@@ -676,7 +693,11 @@ export class PlayScene extends Scene {
...
@@ -676,7 +693,11 @@ export class PlayScene extends Scene {
}
}
onClick_filterBtn
()
{
onClick_filterBtn
()
{
if
(
this
.
filtering
||
this
.
netCount
<=
0
)
{
if
(
this
.
filtering
)
{
return
}
if
(
this
.
netCount
<=
0
)
{
showPanel
(
PropOutPanel
)
return
return
}
}
this
.
filterBtn
.
mouseEnable
=
false
this
.
filterBtn
.
mouseEnable
=
false
...
@@ -767,6 +788,7 @@ export class PlayScene extends Scene {
...
@@ -767,6 +788,7 @@ export class PlayScene extends Scene {
this
.
bombBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_bombBtn
,
this
)
this
.
bombBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_bombBtn
,
this
)
this
.
filterBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_filterBtn
,
this
)
this
.
filterBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_filterBtn
,
this
)
this
.
musicBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_musicBtn
,
this
)
this
.
musicBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_musicBtn
,
this
)
this
.
goBackBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
onClick_goBackBtn
,
this
)
}
}
async
checkMove
()
{
async
checkMove
()
{
...
@@ -933,7 +955,9 @@ export class PlayScene extends Scene {
...
@@ -933,7 +955,9 @@ export class PlayScene extends Scene {
this
.
containerPool
[
x
][
y
].
addChild
(
ele
)
this
.
containerPool
[
x
][
y
].
addChild
(
ele
)
if
(
num
>=
this
.
unlockGrade
)
{
if
(
num
>
this
.
unlockGrade
)
{
// 显示解锁弹窗
showPanel
(
UnlockPanel
,
{
grade
:
num
})
this
.
unlockGrade
=
num
this
.
unlockGrade
=
num
}
}
}
}
...
...
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