Skip to content

Commit 1c269a1

Browse files
fix randompos for circles
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1d86e23 commit 1c269a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const getRandomPosition = (entity: ObjectEntity): VectorAbstract => {
9898
pos.x += xOffset;
9999
pos.y += yOffset;
100100
} else { // Circular hitbox
101-
const radius = Math.random() * entity.physicsData.values.size;
101+
const radius = Math.sqrt(Math.random()) * entity.physicsData.values.size;
102102
const angle = Math.random() * PI2;
103103

104104
pos.x += Math.cos(angle) * radius;

0 commit comments

Comments
 (0)