Commit 5e32cddd authored by Master Q's avatar Master Q

fix bug

parent b525a596
......@@ -38,4 +38,8 @@ export class GPool {
}
this.pool[name].push(obj);
}
public static clear() {
this.pool = Object.create(null)
}
}
\ No newline at end of file
......@@ -656,5 +656,5 @@ export const ResJson = {
"name": "svga"
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1639994156/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1640671399/resource/"
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel";
import UI from "../UI";
import IndexScene from '../scenes/IndexScene';
import { LOG_TYPE, sendLog } from '../WebNet';
interface GameOverPanelInfer {
"score": number,
......@@ -25,6 +26,7 @@ export class GameOverPanel extends Panel {
RoleContainer: FYGE.Container
initUi(): void {
sendLog(LOG_TYPE.EXPOSURE, 76)
const RoleContainer = this.RoleContainer = UI.Ctn(this, (750 - 616) / 2, (1624 -600) / 2)
UI.Sp(RoleContainer, 'atomphere.png', -50, -300)
RoleContainer.addChild(new FYGE.MovieClip(RES.getRes('获奖弹窗.svga')))
......@@ -40,6 +42,7 @@ export class GameOverPanel extends Panel {
}, this, 40, 430)
UI.Btn(RoleContainer, 'confirm-btn.png', async function() {
sendLog(LOG_TYPE.CLICK, 76)
this.onGameRestart()
this.hidePanel()
// changeScene(IndexScene)
......
......@@ -97,7 +97,8 @@ export class ConveyorBelt extends FYGE.Container {
destroy(): void {
super.destroy()
this.removeEvents
GPool.clear()
this.removeEvents()
}
/**
......
import { LOG_TYPE } from './../../WebNet';
import { Tools } from './../../Tools';
import { changeScene } from './../../../module/ctrls/index';
import { GPool } from './../../../module/tools/GPool';
......@@ -19,6 +20,7 @@ import { showPanel } from '../../../module/ctrls';
import { GameOverPanel } from '../../components/GameOverPanel';
import IndexScene from '../IndexScene';
import CircleProgressBar from '../../common/CircleProgressBar';
import { sendLog } from '../../WebNet'
const MD5 = require('js-md5')
export class RadishCountDown extends FYGE.Container {
......@@ -187,7 +189,7 @@ export class GameScene extends Scene {
const ScoreCont = UI.Ctn(this, 280, 180)
UI.Sp(ScoreCont, 'score-back.png')
this.scoreText = UI.Txt(ScoreCont, '0', 36, '#ffffff', FYGE.TEXT_ALIGN.LEFT, 400, 100, 5, true)
this.scoreText = UI.Txt(ScoreCont, '0', 36, '#ffffff', FYGE.TEXT_ALIGN.LEFT, 400, 100, 10, true)
this.onInitNormalScoreGoalBoard()
// @ts-ignore
......@@ -197,7 +199,7 @@ export class GameScene extends Scene {
const CountDownCom = UI.Ctn(this, 650, 180)
UI.Sp(CountDownCom, 'countDown-back.png')
const cdt = this.cdt = UI.Txt(CountDownCom, `${getTbData(TbNetName.doIndex).data.skiingCountdownSeconds}s`, 30, '#b1231c', FYGE.TEXT_ALIGN.CENTER, 80, 0, 36, true)
const cdt = this.cdt = UI.Txt(CountDownCom, `${getTbData(TbNetName.doIndex).data.skiingCountdownSeconds}s`, 30, '#b1231c', FYGE.TEXT_ALIGN.CENTER, 80, 0, 40, true)
// this.addChild(new FYGE.MovieClip(RES.getRes('游戏兔子.svga')))
// Rabbit.anchor.set(0.5)
// Rabbit.position.set()
......@@ -222,14 +224,14 @@ export class GameScene extends Scene {
}))
p.position.set(33, 80)
UI.Sp(p, 'progress-point.png', -10, -4)
UI.Sp(p, 'goal0', 0, -40, true)
UI.Sp(p, 'goal0', 0, -35, true)
const skiingScoreRewardCreditsList = this.skiingScoreRewardCreditsList = getTbData(TbNetName.doIndex).data.skiingScoreRewardCreditsList
const finalScore = this.maxScore = skiingScoreRewardCreditsList.slice(-1)[0].score
for (let i = 0; i < skiingScoreRewardCreditsList.length; i++) {
const goal = skiingScoreRewardCreditsList[i];
UI.Sp(p, 'progress-point.png',goal.score / finalScore * 390 - 10, -4)
const gi = UI.Sp(p, i < skiingScoreRewardCreditsList.length -1 ? 'giftbox-disabled' : 'finalgiftbox-disabled', goal.score / finalScore * 390 - 20, -60)
UI.Txt(p, `${goal.score}分`, 24, '#c14c3b', FYGE.TEXT_ALIGN.LEFT, 200, goal.score / finalScore * 390 - 20, 15)
const gi = UI.Sp(p, i < skiingScoreRewardCreditsList.length -1 ? 'giftbox-disabled' : 'finalgiftbox-disabled', goal.score / finalScore * 390 - 20, -55)
UI.Txt(p, `${goal.score}分`, 24, '#c14c3b', FYGE.TEXT_ALIGN.LEFT, 200, goal.score / finalScore * 390 - 20, 20)
// @ts-ignore
gi._goalImage = i < skiingScoreRewardCreditsList.length -1 ? 'giftbox' : 'finalgiftbox'
this.goalList.push(gi)
......@@ -276,7 +278,7 @@ export class GameScene extends Scene {
await sendTbNet(TbNetName.doModifySkiingGuideFlag, {
flag: 1
})
const { success, data } = await sendTbNet(TbNetName.doStart)
const { success, data } = await sendTbNet(TbNetName.doStart, null, null, true)
if (!success) {
changeScene(IndexScene)
return
......@@ -307,6 +309,12 @@ export class GameScene extends Scene {
this.cdt.text = `${getTbData(TbNetName.doIndex).data.skiingCountdownSeconds}s`
this.conveyorList.forEach(con => con.onReset())
let s: FYGE.MovieClip
this.currRabbitIndex = 1
this.goalList && this.goalList.forEach(item => {
// @ts-ignore
item.texture = RES.getRes(item._goalImage+'-disabled.png')
})
if (this.CountDownSvga) {
s = this.CountDownSvga
} else {
......@@ -345,7 +353,7 @@ export class GameScene extends Scene {
const {success, data} = await sendTbNet(TbNetName.doSubmit, {
startId: getTbData(TbNetName.doStart).data.startId,
score: this.score,
signStr: MD5(`${11}_${this.score}_1696BD3E5BB915A0`)
signStr: MD5(`${getTbData(TbNetName.doStart).data.startId}_${this.score}_1696BD3E5BB915A0`)
})
if (success) {
......@@ -356,7 +364,7 @@ export class GameScene extends Scene {
}
onGameRestart = async () => {
const { success, data } = await sendTbNet(TbNetName.doStart)
const { success, data } = await sendTbNet(TbNetName.doStart, null, null, true)
if (success) {
this.onStart()
} else {
......@@ -435,8 +443,8 @@ export class GameScene extends Scene {
}
initEvents(): void {
this.stage.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onTouchStart, this)
this.stage.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.onTouchUp, this)
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onTouchStart, this)
this.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.onTouchUp, this)
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onUpdate, this)
GDispatcher.addEventListener('update-score', this.onUpdateScore, this)
GDispatcher.addEventListener('game-over', this.onGameOver, this)
......@@ -445,8 +453,8 @@ export class GameScene extends Scene {
}
removeEvents(): void {
this.stage.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onTouchUp, this)
this.stage.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onTouchStart, this)
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onTouchUp, this)
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onTouchStart, this)
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onUpdate, this)
GDispatcher.removeEventListener('update-score', this.onUpdateScore, this)
GDispatcher.removeEventListener('show-radish', this.onShowRadishTips, this)
......@@ -465,6 +473,7 @@ export class GameScene extends Scene {
}
onTouchStart(e) {
if (!this.GameStatus) return
this.touchStartX = e.clientX
this.stage.addEventListener(FYGE.MouseEvent.MOUSE_MOVE, this.onTouchMove, this)
this.stage.once(FYGE.MouseEvent.MOUSE_UP, function() {
......
......@@ -8,6 +8,7 @@ import { GDispatcher } from '../Main';
import { GameScene, RadishCountDown } from './GameScene/GameScene';
import { getTbData, sendTbNet, TbNetName } from '../TaoBaoNet';
import CircleProgressBar from '../common/CircleProgressBar';
import { LOG_TYPE, sendLog } from '../WebNet';
export const IndexSceneConfig = {
ms: false
......@@ -62,6 +63,8 @@ export default class IndexScene extends Scene {
start(data?: any): void {
super.start()
sendLog(LOG_TYPE.EXPOSURE, 74)
sendLog(LOG_TYPE.EXPOSURE, 75)
sendTbNet(TbNetName.judgeLogin)
sendTbNet(TbNetName.indexSceneVisible, {visible: true})
}
......@@ -74,6 +77,7 @@ export default class IndexScene extends Scene {
}
async onGameStart() {
sendLog(LOG_TYPE.CLICK, 74)
const {success: s} = await sendTbNet(TbNetName.checkGameNum)
if (!s) {
showToast('游戏次数不足')
......@@ -102,6 +106,7 @@ export default class IndexScene extends Scene {
}
onBackActivity() {
sendLog(LOG_TYPE.CLICK, 75)
sendTbNet(TbNetName.back)
}
......
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