Actions
Improvement #1412
closed
A"
Improve spawning algorithm to spawn in all board instead of circle
Improvement #1412:
Improve spawning algorithm to spawn in all board instead of circle
Start date:
03/15/2022
Due date:
% Done:
100%
Estimated time:
Description
Test:
function calcNextLayer() {
prevLayer++;
const layerMaxItemsPerLine = (-1 + prevLayer * 4);
const layerMaxItemsPerColumn = (-1 + prevLayer * 2);
/*
f(1) = (1/1)
f(2) = (5/3)
f(3) = (9/5)
f(4) = (13/7)
f(5) = (17/9)
*/
const newPoints = [];
for(let itemX = 0; itemX < layerMaxItemsPerLine; itemX++) {
for(let itemY = 0; itemY < layerMaxItemsPerColumn; itemY++) {
let x = (-0.5 * layerMaxItemsPerLine + itemX + 0.5) * itemsFinalDistance + itemsFinalDistance / 2;
let y = (-0.5 * layerMaxItemsPerColumn + itemY + 0.5) * itemsFinalDistance + itemsFinalDistance / 2;
if(!positions.find(p => p.x === x && p.y === y)) {
newPoints.push({ x, y });
}
/*if(itemY === 0 || itemY === (layerMaxItemsPerColumn - 1) || itemX === 0 || itemX === (layerMaxItemsPerLine - 1)) {
newPoints.push({
x: (-0.5 * layerMaxItemsPerLine + itemX + 0.5) * itemsFinalDistance,
y: (-0.5 * layerMaxItemsPerColumn + itemY + 0.5) * itemsFinalDistance,
});
}*/
}
}
positions = [...positions, ...newPoints];
console.log(newPoints);
return newPoints;
}
A" Updated by Axel "Elanis" over 3 years ago
- Translation missing: en.field_story_points set to 10
A" Updated by Axel "Elanis" over 1 year ago
- Subject changed from Move origin spawn point of elements to Improve spawning algorithm to spawn in all board instead of circle
- Target version changed from Z - Backlog to Phosphorus
A" Updated by Axel "Elanis" over 1 year ago
- Description updated (diff)
A" Updated by Axel "Elanis" over 1 year ago
- Status changed from Pending to Closed
- Target version changed from Phosphorus to Silicium
I ended up keeping the circle but improving the algorithm
A" Updated by Axel "Elanis" over 1 year ago
- % Done changed from 0 to 100
Actions