nb player et nb planet dans sagittarius game
This commit is contained in:
parent
2406453507
commit
4268832cb4
|
@ -12,6 +12,7 @@ public class SagittariusGame extends Game {
|
||||||
// Constants
|
// Constants
|
||||||
public static float G = 100;
|
public static float G = 100;
|
||||||
public static int numberPlayers = 3;
|
public static int numberPlayers = 3;
|
||||||
|
public static int numberPlanets = 4;
|
||||||
public static boolean debugMode = false;
|
public static boolean debugMode = false;
|
||||||
public static Music music;
|
public static Music music;
|
||||||
public static boolean disableMusic = true;
|
public static boolean disableMusic = true;
|
||||||
|
|
|
@ -19,7 +19,6 @@ public class GameScreen extends BaseScreen implements InputProcessor {
|
||||||
|
|
||||||
// ---------- GENERATION ----------
|
// ---------- GENERATION ----------
|
||||||
|
|
||||||
public static int numberPlanets = 4;
|
|
||||||
public static int minDistance = 600;
|
public static int minDistance = 600;
|
||||||
public static int maxDistance = 900;
|
public static int maxDistance = 900;
|
||||||
public static int minMass = 500;
|
public static int minMass = 500;
|
||||||
|
@ -85,7 +84,7 @@ public class GameScreen extends BaseScreen implements InputProcessor {
|
||||||
// planets & moons
|
// planets & moons
|
||||||
attractors = new Group();
|
attractors = new Group();
|
||||||
|
|
||||||
for (int i = 0; i < numberPlanets; i++) {
|
for (int i = 0; i < SagittariusGame.numberPlanets; i++) {
|
||||||
// Position of the new planet
|
// Position of the new planet
|
||||||
Vector2 position;
|
Vector2 position;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
@ -125,7 +124,7 @@ public class GameScreen extends BaseScreen implements InputProcessor {
|
||||||
|
|
||||||
// create a moon
|
// create a moon
|
||||||
Moon moon = new 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,
|
minMass / 2 + MathUtils.random(maxMass - minMass) / 2,
|
||||||
minRadius / 2 + MathUtils.random(maxRadius - minRadius) / 2,
|
minRadius / 2 + MathUtils.random(maxRadius - minRadius) / 2,
|
||||||
minDistance / 2,
|
minDistance / 2,
|
||||||
|
|
Loading…
Reference in a new issue