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

Merged
Prev Previous commit
feat(games): 게임 리셋 시, 방향벡터의 초기값을 특정 범위 내에서 할당
nyj001012 committed Mar 13, 2024
commit 903dd34964a9b4b53db6595c0dc1b70a669dfc4e
4 changes: 2 additions & 2 deletions frontend/src/pages/local-game/page.js
Original file line number Diff line number Diff line change
@@ -370,8 +370,8 @@ export default function LocalGame($container, info = null) {
ball.x = canvas.width / 2;
ball.y = canvas.height / 2;
ball.direction = {
x: Math.random() * 2 - 1,
y: Math.random() * 2 - 1,
x: (Math.random() * 2 - 1) * getRandomCoefficient(0.7, 0.9),
y: (Math.random() * 2 - 1) * getRandomCoefficient(0.7, 0.9),
};
normalizeVector(ball.direction.x, ball.direction.y);
ball.speed = BALL_SPEED;