fun: offsets
This commit is contained in:
parent
1b35b03eb1
commit
6b60877711
|
@ -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},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user