Commit 613892d1 by Mike Zhu

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

parents 1f4ef36c de3bcbb0
......@@ -96,27 +96,31 @@ class Map extends egret.Sprite {
centerGrid.bg.texture = RES.getRes('grid_select_jpg')
const runners = Store.getState().runners
this.touchArea.alpha = 1
// this.touchArea.alpha = 1
this.touchArea.x = x - 2 * gridWidth
this.touchArea.y = y - 2 * gridHeight
// surroundedGrids.forEach(grid => {
// grid.alpha = 1
// })
const twTouchArea = egret.Tween.get( this.touchArea );
twTouchArea.to( {alpha: 1}, 300 ).call(function() {
surroundedGrids.forEach(grid => {
grid.alpha = 1
})
// const twTouchArea = egret.Tween.get( this.touchArea );
// twTouchArea.to( {alpha: 1}, 300 ).call(function() {
// })
// egret.Tween.get(grid).to({ alpha: 1 }, 300)
})
// surroundedGrids.forEach(grid => {
// egret.Tween.get(grid).to({ alpha: 1 }, 300)
// })
runners.forEach(runner => {
console.log(runner.x, runner.y, this.touchArea.hitTestPoint(runner.x * gridWidth, runner.y * gridHeight))
const runnerInMap = this.runnerMap[runner.t_cid]
if (this.touchArea.hitTestPoint(runnerInMap.x * gridWidth, runnerInMap.y * gridHeight)) {
if (this.touchArea.hitTestPoint(runnerInMap.x, runnerInMap.y)) {
runnerInMap.alpha = 1
}
})
this.getCatchedRunners(x, y).forEach(runner => {
platform.sendSocketMessage({
data: JSON.stringify({
type: 'catch',
......@@ -133,6 +137,10 @@ class Map extends egret.Sprite {
if (Store.isMe(runner.t_cid) || Store.isCatcher()) {
SoundManager.getInstance().playCatched()
}
if (Store.isCatcher()) {
this.runnerMap[runner.t_cid].alpha = 0
}
})
setTimeout(() => {
centerGrid.bg.texture = RES.getRes('grid_jpg')
......
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