mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-17 04:01:51 +00:00
Use shape-percentage when generating shapes.
Signed-off-by: Daan Breur <git@daanbreur.systems>
This commit is contained in:
parent
3897b41d45
commit
ca12bcaaa3
@ -203,7 +203,19 @@ export class MapChunk {
|
|||||||
weights[enumSubShape.windmill] = 0;
|
weights[enumSubShape.windmill] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (distanceToOriginInChunks < 10) {
|
if (rng.nextRange(0, 100) <= this.root.map.fullShapePercentage) {
|
||||||
|
// Spawn full shape based on percentage.
|
||||||
|
const subShape = this.internalGenerateRandomSubShape(rng, weights);
|
||||||
|
subShapes = [subShape, subShape, subShape, subShape];
|
||||||
|
} else if (rng.nextRange(0, 100) <= this.root.map.wierdShapePercentage) {
|
||||||
|
// Spawn wierd shape based on percentage.
|
||||||
|
subShapes = [
|
||||||
|
this.internalGenerateRandomSubShape(rng, weights),
|
||||||
|
this.internalGenerateRandomSubShape(rng, weights),
|
||||||
|
this.internalGenerateRandomSubShape(rng, weights),
|
||||||
|
this.internalGenerateRandomSubShape(rng, weights),
|
||||||
|
];
|
||||||
|
} else if (distanceToOriginInChunks < 10) {
|
||||||
// Initial chunk patches always have the same shape
|
// Initial chunk patches always have the same shape
|
||||||
const subShape = this.internalGenerateRandomSubShape(rng, weights);
|
const subShape = this.internalGenerateRandomSubShape(rng, weights);
|
||||||
subShapes = [subShape, subShape, subShape, subShape];
|
subShapes = [subShape, subShape, subShape, subShape];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user