Skip to content

Commit

Permalink
fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Sep 10, 2024
1 parent 6848189 commit ecb55c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/bird.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Bird extends ex.Actor {
}

// Step 3
override onInitialize(engine: ex.Engine): void {
override onInitialize(): void {
// this.acc = ex.vec(0, 1500); // pixels per second per second

// Step 6
Expand All @@ -39,7 +39,7 @@ export class Bird extends ex.Actor {
}

// Step 4
override onPostUpdate(engine: ex.Engine, elapsedMs: number): void {
override onPostUpdate(engine: ex.Engine): void {
if (!this.playing) return;

// if the space bar or the first pointer was down
Expand Down Expand Up @@ -78,7 +78,7 @@ export class Bird extends ex.Actor {
}

// Step 9
override onCollisionStart(self: ex.Collider, other: ex.Collider): void {
override onCollisionStart(_self: ex.Collider, other: ex.Collider): void {
if (other.owner instanceof Pipe ||
other.owner instanceof Ground
) {
Expand Down
2 changes: 1 addition & 1 deletion src/ground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Ground extends ex.Actor {
this.graphics.use(this.groundSprite);
}

onPostUpdate(engine: ex.Engine, elapsedMs: number): void {
onPostUpdate(_engine: ex.Engine, elapsedMs: number): void {
if (!this.moving) return;
this.groundSprite.sourceView.x += Config.PipeSpeed * (elapsedMs / 1000);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pipe-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class PipeFactory {
constructor(
private level: Level,
private random: ex.Random,
private intervalMs: number) {
intervalMs: number) {
this.timer = new ex.Timer({
interval: intervalMs,
repeats: true,
Expand Down
2 changes: 1 addition & 1 deletion src/pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class Pipe extends ex.Actor {
}

// Step 9.5
override onInitialize(engine: ex.Engine): void {
override onInitialize(): void {
const pipeEnd = Resources.PipeImage.toSprite();
// Stretch the pipe sprite
// by default ImageSource use clamp which re-uses the border pixels
Expand Down

0 comments on commit ecb55c9

Please sign in to comment.