diff --git a/handtris/public/gif/tetris.gif b/handtris/public/gif/tetris.gif deleted file mode 100644 index b597a7b..0000000 Binary files a/handtris/public/gif/tetris.gif and /dev/null differ diff --git a/handtris/public/gif/tetris_.mp4 b/handtris/public/gif/tetris_.mp4 deleted file mode 100644 index 9a6e7e3..0000000 Binary files a/handtris/public/gif/tetris_.mp4 and /dev/null differ diff --git a/handtris/public/sound/Click Sound 47609.mp3 b/handtris/public/sound/Click Sound 47609.mp3 deleted file mode 100644 index 526bade..0000000 Binary files a/handtris/public/sound/Click Sound 47609.mp3 and /dev/null differ diff --git a/handtris/public/sound/Click.mp3 b/handtris/public/sound/Click.mp3 deleted file mode 100644 index 9161305..0000000 Binary files a/handtris/public/sound/Click.mp3 and /dev/null differ diff --git a/handtris/public/sound/Menu Click Sound.mp3 b/handtris/public/sound/Menu Click Sound.mp3 deleted file mode 100644 index bf035d2..0000000 Binary files a/handtris/public/sound/Menu Click Sound.mp3 and /dev/null differ diff --git a/handtris/public/sound/ThemeMusic.mp3 b/handtris/public/sound/ThemeMusic.mp3 deleted file mode 100644 index 2a02b6a..0000000 Binary files a/handtris/public/sound/ThemeMusic.mp3 and /dev/null differ diff --git a/handtris/public/sound/ThemeMusic2.mp3 b/handtris/public/sound/ThemeMusic2.mp3 deleted file mode 100644 index ea3c84a..0000000 Binary files a/handtris/public/sound/ThemeMusic2.mp3 and /dev/null differ diff --git a/handtris/public/sounds/attack.wav b/handtris/public/sound/attack.wav similarity index 100% rename from handtris/public/sounds/attack.wav rename to handtris/public/sound/attack.wav diff --git a/handtris/public/sound/chaves.ogg b/handtris/public/sound/chaves.ogg deleted file mode 100644 index 5e48207..0000000 Binary files a/handtris/public/sound/chaves.ogg and /dev/null differ diff --git a/handtris/public/sound/clear.ogg b/handtris/public/sound/clear.ogg deleted file mode 100644 index 3308a5a..0000000 Binary files a/handtris/public/sound/clear.ogg and /dev/null differ diff --git a/handtris/public/sounds/clear.wav b/handtris/public/sound/clear.wav similarity index 100% rename from handtris/public/sounds/clear.wav rename to handtris/public/sound/clear.wav diff --git a/handtris/public/sound/combo.ogg b/handtris/public/sound/combo.ogg deleted file mode 100644 index cb99aef..0000000 Binary files a/handtris/public/sound/combo.ogg and /dev/null differ diff --git a/handtris/public/sound/combo_ext.ogg b/handtris/public/sound/combo_ext.ogg deleted file mode 100644 index be1da72..0000000 Binary files a/handtris/public/sound/combo_ext.ogg and /dev/null differ diff --git a/handtris/public/sound/dialog.mp3 b/handtris/public/sound/dialog.mp3 deleted file mode 100644 index 9dc9481..0000000 Binary files a/handtris/public/sound/dialog.mp3 and /dev/null differ diff --git a/handtris/public/sounds/harddrop.mp3 b/handtris/public/sound/harddrop.mp3 similarity index 100% rename from handtris/public/sounds/harddrop.mp3 rename to handtris/public/sound/harddrop.mp3 diff --git a/handtris/public/sound/hold.ogg b/handtris/public/sound/hold.ogg deleted file mode 100644 index 2ef7d3d..0000000 Binary files a/handtris/public/sound/hold.ogg and /dev/null differ diff --git a/handtris/public/sounds/ready.mp3 b/handtris/public/sound/ready.mp3 similarity index 100% rename from handtris/public/sounds/ready.mp3 rename to handtris/public/sound/ready.mp3 diff --git a/handtris/public/sounds/start.mp3 b/handtris/public/sound/start.mp3 similarity index 100% rename from handtris/public/sounds/start.mp3 rename to handtris/public/sound/start.mp3 diff --git a/handtris/public/sound/tetris.ogg b/handtris/public/sound/tetris.ogg deleted file mode 100644 index 596dac3..0000000 Binary files a/handtris/public/sound/tetris.ogg and /dev/null differ diff --git a/handtris/public/sound/themeA.ogg b/handtris/public/sound/themeA.ogg deleted file mode 100644 index 6554dff..0000000 Binary files a/handtris/public/sound/themeA.ogg and /dev/null differ diff --git a/handtris/public/sounds/Game Health Recharge.wav b/handtris/public/sounds/Game Health Recharge.wav deleted file mode 100644 index 166f3ca..0000000 Binary files a/handtris/public/sounds/Game Health Recharge.wav and /dev/null differ diff --git a/handtris/public/sounds/blockdown.wav b/handtris/public/sounds/blockdown.wav deleted file mode 100644 index 39c6f46..0000000 Binary files a/handtris/public/sounds/blockdown.wav and /dev/null differ diff --git a/handtris/public/sounds/tetris.mp3 b/handtris/public/sounds/tetris.mp3 deleted file mode 100644 index 8a3f4a7..0000000 Binary files a/handtris/public/sounds/tetris.mp3 and /dev/null differ diff --git a/handtris/public/sounds/upsidedown.wav b/handtris/public/sounds/upsidedown.wav deleted file mode 100644 index 41c8c84..0000000 Binary files a/handtris/public/sounds/upsidedown.wav and /dev/null differ diff --git a/handtris/public/sounds/upsidedown2.wav b/handtris/public/sounds/upsidedown2.wav deleted file mode 100644 index ce0285f..0000000 Binary files a/handtris/public/sounds/upsidedown2.wav and /dev/null differ diff --git a/handtris/public/sounds/winner.wav b/handtris/public/sounds/winner.wav deleted file mode 100644 index 5058f93..0000000 Binary files a/handtris/public/sounds/winner.wav and /dev/null differ diff --git a/handtris/src/components/TetrisPlay.tsx b/handtris/src/components/TetrisPlay.tsx index 89a85b9..dab3d58 100644 --- a/handtris/src/components/TetrisPlay.tsx +++ b/handtris/src/components/TetrisPlay.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useCallback, useState } from "react"; import { WebSocketManager } from "@/components/WebSocketManager"; -import { Piece, TetrisGame } from "@/components/TetrisGame"; +import { TetrisGame } from "@/components/TetrisGame"; import { HandGestureManager } from "@/components/HandGestureManager"; import Image from "next/image"; import { playSoundEffect } from "@/hook/howl"; @@ -110,7 +110,6 @@ const Home: React.FC = () => { fetchRoomPlayers(); }, [fetchRoomPlayers]); - useEffect(() => { const roomCode = getRoomCode(); const handleBeforeUnload = () => { @@ -160,7 +159,7 @@ const Home: React.FC = () => { } }; connectWebSocket(); - }, []); + }); useEffect(() => { const preventRefresh = (e: KeyboardEvent | BeforeUnloadEvent) => { @@ -347,7 +346,7 @@ const Home: React.FC = () => { const handleReadyToggle = () => { if (!isOwner) { handleReadyClick(); - playSoundEffect("/sounds/ready.mp3"); + playSoundEffect("/sound/ready.mp3"); } }; @@ -378,7 +377,7 @@ const Home: React.FC = () => { }, `/app/${roomCode}/tetris/start`, ); - playSoundEffect("/sounds/start.mp3"); + playSoundEffect("/sound/start.mp3"); // console.log("Message sent to start the game"); } catch (error) { console.error("Failed to send message to start the game", error); @@ -546,7 +545,7 @@ const Home: React.FC = () => { }, 1000); return () => clearInterval(interval); }, []); -const triggerGestureFeedback = (feedback: string) => { + const triggerGestureFeedback = (feedback: string) => { if (feedback === lastGesture) { if (feedbackTimeoutRef.current) { clearTimeout(feedbackTimeoutRef.current); @@ -576,10 +575,9 @@ const triggerGestureFeedback = (feedback: string) => { triggerGestureFeedback, lastGestureRef, }); - + const onResults = useCallback( (results: HandLandmarkResults & { bothHandsDetected: boolean }) => { - setIsHandDetected(results.bothHandsDetected); if (borderRef.current) { @@ -590,7 +588,7 @@ const triggerGestureFeedback = (feedback: string) => { }, [handleGesture], ); - + useEffect(() => { if (videoRef.current) { navigator.mediaDevices @@ -614,7 +612,11 @@ const triggerGestureFeedback = (feedback: string) => { // NOTE 효과추가 setTimeout(() => setShowDonutWarning(false), 3000); } - drawNextBlock(nextBlock); + drawNextBlock( + tetrisGameRef.current.getNextBlock(), + nextBlockRef.current, + tetrisGameRef.current, + ); } }, [tetrisGameRef.current?.getNextBlock()]); @@ -911,7 +913,6 @@ const triggerGestureFeedback = (feedback: string) => { id="canvas" width="350" height="271" - className="" />