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

Free moves seem to be broken #24

Open
staverm opened this issue Dec 22, 2020 · 1 comment
Open

Free moves seem to be broken #24

staverm opened this issue Dec 22, 2020 · 1 comment

Comments

@staverm
Copy link

staverm commented Dec 22, 2020

Setting free = true doesn't allow making moves that don't follow chess rules. We are implementing a board editor for creating chess puzzles and are in need of a "creative mode" for setting pieces to arbitrary squares.

Otherwise, great work!

@vitogit
Copy link
Owner

vitogit commented Dec 22, 2020

Thanks for the feedback, you are right. I don't have much time to update the library but I think I have a solution for your project.
A board editor seems to be a little far from the initial goal of this library but you can extend the library, here is an example to make the free movements work

 // editor.vue
  <script>
  import { chessboard }  from 'vue-chessboard'

  export default {
    name: 'editor',
    extends: chessboard,
    mounted() {
      this.board.set({
        movable: {
          color: 'both',
          free: true,
          events: { after: undefined }
        }
      })
    }
  }
  </script>

Code ref: https://github.com/vitogit/vue-chessboard-examples#extended-component-simple-board-editor
Check the last example https://vitogit.github.io/vue-chessboard-examples/

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

2 participants