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

Implement pawn promotion #3

Open
matheusmosca opened this issue Oct 6, 2020 · 4 comments
Open

Implement pawn promotion #3

matheusmosca opened this issue Oct 6, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@matheusmosca
Copy link
Owner

The promotion event happens when a pawn reaches the last row (white player) or the first row (black player).

  • The player should see a modal asking for a piece to replace his pawn
  • A pawn can only be replaced by a queen, a rook, a bishop, or a knight (with the player's color)
  • The player has to choose one piece to replace
@matheusmosca matheusmosca added help wanted Extra attention is needed hacktoberfest labels Oct 6, 2020
@nyc4m
Copy link

nyc4m commented Oct 7, 2020

Can I work on this one ? 😄

ayansiddiqui007 added a commit to ayansiddiqui007/simple-chess that referenced this issue Oct 8, 2020
Typescript is good to go You can accept the pull Request if you like it matheusmosca#3 matheusmosca#11 
#happycoding #hacktober fest !!
@ayansiddiqui007 ayansiddiqui007 mentioned this issue Oct 8, 2020
@nyc4m
Copy link

nyc4m commented Oct 9, 2020

Before adding a modal I think the code might need some rearranging, because when using a modal, you need to make the game "wait" for the player to make his choice, and currently the code is not designed to wait on something. I think it would be useful to create an other issue to adapt the code first 😄

@nyc4m
Copy link

nyc4m commented Oct 9, 2020

sorry to answer just now, i've been a bit busy these days

@matheusmosca
Copy link
Owner Author

No problem, I've been busy these days too. Could you describe better which adaption it would be? I created this repo when I get started with TypeScript, that is why my code doesn't look so good though.

But I think the modal isn't dependent on the game progress, might there is a way to create a function which observes if a pawn can be promoted, then open a modal and handle the promotion event. In that approach, the logic wouldn't be on the piece's logic.

But I may be wrong, thanks for your suggestion! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants