Commit 48a42560 by Matt

fix hit test

parent 480f2513
......@@ -102,9 +102,18 @@ class Map extends egret.Sprite {
surroundedGrids.forEach(grid => {
grid.alpha = 1
})
// const twTouchArea = egret.Tween.get( this.touchArea );
// twTouchArea.to( {alpha: 1}, 300 ).call(function() {
// })
// surroundedGrids.forEach(grid => {
// egret.Tween.get(grid).to({ alpha: 1 }, 300)
// })
runners.forEach(runner => {
if (this.touchArea.hitTestPoint(runner.x * gridWidth, runner.y * gridHeight)) {
this.runnerMap[runner.t_cid].alpha = 1
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)) {
runnerInMap.alpha = 1
}
})
this.getCatchedRunners(x, y).forEach(runner => {
......
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