Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
IsThatRay committed Oct 28, 2023
1 parent ea1d89a commit f346644
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 36 deletions.
1 change: 0 additions & 1 deletion src/abilities/Nutcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ export default (G) => {
return ability.isUpgraded() ? true : creature.size <= 2;
},
});

},

// activate() :
Expand Down
8 changes: 3 additions & 5 deletions src/animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -351,7 +349,7 @@ export class Animations {
});

currSegment++;
}
};

// Rotate and Fade the sprite
creature.creatureSprite.setAngle(opts.flipped ? -90 : 90, 500);
Expand Down
8 changes: 5 additions & 3 deletions src/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type ExtractValidCreatureTypes<T extends UnitData> = {
}[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<UnitData>;
Expand Down
48 changes: 24 additions & 24 deletions src/utility/curve.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
/**
* 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;
}
}

0 comments on commit f346644

Please sign in to comment.