Skip to content

Commit

Permalink
fix: ビームが回転しないバグを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
teramotodaiki committed Dec 31, 2018
1 parent 35d7903 commit 9101668
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/hackforplay/object/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default class RPGObject extends enchant.Sprite implements N.INumbers {
if (this.mayRotate) {
// 画像は上向きと想定する
const angle = (this.forward.angle() / Math.PI) * 180 + 90; // 基準は上,時計回りの度数法
this._rotation = (angle + 360) % 360;
this.rotation = (angle + 360) % 360;
}
}

Expand Down Expand Up @@ -1281,6 +1281,7 @@ export default class RPGObject extends enchant.Sprite implements N.INumbers {
f(this); // スキンを適用
var routine = this.getFrameOfBehavior[this.behavior];
if (routine) this.frame = routine.call(this); // frame を設定し直す
this.rotateIfNeeded();
return f;
}).bind(this);

Expand Down
2 changes: 1 addition & 1 deletion src/hackforplay/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default class Rule {
const object = new RPGObject();
object._ruleInstance = this;
if (dir) {
object.forward = dir();
object.forward = dir(object);
}
if (x !== undefined && y !== undefined) {
object.locate(x, y, map);
Expand Down

0 comments on commit 9101668

Please sign in to comment.