Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in Documentation: Actions #3236

Closed
mosesintech opened this issue Oct 6, 2024 · 0 comments · Fixed by #3237
Closed

Typo in Documentation: Actions #3236

mosesintech opened this issue Oct 6, 2024 · 0 comments · Fixed by #3237

Comments

@mosesintech
Copy link
Contributor

Actual Result

public Ship extends ex.Actor {
  public onInitialize() {
    const path = [
      new ex.Vector(20, 20),
      new ex.Vector(50, 40),
      new ex.Vector(25, 30),
      new ex.Vector(75, 80)
    ];
    // spawn at start point
    this.repeatForever(ctx => {
      this.x = path[0].x;
      this.y = path[0].y;
      // create action queue
      // forward path (skip first spawn point)
      for (let i = 1; i < path.length; i++) {
        ctx.moveTo(path[i].x, path[i].y, 300);
      }

      // reverse path (skip last point)
      for (let i = path.length - 2; i >= 0; i--) {
        ctx.moveTo(path[i].x, path[i].y, 300);
      }
    });
  }
}

The line this.repeatForever(ctx => { should be this.actions.repeatForever(ctx => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant