Skip to content

Commit

Permalink
fix: 斜めに歩くと距離が短くなるバグ
Browse files Browse the repository at this point in the history
  • Loading branch information
teramotodaiki committed Jan 13, 2019
1 parent 2dfdaaa commit 58cabdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hackforplay/object/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,9 @@ export default class RPGObject extends enchant.Sprite implements N.INumbers {
const ty = this.map.tileNumY;

// 移動先
const nextX = this.mapX + forward.x;
const nextY = this.mapY + forward.y;
const unit = Vector2.from(forward).unit8();
const nextX = this.mapX + unit.x;
const nextY = this.mapY + unit.y;

let isHit = this.map.hitTest(nextX * tw, nextY * th);

Expand Down

0 comments on commit 58cabdf

Please sign in to comment.