Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 로컬 게임 벽에서 벽으로 튕길 때 너무 많이 튕기지 않게 함 #497

Conversation

nyj001012
Copy link
Collaborator

@nyj001012 nyj001012 commented Mar 13, 2024


✅ 풀_리퀘스트 체크리스트

  • PR 제목: [feat/fix/refactor...] 작업 내용 한 줄 요약 (브랜치 이름) #이슈번호
  • commit message 가 적절한지 확인해주세요.
  • 적절한 branch 로 요청했는지 확인해주세요.
  • Assignees, Label 을 붙여주세요.
  • 주의 사항과 관련해 꼭 확인해야 할 사람이 있다면 Reviewer 로 등록해주세요.
  • PR이 승인된 경우 해당 브랜치는 삭제해 주세요!

🔄 변경 사항

무엇을 합니다!

로컬 게임 벽에서 벽으로 튕길 때 너무 많이 튕기지 않게 함

  • Math.abs(ball.direction.x <= 0.2)일 경우, 계속해서 벽에서 벽으로 튕긴다 판단
  • 이 경우 벽에 연속으로 부딪힌 횟수인 hitCountOfWall 증가
  • hitCountOfWall % 5 === 4 (= 4번 연속으로 벽에 부딪힐 때마다) 방향벡터 x 성분에 랜덤 계수 곱함
    • Math.abs(ball.direction.x) <= 0.01일 경우, 60 < c < 80c를 곱함
    • 그 외의 경우, 3 < c < 8c를 곱함

로컬 게임에서 리셋 시, x와 y 성분 특정 범위 내에서 초기화되도록 함

  • 특정 범위 내에서 초기화하게 하여 시작부터 수직으로 벽에 튕기거나 바에 수평으로 튕기지 않게 함

📎 변경한 이유

  • 공이 벽에서 벽으로 튕길 때, 상대방에게 갈 때까지 너무 오래 걸림

closes: #494

👨🏻‍💻 테스트 체크리스트

  • e2e
default.mov

📌 변경 및 주의 사항


@nyj001012 nyj001012 added enhancement New feature or request frontend frontend 관련 PR labels Mar 13, 2024
@nyj001012 nyj001012 self-assigned this Mar 13, 2024
@donghyun1998
Copy link
Contributor

위아래 벽끼리의 각도차이가 90도에 가까우면 기울기 바꿔주는 로직 확인했습니다.
고생하셨습니다!

Copy link
Contributor

@bluedog129 bluedog129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

벽에 너무 많이 안 튀기게 로직 바꿔주신것 확인 했습니다 수고하셨습니다!

@nyj001012 nyj001012 merged commit 7d3dbeb into main Mar 13, 2024
6 checks passed
@nyj001012 nyj001012 deleted the 494-feat-로컬-게임-벽에서-벽으로-튕길-때-너무-많이-튕기지-않게-함 branch March 13, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend frontend 관련 PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 로컬 게임 벽에서 벽으로 튕길 때 너무 많이 튕기지 않게 함
3 participants