Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkey-bored committed Feb 14, 2024
1 parent 21c1c42 commit d2a7ce5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions development/code/LogicAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export function onFellOffTheBoardTriggered(
boardId: string,
) {
const squareId = getSquareIdByElement(draggedElement);
console.log('83');
if (!squareId) return;

const draggedElementPosition = getPositionFromSquareId(squareId, boardId);
Expand Down Expand Up @@ -200,7 +199,6 @@ export function endGame(){
export function changeShownInventory(player: Player) {
if (switchShownInventory(player.color)) {
player.inventory.items.forEach((item) => {
console.log(item);
showItemOnInventory(item,player.color);
});
}
Expand Down Expand Up @@ -231,7 +229,6 @@ export function placeItemOnBoard(itemElement: HTMLElement, targetElement: HTMLEl
const squarePosition = getPositionFromSquareId(squareId, currentOpenBoardId);


console.log(itemElement.id);
const usedItem = getCurrentPlayerItemById(itemElement.id);
if (!usedItem) return false;

Expand Down
2 changes: 1 addition & 1 deletion development/code/ui/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export function dragElement(element: HTMLElement) {
elementYPosition,
) as Array<HTMLElement>;
const droppedOnElement = droppedOnElements.filter(element => {
console.log(element);
return (element.classList.contains('square') ||
element.classList.contains('item') ||
element.classList.contains('piece') ) && element !== draggedElement;
})[0];


if (draggedElement.classList.contains('item')) {
if (!placeItemOnBoard(draggedElement, droppedOnElement)) {
returnItemToInventory(draggedElement);
Expand Down

0 comments on commit d2a7ce5

Please sign in to comment.