From 9492b79f38d577530a6102834f0638e9238f6931 Mon Sep 17 00:00:00 2001 From: Damien Date: Sat, 29 May 2021 12:27:01 +0200 Subject: [PATCH] + 1 moon --- core/src/sagittarius/view/GameScreen.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/sagittarius/view/GameScreen.java b/core/src/sagittarius/view/GameScreen.java index eb5f327..db79f0a 100644 --- a/core/src/sagittarius/view/GameScreen.java +++ b/core/src/sagittarius/view/GameScreen.java @@ -20,9 +20,8 @@ public class GameScreen extends BaseScreen implements InputProcessor { // ---------- GENERATION ---------- public static int numberPlanets = 4; - public static int numberMoons = 2; - public static int minDistance = 400; - public static int maxDistance = 800; + public static int minDistance = 600; + public static int maxDistance = 900; public static int minMass = 500; public static int maxMass = 1000; public static int minRadius = 20; @@ -119,6 +118,15 @@ public class GameScreen extends BaseScreen implements InputProcessor { attractors.addActor(planet); } + Moon moon = new Moon( + (Planet) attractors.getChild( MathUtils.random(numberPlanets-1)), + minMass / 2 + MathUtils.random(maxMass - minMass) / 2, + minRadius / 2 + MathUtils.random(maxRadius - minRadius) / 2, + minDistance / 2, + new Color((int)(Math.random() * 0x1000000)) + ); + attractors.addActor(moon); + mainStage.addActor(attractors); // players