fun: offsets

This commit is contained in:
cha0s 2024-10-02 18:01:35 -05:00
parent 1b35b03eb1
commit 6b60877711

View File

@ -9,6 +9,8 @@ const SPREAD = 1;
const creating = []; const creating = [];
const promises = [] const promises = []
const offset = Math.random() * Math.TAU;
for (let i = 0; i < N; ++i) { for (let i = 0; i < N; ++i) {
promises.push(ecs.create({ promises.push(ecs.create({
Collider: { Collider: {
@ -27,7 +29,7 @@ for (let i = 0; i < N; ++i) {
collisionStartScript: '/resources/magic-swords/collision-start.js', collisionStartScript: '/resources/magic-swords/collision-start.js',
}, },
Controlled: {}, Controlled: {},
Direction: {direction: Math.TAU * (i / N)}, Direction: {direction: offset + Math.TAU * (i / N)},
Forces: {}, Forces: {},
Light: {brightness: 0}, Light: {brightness: 0},
Owned: {owner: Player ? Player.id : 0}, Owned: {owner: Player ? Player.id : 0},