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

Change the "select player" selectors to a text fields where the players can enter the name #2

Open
kevincardonag opened this issue Sep 15, 2022 · 1 comment

Comments

@kevincardonag
Copy link
Collaborator

kevincardonag commented Sep 15, 2022

In the node app you can select the player, it is a bit confusing when users try to start a game and It also has a disadvantage because the second player could enter to a player1’s room, so I think is better to have a username text field to avoid to enter to the wrong room.
image

Necessary changes:

  • Remove the selectors in the home.tsx file
  • Create an input field instead
  • Adjust the handlePlayerForNewGameChange function to set the setPlayerForNewGame variable properly
  • Update the interface of players on the file components/game/types.ts
  • Update the useRedirectToGame, GamePage, GameContextProvider functions to allow string instead of int as player
  • Save the player1 and player2 name in the database
  • Check if there are other functions that receive the player as int
  • Check the impact of changing the player as a string in the database and refactor it in case of finding inconsistencies.
@kevincardonag
Copy link
Collaborator Author

solved in the pr #4

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