Skip to content

Commit

Permalink
feat(games): 게임 리셋 시, 방향벡터의 초기값을 특정 범위 내에서 할당
Browse files Browse the repository at this point in the history
  • Loading branch information
nyj001012 committed Mar 13, 2024
1 parent 090352c commit 903dd34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/local-game/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 903dd34

Please sign in to comment.