+ if (!!this.selectedPiece) {
+ this.selectedPiece.parentNode.removeChild(this.selectedPiece);
+ delete this.selectedPiece;
+ this.selectedPiece = null;
+ this.start = null;
+ this.possibleMoves = []; //in case of
+ this.click = "";
+ let selected = document.querySelector(".ghost");
+ if (!!selected) selected.classList.remove("ghost");
+ }
+ else {
+ this.startArrow = null;
+ this.movingArrow = null;
+ const currentArrow = document.getElementById("currentArrow");
+ if (!!currentArrow)
+ currentArrow.parentNode.removeChild(currentArrow);
+ }