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

Takground: give the option to cancel a move #1

Open
UlisesTorrella opened this issue May 8, 2021 · 0 comments
Open

Takground: give the option to cancel a move #1

UlisesTorrella opened this issue May 8, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@UlisesTorrella
Copy link
Owner

Problem: If you start to move many squares in one move you can't go back, and if you hit a wall or the end of the board you are stuck and must f5 the site to keep playing.

Partial solution: Use esc key to cancel a move and go back to the begining of the move.

This changes apply only at ui/takground, in ui/takground/src/board.ts the function takMove splits the behavior of a simple move (that hits the backend) and a building move that is reflected on the client board but not server side. Also this component's state (ui/takground/src/state.ts) has a buildingMove attribute, to keep track of the UCI move to be sent. The idea would be to apply this backwards to get the board in the previous state (see the state pieces attribute). When the state of the board changes you can render it, see render function at src/render.ts.

To have in mind, in the future it would be useful to go back while building a move to an intermediate state (e.g only 1 square behind, not the entire buildingMove)

@UlisesTorrella UlisesTorrella added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant