Commit 68543aaa by Mike Zhu

Merge branch 'develop' of cd.i.strikingly.com:shawn.wang/crazyflirt into develop

parents 2fcd99db 52332cf4
......@@ -8,6 +8,7 @@ class Map extends egret.Sprite {
public isShowingTouchArea
private runnerMap:any = {}
private runnerList:any = []
private catchedTip: egret.Bitmap = new egret.Bitmap()
public constructor() {
super();
this.init()
......@@ -52,6 +53,12 @@ class Map extends egret.Sprite {
this.showClickedGrid(x, y)
}
})
this.catchedTip.texture = RES.getRes('catched_jpg')
this.catchedTip.alpha = 0
this.catchedTip.x = 604
this.catchedTip.y = 316
this.addChild(this.catchedTip)
}
public getSurroundedGrids(x, y) {
......@@ -81,8 +88,8 @@ class Map extends egret.Sprite {
public getCatchedRunners(x, y) {
const catchedRunners = []
Store.getState().runners.forEach(runner => {
const updatedRunner = this.runnerMap[runner.t_cid]
if (updatedRunner.x === x && updatedRunner.y === y) {
const runnerInMap = this.runnerMap[runner.t_cid]
if (runnerInMap.x === x && runnerInMap.y === y) {
catchedRunners.push(runner)
}
})
......@@ -118,7 +125,8 @@ class Map extends egret.Sprite {
runnerInMap.alpha = 1
}
})
this.getCatchedRunners(x, y).forEach(runner => {
const catchedRunners = this.getCatchedRunners(x, y)
catchedRunners.forEach(runner => {
platform.sendSocketMessage({
data: JSON.stringify({
......@@ -135,12 +143,15 @@ class Map extends egret.Sprite {
})
if (Store.isMe(runner.t_cid) || Store.isCatcher()) {
SoundManager.getInstance().playCatched()
const tween = egret.Tween.get(this.catchedTip);
tween.to({alpha: 1}, 300).wait(500).to({alpha: 0}, 300)
}
if (Store.isCatcher()) {
this.runnerMap[runner.t_cid].alpha = 0
}
})
setTimeout(() => {
centerGrid.bg.texture = RES.getRes('grid_jpg')
surroundedGrids.forEach(grid => {
......
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