diff --git a/src/abilities/Nutcase.js b/src/abilities/Nutcase.js index 2a9c1cdf6..5be99765d 100644 --- a/src/abilities/Nutcase.js +++ b/src/abilities/Nutcase.js @@ -587,7 +587,6 @@ export default (G) => { return ability.isUpgraded() ? true : creature.size <= 2; }, }); - }, // activate() : diff --git a/src/animations.ts b/src/animations.ts index 280b33594..a79387bd0 100644 --- a/src/animations.ts +++ b/src/animations.ts @@ -312,8 +312,6 @@ export class Animations { } death(creature: Creature, opts: AnimationOptions) { - const game = this.game; - // Animation Properties const length = 100; // Distance travelled in x const numSegments = 10; // "Resolution" of the curve @@ -339,9 +337,9 @@ export class Animations { } // Calculate the point in the curve - let next = { + const next = { x: startPos.x + segmentLength * currSegment, - y: startPos.y + curve.calc_y(segmentLength * currSegment) + y: startPos.y + curve.calc_y(segmentLength * currSegment), }; // Tween to point @@ -351,7 +349,7 @@ export class Animations { }); currSegment++; - } + }; // Rotate and Fade the sprite creature.creatureSprite.setAngle(opts.flipped ? -90 : 90, 500); diff --git a/src/creature.ts b/src/creature.ts index 28c61e858..8337a4412 100644 --- a/src/creature.ts +++ b/src/creature.ts @@ -1539,10 +1539,12 @@ export class Creature { this.player.deactivate(); // Here because of score calculation } - // Kill animation + // Kill animation const opts = { - callback: () => {this.destroy();}, - flipped: false + callback: () => { + this.destroy(); + }, + flipped: false, }; // Check whether or not to flip the animation diff --git a/src/data/types.ts b/src/data/types.ts index 2b9f7a081..12d0d4759 100644 --- a/src/data/types.ts +++ b/src/data/types.ts @@ -24,9 +24,9 @@ type ExtractValidCreatureTypes = { }[number]; // Create unions from the various arrays -export type UnitName = typeof unitNames[number]; -export type Realm = typeof realms[number]; -export type Level = typeof unitLevels[number]; +export type UnitName = (typeof unitNames)[number]; +export type Realm = (typeof realms)[number]; +export type Level = (typeof unitLevels)[number]; // Create a union of valid creature `type`s export type CreatureType = ExtractValidCreatureTypes; diff --git a/src/utility/curve.ts b/src/utility/curve.ts index 826ca046e..042f2d069 100644 --- a/src/utility/curve.ts +++ b/src/utility/curve.ts @@ -1,31 +1,31 @@ /** * Quadratic Curve Class - * + * * Used to define a quadratic curve of the form y = ax^2 + bx + c */ export class QuadraticCurve { - a: number; - b: number; - c: number; + a: number; + b: number; + c: number; - /** - * @constructor - * @param{number} a - Coefficient of the second order term - * @param{number} b - Coefficient of the first order term - * @param{number} c - Intercept of the curve - */ - constructor(a: number, b: number, c: number) { - this.a = a; - this.b = b; - this.c = c; - } + /** + * @constructor + * @param{number} a - Coefficient of the second order term + * @param{number} b - Coefficient of the first order term + * @param{number} c - Intercept of the curve + */ + constructor(a: number, b: number, c: number) { + this.a = a; + this.b = b; + this.c = c; + } - /** - * Calculates the resulting y value given x - * @param{number} x - the x value to use for calculation - * @returns{number} y - the resulting y value - */ - calc_y(x: number): number { - return this.a*Math.pow(x, 2) + this.b*x + this.c; - } -} \ No newline at end of file + /** + * Calculates the resulting y value given x + * @param{number} x - the x value to use for calculation + * @returns{number} y - the resulting y value + */ + calc_y(x: number): number { + return this.a * Math.pow(x, 2) + this.b * x + this.c; + } +}