Skip to content

Commit

Permalink
docs: Adjust Bird constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Jan 2, 2025
1 parent 956056b commit 75235d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion site/docs/00-tutorial/08-step-periodic-pipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { PipeFactory } from './pipe-factory';
export class Level extends ex.Scene {
random = new ex.Random();
pipeFactory = new PipeFactory(this, this.random, Config.PipeInterval);
bird = new Bird(this);
bird = new Bird();
ground!: Ground;

onInitialize(engine: ex.Engine): void {
Expand Down
4 changes: 2 additions & 2 deletions site/docs/00-tutorial/09-step-scoring-points.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You might notice that sometimes the score double counts sometimes! Well this is

export class Bird extends ex.Actor {
...
constructor(private level: Level) {
constructor() {
super({
pos: Config.BirdStartPos,
// width: 16,
Expand All @@ -161,4 +161,4 @@ export class Bird extends ex.Actor {
...
}

```
```
3 changes: 2 additions & 1 deletion site/docs/00-tutorial/10-step-game-over.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ export class Level extends ex.Scene {
}
```

In our `Bird` we want to trigger this game over when it leaves the screen and when it collides with a `Pipe` or the `Ground`
In our `Bird` we want to trigger this game over when it leaves the screen and when it collides with a `Pipe` or the `Ground`, so we'll pass in the instance of the `Level` so we can call it's `triggerGameOver()`.

```typescript
// bird.ts
export class Bird extends ex.Actor {
playing = false;
constructor(private level: Level) { ... }
...

override onInitialize(): void {
Expand Down

0 comments on commit 75235d3

Please sign in to comment.