From 4268832cb43587cf7b5072edd585b176476aa8e0 Mon Sep 17 00:00:00 2001 From: Damien Date: Sat, 29 May 2021 12:43:24 +0200 Subject: [PATCH] nb player et nb planet dans sagittarius game --- core/src/sagittarius/SagittariusGame.java | 1 + core/src/sagittarius/view/GameScreen.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/sagittarius/SagittariusGame.java b/core/src/sagittarius/SagittariusGame.java index 4b4d521..3544da0 100644 --- a/core/src/sagittarius/SagittariusGame.java +++ b/core/src/sagittarius/SagittariusGame.java @@ -12,6 +12,7 @@ public class SagittariusGame extends Game { // Constants public static float G = 100; public static int numberPlayers = 3; + public static int numberPlanets = 4; public static boolean debugMode = false; public static Music music; public static boolean disableMusic = true; diff --git a/core/src/sagittarius/view/GameScreen.java b/core/src/sagittarius/view/GameScreen.java index 575e6d7..d465580 100644 --- a/core/src/sagittarius/view/GameScreen.java +++ b/core/src/sagittarius/view/GameScreen.java @@ -19,7 +19,6 @@ public class GameScreen extends BaseScreen implements InputProcessor { // ---------- GENERATION ---------- - public static int numberPlanets = 4; public static int minDistance = 600; public static int maxDistance = 900; public static int minMass = 500; @@ -85,7 +84,7 @@ public class GameScreen extends BaseScreen implements InputProcessor { // planets & moons attractors = new Group(); - for (int i = 0; i < numberPlanets; i++) { + for (int i = 0; i < SagittariusGame.numberPlanets; i++) { // Position of the new planet Vector2 position; if (i == 0) { @@ -125,7 +124,7 @@ public class GameScreen extends BaseScreen implements InputProcessor { // create a moon Moon moon = new Moon( - (Planet) attractors.getChild( MathUtils.random(numberPlanets-1)), + (Planet) attractors.getChild( MathUtils.random(SagittariusGame.numberPlanets-1)), minMass / 2 + MathUtils.random(maxMass - minMass) / 2, minRadius / 2 + MathUtils.random(maxRadius - minRadius) / 2, minDistance / 2,