diff --git a/src/routes/game/+page.svelte b/src/routes/game/+page.svelte index c05d7ed..edbceb0 100644 --- a/src/routes/game/+page.svelte +++ b/src/routes/game/+page.svelte @@ -29,11 +29,11 @@ let isPlaying = $state(false); // Mock player data - const players = $state([ + const players: Player[] = [ { id: 1, name: 'YourName', isHost: true }, { id: 2, name: 'Player2', isHost: false }, { id: 3, name: 'GamerX', isHost: false } - ]); + ]; // Mock cards data const mockCards = [ @@ -183,9 +183,6 @@ newCards.splice(dragTargetIndex, 0, currentCard); placedCards = newCards; - // Remove the current card - currentCard = null; - // Send update to other players via WebSocket ws.sendMessage({ type: 'cardPlaced', @@ -193,6 +190,9 @@ position: dragTargetIndex }); + // Remove the current card + currentCard = null; + // Reset the card position and style card.style.position = ''; card.style.left = ''; @@ -218,9 +218,9 @@ onMount(() => { // Set up initial game $state - placedCards = [mockCards[0]]; - cards = mockCards.slice(1); - currentCard = mockCards[1]; + placedCards = [mockCards[0], mockCards[1]]; + cards = mockCards.slice(2); + currentCard = mockCards[3]; // Set up event listeners for drag and drop window.addEventListener('mousemove', onDrag); @@ -257,7 +257,7 @@ {#if getPlayerInfo().previous}
Previous - PREVIOUS PLACE {getPlayerInfo().previous.name} + PREVIOUS NAME
{/if} @@ -269,7 +269,7 @@ {#if getPlayerInfo().next}
Next - {getPlayerInfo().next.name} + NEXT NAME
{/if} @@ -287,7 +287,7 @@