nb player et nb planet dans sagittarius game

This commit is contained in:
Damien 2021-05-29 12:43:24 +02:00
parent 2406453507
commit 4268832cb4
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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,