headbreaker icon indicating copy to clipboard operation
headbreaker copied to clipboard

Validate placement of each tile after placing

Open edmund23 opened this issue 2 years ago • 0 comments

Hi.

First of all, nice framework, a bit to much for me, don't understand the code or better how it all combines - modules confuse me ;).

I was trying to get the tiles to validate after each connection. No luck so far. I tried with the targetPosition, metadata, ids and everything you get from in DOM, but can't get quite it to work.

I see there is a PieceValidator, but have no idea how and where to use it. Ideally there would be an event onConnect and inside you could call the PieceValidator and then do something with the tile if it's not in the correct place (move it away).

Could you point me in the right direction? Thank you.

edmund23 avatar Oct 28 '22 12:10 edmund23