Skip to content

Commit

Permalink
테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
1GYOU1 authored Mar 22, 2024
1 parent 6c1e05f commit 0e81251
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions slot-machine-ts/src/components/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ const Game = () => {
useEffect(() => {
roundChange();
console.log('resultArr',resultArr)

// resultPersent 갱신 후 결과 값 저장
if(roundCount !== 1){
stopSlot();
}
}, [roundCount, resultShowCount])

useEffect(() => {
Expand Down Expand Up @@ -176,7 +181,13 @@ const Game = () => {

const stopArrowBtnEvent = () => {
if(buttonAct){
stopSlot();// 슬롯 멈추기
setButtonAct(false);
console.log('최종이랑 같아야하는 percent', persent)
if(animationId !== undefined){
cancelAnimationFrame(animationId);
}

// stopSlot();// 슬롯 멈추기
// console.log('끝 persent',persent)
if(slotHandleRef.current){
slotHandleRef.current.classList.add('on');// 모바일 핸들 애니메이션 추가
Expand Down Expand Up @@ -214,11 +225,11 @@ const Game = () => {

// 화살표 멈추기
const stopSlot = () => {
setButtonAct(false);
console.log('최종이랑 같아야하는 percent', persent)
if(animationId !== undefined){
cancelAnimationFrame(animationId);
}
// setButtonAct(false);
// console.log('최종이랑 같아야하는 percent', persent)
// if(animationId !== undefined){
// cancelAnimationFrame(animationId);
// }

// 결과 값 배열로 저장
if (resultPersent < 20) {
Expand Down

0 comments on commit 0e81251

Please sign in to comment.