prettier
This commit is contained in:
parent
d480150728
commit
c29ce6e9a9
3 changed files with 17 additions and 8 deletions
|
@ -163,12 +163,20 @@ export abstract class Character extends Container implements OutlineableInterfac
|
|||
* Returns position based on where player is currently facing
|
||||
* @param shift How far from player should the point of interest be.
|
||||
*/
|
||||
public getDirectionalActivationPosition(shift: number): { x: number, y: number } {
|
||||
public getDirectionalActivationPosition(shift: number): { x: number; y: number } {
|
||||
switch (this.lastDirection) {
|
||||
case PlayerAnimationDirections.Down: { return { x: this.x, y: this.y + shift }; }
|
||||
case PlayerAnimationDirections.Left: { return { x: this.x - shift, y: this.y }; }
|
||||
case PlayerAnimationDirections.Right: { return { x: this.x + shift, y: this.y }; }
|
||||
case PlayerAnimationDirections.Up: { return { x: this.x, y: this.y - shift }; }
|
||||
case PlayerAnimationDirections.Down: {
|
||||
return { x: this.x, y: this.y + shift };
|
||||
}
|
||||
case PlayerAnimationDirections.Left: {
|
||||
return { x: this.x - shift, y: this.y };
|
||||
}
|
||||
case PlayerAnimationDirections.Right: {
|
||||
return { x: this.x + shift, y: this.y };
|
||||
}
|
||||
case PlayerAnimationDirections.Up: {
|
||||
return { x: this.x, y: this.y - shift };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue