diff --git a/engine/src/main/java/org/destinationsol/rubble/systems/RubbleCreationSystem.java b/engine/src/main/java/org/destinationsol/rubble/systems/RubbleCreationSystem.java index af3e8cc3a..acf24bc7e 100644 --- a/engine/src/main/java/org/destinationsol/rubble/systems/RubbleCreationSystem.java +++ b/engine/src/main/java/org/destinationsol/rubble/systems/RubbleCreationSystem.java @@ -51,9 +51,9 @@ */ public class RubbleCreationSystem implements EventReceiver { - public static final float SIZE_TO_RUBBLE_COUNT = 13f; - public static final float MIN_SCALE = .07f; - public static final float MAX_SCALE = .12f; + public static final float SIZE_TO_RUBBLE_COUNT = 8f; + public static final float MIN_SCALE = .1f; + public static final float MAX_SCALE = .3f; private static final float MAX_SPD = 40f; @In @@ -115,7 +115,7 @@ private void buildRubblePieces(Position pos, Velocity vel, Angle angle, Size siz element.graphicsOffset = new Vector2(); float scale = SolRandom.randomFloat(MIN_SCALE, MAX_SCALE); - element.setSize(scale); + element.setSize(scale * size.size); element.relativePosition = new Vector2(); element.tint = Color.WHITE; @@ -136,7 +136,7 @@ private void buildRubblePieces(Position pos, Velocity vel, Angle angle, Size siz //Create size component Size sizeComponent = new Size(); - sizeComponent.size = scale; + sizeComponent.size = scale * size.size; //Create velocity component Velocity velocityComponent = new Velocity(); @@ -145,7 +145,8 @@ private void buildRubblePieces(Position pos, Velocity vel, Angle angle, Size siz velocityComponent.velocity = velocity; EntityRef entityRef = entitySystemManager.getEntityManager().createEntity(graphicsComponent, positionComponent, - velocityComponent, angle, sizeComponent, new RubbleMesh()); + velocityComponent, angle, sizeComponent, new RubbleMesh(), new CreatesRubbleOnDestruction()); + SolMath.free(velocity); entityRef.setComponent(new BodyLinked()); }