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

Client doesn't receive state updates for AI moves #1208

Open
captn3m0 opened this issue Jan 9, 2025 · 0 comments
Open

Client doesn't receive state updates for AI moves #1208

captn3m0 opened this issue Jan 9, 2025 · 0 comments

Comments

@captn3m0
Copy link

captn3m0 commented Jan 9, 2025

I recently upgraded my Okiya implementation from 0.32 to 0.50, and moved away from React, following the Tic Tac Toe guide.

The game works fine with 2 player manual control. The AI works fine as well, but the AI gameplay does not trigger the state update event. The subscription is setup normally:

constructor(rootElement) {
  this.client = Client({ game: Okiya, numPlayers: 2, });
  this.client.start();
  this.rootElement = rootElement;

  this.client.subscribe(state => {
    this.update(state)
    this.attachListeners();
  });
}

As a result, the UI is not updated with AI-moves, in case react is not used. The game source is at https://github.com/captn3m0/okiya

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

No branches or pull requests

1 participant