Commit 82a944d8 authored by huangwenjie's avatar huangwenjie

音效及业务逻辑

parent c3efc5cf
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
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment