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 { PropType } from './../../commonNet';
import { UnlockPanel } from './../../panels/UnlockPanel';
......@@ -18,6 +20,8 @@ import { Graphics } from '../../../engine/2d/graphics';
import Tween from '../../../engine/tween/Tween';
import { RES } from '../../../module/RES';
import { getTools, getSoundStatus, useTools } from '../../commonNet'
import PanelCtrl from '../../../module/ctrls/panelCtrl';
import { showPanel } from '../../../module/ctrls';
export class PlayScene extends Scene {
get groupNames() { return ["playScene"] }
......@@ -259,6 +263,11 @@ export class PlayScene extends Scene {
this.bombBtn.addEventListener(MouseEvent.CLICK, this.onClick_bombBtn, this)
this.filterBtn.addEventListener(MouseEvent.CLICK, this.onClick_filterBtn, 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() {
......@@ -313,7 +322,11 @@ export class PlayScene extends Scene {
exchangeTarget1
exchangeTarget2
onClick_exchangeBtn() {
if (this.exchanging || this.exchangeCount <= 0) {
if (this.exchanging) {
return
}
if (this.exchangeCount <= 0) {
showPanel(PropOutPanel)
return
}
this.exchangeBtn.mouseEnable = false
......@@ -528,7 +541,11 @@ export class PlayScene extends Scene {
}
onClick_bombBtn() {
if (this.bombing || this.bombCount <= 0) {
if (this.bombing) {
return
}
if (this.bombCount <= 0) {
showPanel(PropOutPanel)
return
}
this.bombing = true
......@@ -549,6 +566,7 @@ export class PlayScene extends Scene {
this.bombing = false
return
}
getTools()
// 炸弹动效
var arr = [];
for (var i = 1; i <= 20; i++)arr.push(RES.getRes("bomb(" + i + ").png"));
......@@ -625,7 +643,6 @@ export class PlayScene extends Scene {
useTools((s) => {
hideWaiting()
if (!s) {
this.filterBtn.mouseEnable = true
this.removeChild(this.filterMask)
this.removeChild(this.doFilterBtn)
......@@ -633,7 +650,7 @@ export class PlayScene extends Scene {
this.removeAnis()
return
}
getTools()
var arr = [];
for (var i = 1; i <= 17; i++)arr.push(RES.getRes("filting (" + i + ").png"));
for (let x = 0; x < 4; x++) {
......@@ -676,7 +693,11 @@ export class PlayScene extends Scene {
}
onClick_filterBtn() {
if (this.filtering || this.netCount <= 0) {
if (this.filtering) {
return
}
if (this.netCount <= 0) {
showPanel(PropOutPanel)
return
}
this.filterBtn.mouseEnable = false
......@@ -767,6 +788,7 @@ export class PlayScene extends Scene {
this.bombBtn.removeEventListener(MouseEvent.CLICK, this.onClick_bombBtn, this)
this.filterBtn.removeEventListener(MouseEvent.CLICK, this.onClick_filterBtn, this)
this.musicBtn.removeEventListener(MouseEvent.CLICK, this.onClick_musicBtn, this)
this.goBackBtn.removeEventListener(MouseEvent.CLICK, this.onClick_goBackBtn, this)
}
async checkMove() {
......@@ -933,7 +955,9 @@ export class PlayScene extends Scene {
this.containerPool[x][y].addChild(ele)
if (num >= this.unlockGrade) {
if (num > this.unlockGrade) {
// 显示解锁弹窗
showPanel(UnlockPanel, { grade: 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