feat: ajout d'un composant worlds qui contient les mondes d'une campagne evite le rechargement des niveaux et garde le dernier niveau selectionné changement des méthodes qui concerne le déblocage et les upgrades des transmuteurs
This commit is contained in:
parent
0087776ff7
commit
e33cf80443
|
@ -14,16 +14,18 @@ import fr.evolving.automata.Level;
|
||||||
public class ButtonLevel extends ImageTextButton {
|
public class ButtonLevel extends ImageTextButton {
|
||||||
public Level level;
|
public Level level;
|
||||||
public boolean Activated;
|
public boolean Activated;
|
||||||
TextureRegion Finalled, Locked;
|
private TextureRegion Finalled, Locked;
|
||||||
Label Thelabel;
|
private Label Thelabel;
|
||||||
float scale;
|
private float scale;
|
||||||
float ratio;
|
private float ratio;
|
||||||
ImageTextButtonStyle style;
|
private ImageTextButtonStyle style;
|
||||||
LabelStyle stylelabel;
|
private LabelStyle stylelabel;
|
||||||
|
private boolean modifyxy;
|
||||||
|
|
||||||
public ButtonLevel(Level level, boolean Activated, float ratio) {
|
public ButtonLevel(Level level, boolean Activated, float ratio, boolean modifyxy) {
|
||||||
super(level.Name, AssetLoader.Skin_level, "world"
|
super(level.Name, AssetLoader.Skin_level, "world"
|
||||||
+ String.valueOf(level.aWorld));
|
+ String.valueOf(level.aWorld));
|
||||||
|
this.modifyxy=modifyxy;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.ratio = ratio;
|
this.ratio = ratio;
|
||||||
this.Activated = Activated;
|
this.Activated = Activated;
|
||||||
|
@ -70,11 +72,12 @@ public class ButtonLevel extends ImageTextButton {
|
||||||
@Override
|
@Override
|
||||||
public void setPosition(float x, float y) {
|
public void setPosition(float x, float y) {
|
||||||
super.setPosition(x, y);
|
super.setPosition(x, y);
|
||||||
|
if (modifyxy) {
|
||||||
level.X = x;
|
level.X = x;
|
||||||
level.Y = y;
|
level.Y = y/ratio;
|
||||||
|
}
|
||||||
Thelabel.setColor(level.X / 1024f, level.X / 1024f, level.X / 1024f, 1f);
|
Thelabel.setColor(level.X / 1024f, level.X / 1024f, level.X / 1024f, 1f);
|
||||||
Thelabel.setPosition(level.X + 54 * scale,
|
Thelabel.setPosition(x + 54 * scale,y + 20 * scale, Align.bottom | Align.center);
|
||||||
level.Y * ratio + 20 * scale, Align.bottom | Align.center);
|
|
||||||
this.setColor(1f, 0.47f + (float) level.X / 1024f * 0.529f,
|
this.setColor(1f, 0.47f + (float) level.X / 1024f * 0.529f,
|
||||||
0.607f + (float) level.X / 768f * 0.392f, 1f);
|
0.607f + (float) level.X / 768f * 0.392f, 1f);
|
||||||
}
|
}
|
||||||
|
@ -83,15 +86,15 @@ public class ButtonLevel extends ImageTextButton {
|
||||||
public void draw(Batch batch, float parentAlpha) {
|
public void draw(Batch batch, float parentAlpha) {
|
||||||
super.draw(batch, parentAlpha);
|
super.draw(batch, parentAlpha);
|
||||||
if (level.Special) {
|
if (level.Special) {
|
||||||
batch.draw(Finalled, level.X, level.Y * ratio,
|
batch.draw(Finalled, getX(), getY() ,
|
||||||
Finalled.getRegionWidth() * scale,
|
Finalled.getRegionWidth() * scale,
|
||||||
Finalled.getRegionHeight() * scale);
|
Finalled.getRegionHeight() * scale);
|
||||||
}
|
}
|
||||||
if (!Activated) {
|
if (!Activated) {
|
||||||
batch.draw(
|
batch.draw(
|
||||||
Locked,
|
Locked,
|
||||||
level.X + this.getWidth() - Locked.getRegionWidth(),
|
getX() + this.getWidth() - Locked.getRegionWidth(),
|
||||||
level.Y * ratio + this.getHeight()
|
getY() + this.getHeight()
|
||||||
- Locked.getRegionHeight(), Locked.getRegionWidth()
|
- Locked.getRegionHeight(), Locked.getRegionWidth()
|
||||||
* scale, Locked.getRegionHeight() * scale);
|
* scale, Locked.getRegionHeight() * scale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class Worldlist extends List {
|
||||||
public void Refresh() {
|
public void Refresh() {
|
||||||
Array<String> worlds = null;
|
Array<String> worlds = null;
|
||||||
if (AssetLoader.Datahandler.game() != null)
|
if (AssetLoader.Datahandler.game() != null)
|
||||||
worlds = AssetLoader.Datahandler.game().getworlds();
|
worlds = AssetLoader.Datahandler.game().getCampaigns();
|
||||||
if (worlds == null)
|
if (worlds == null)
|
||||||
worlds = new Array<String>();
|
worlds = new Array<String>();
|
||||||
this.setItems(worlds);
|
this.setItems(worlds);
|
||||||
|
|
|
@ -225,7 +225,6 @@ public class AssetLoader {
|
||||||
Datahandler.RegisterBackend(LocalBase.class);
|
Datahandler.RegisterBackend(LocalBase.class);
|
||||||
Datahandler.RegisterBackend(SqlBase.class);
|
Datahandler.RegisterBackend(SqlBase.class);
|
||||||
Databasemanagerfrompref();
|
Databasemanagerfrompref();
|
||||||
Gdx.app.log("init", "Ok");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Databasemanagerfrompref() {
|
public static void Databasemanagerfrompref() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Insufler100 extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -119,19 +120,6 @@ public class Insufler100 extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -219,14 +207,6 @@ public class Insufler100 extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +275,7 @@ public class Insufler100 extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Insufler33 extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -49,7 +50,8 @@ public class Insufler33 extends Transmuter {
|
||||||
this.Technology = 3;
|
this.Technology = 3;
|
||||||
this.Research = 0;
|
this.Research = 0;
|
||||||
this.Upgrade = null;
|
this.Upgrade = null;
|
||||||
this.Unlock = new Insufler50(null);
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Insufler50(null));
|
||||||
this.showed = false;
|
this.showed = false;
|
||||||
this.CanUpgradeTemp = true;
|
this.CanUpgradeTemp = true;
|
||||||
this.CanUpgradeCycle = false;
|
this.CanUpgradeCycle = false;
|
||||||
|
@ -119,19 +121,6 @@ public class Insufler33 extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -219,14 +208,6 @@ public class Insufler33 extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +276,7 @@ public class Insufler33 extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Insufler50 extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -49,7 +50,8 @@ public class Insufler50 extends Transmuter {
|
||||||
this.Technology = 3;
|
this.Technology = 3;
|
||||||
this.Research = 120;
|
this.Research = 120;
|
||||||
this.Upgrade = null;
|
this.Upgrade = null;
|
||||||
this.Unlock = new Insufler100(null);
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new Insufler100(null));
|
||||||
this.showed = false;
|
this.showed = false;
|
||||||
this.CanUpgradeTemp = true;
|
this.CanUpgradeTemp = true;
|
||||||
this.CanUpgradeCycle = false;
|
this.CanUpgradeCycle = false;
|
||||||
|
@ -119,19 +121,6 @@ public class Insufler50 extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -219,14 +208,6 @@ public class Insufler50 extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +276,7 @@ public class Insufler50 extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Inverter_I extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Inverter_I extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Inverter_I extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Inverter_I extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Inverter_II extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Inverter_II extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Inverter_II extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Inverter_II extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class Level implements Serializable {
|
||||||
public int Maxtemp;
|
public int Maxtemp;
|
||||||
public int Maxrayon;
|
public int Maxrayon;
|
||||||
public int Maxnrj;
|
public int Maxnrj;
|
||||||
|
public int Research;
|
||||||
public boolean Special;
|
public boolean Special;
|
||||||
public String Tuto;
|
public String Tuto;
|
||||||
public int[][] Link;
|
public int[][] Link;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Negativer extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Negativer extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Negativer extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Negativer extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Negativer_I extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -105,19 +106,6 @@ public class Negativer_I extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -205,14 +193,6 @@ public class Negativer_I extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -281,7 +261,7 @@ public class Negativer_I extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Negativer_II extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -105,19 +106,6 @@ public class Negativer_II extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -205,14 +193,6 @@ public class Negativer_II extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -281,7 +261,7 @@ public class Negativer_II extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Negativer_III extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Negativer_III extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Negativer_III extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Negativer_III extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Neutraliser_I extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Neutraliser_I extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Neutraliser_I extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Neutraliser_I extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Neutraliser_II extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Neutraliser_II extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Neutraliser_II extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Neutraliser_II extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Oneway extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -49,7 +50,8 @@ public class Oneway extends Transmuter {
|
||||||
this.Technology = 5;
|
this.Technology = 5;
|
||||||
this.Research = 0;
|
this.Research = 0;
|
||||||
this.Upgrade = null;
|
this.Upgrade = null;
|
||||||
this.Unlock = new distributor(level);
|
this.Unlock = new Array<Transmuter>();
|
||||||
|
this.Unlock.add(new distributor(level));
|
||||||
this.showed = false;
|
this.showed = false;
|
||||||
this.CanUpgradeTemp = true;
|
this.CanUpgradeTemp = true;
|
||||||
this.CanUpgradeCycle = false;
|
this.CanUpgradeCycle = false;
|
||||||
|
@ -103,19 +105,6 @@ public class Oneway extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +192,6 @@ public class Oneway extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +260,7 @@ public class Oneway extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Positiver extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -103,19 +104,6 @@ public class Positiver extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -203,14 +191,6 @@ public class Positiver extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -279,7 +259,7 @@ public class Positiver extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Positiver_I extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -105,19 +106,6 @@ public class Positiver_I extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -205,14 +193,6 @@ public class Positiver_I extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -281,7 +261,7 @@ public class Positiver_I extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class Positiver_II extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -105,19 +106,6 @@ public class Positiver_II extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Upgrade.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -205,14 +193,6 @@ public class Positiver_II extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -281,7 +261,7 @@ public class Positiver_II extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ public class Positiver_III extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -102,19 +103,6 @@ public class Positiver_III extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
ActivationLevel = this.getMaxActivationLevel();
|
ActivationLevel = this.getMaxActivationLevel();
|
||||||
|
@ -202,14 +190,6 @@ public class Positiver_III extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +258,7 @@ public class Positiver_III extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Entries;
|
import com.badlogic.gdx.utils.ObjectMap.Entries;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Entry;
|
import com.badlogic.gdx.utils.ObjectMap.Entry;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
|
@ -39,8 +40,8 @@ public abstract class Transmuter implements Cloneable, Serializable {
|
||||||
A00, A90, A180, A270
|
A00, A90, A180, A270
|
||||||
};
|
};
|
||||||
|
|
||||||
protected Level level;
|
protected transient Level level;
|
||||||
protected Angular Rotation;
|
protected transient Angular Rotation;
|
||||||
|
|
||||||
public Transmuter(Level level) {
|
public Transmuter(Level level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
|
@ -69,12 +70,6 @@ public abstract class Transmuter implements Cloneable, Serializable {
|
||||||
public void Run() {
|
public void Run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,11 +129,41 @@ public abstract class Transmuter implements Cloneable, Serializable {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
public void Unlock(Transmuter transmuter) {
|
||||||
return false;
|
Array<Transmuter> transmuters=this.getUnlock();
|
||||||
|
if (transmuters != null) {
|
||||||
|
for(Transmuter transmuter2:transmuters) {
|
||||||
|
if (transmuter2==transmuter)
|
||||||
|
transmuter.SetShowed(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
public void Unlock() {
|
||||||
|
this.SetShowed(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Upgrade() {
|
||||||
|
Transmuter transmuter=this.getUpgrade();
|
||||||
|
if (transmuter == null)
|
||||||
|
return;
|
||||||
|
transmuter.SetShowed(true);
|
||||||
|
this.SetShowed(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUpgradable(int value) {
|
||||||
|
Transmuter transmuter=this.getUpgrade();
|
||||||
|
return transmuter!= null && !transmuter.isShowed() && transmuter.getResearch()>=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUnlockable(int value) {
|
||||||
|
Array<Transmuter> transmuters=this.getUnlock();
|
||||||
|
if (transmuters != null) {
|
||||||
|
for(Transmuter transmuter:transmuters) {
|
||||||
|
if (!transmuter.isShowed() && transmuter.getResearch()>=value)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +198,7 @@ public abstract class Transmuter implements Cloneable, Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,11 +267,11 @@ public abstract class Transmuter implements Cloneable, Serializable {
|
||||||
+ " Visible:"
|
+ " Visible:"
|
||||||
+ this.isShowed()
|
+ this.isShowed()
|
||||||
+ "\nUpgradable:"
|
+ "\nUpgradable:"
|
||||||
+ ((this.isUpgradable()) ? this.getUpgrade().getName() : this
|
+ ((this.isUpgradable(0)) ? this.getUpgrade().getName() : this
|
||||||
.isUpgradable())
|
.isUpgradable(0))
|
||||||
+ " Unlockable:"
|
+ " Unlockable:"
|
||||||
+ ((this.isUnlockable()) ? this.getUnlock().getName() : this
|
+ ((this.isUnlockable(0)) ? this.getUnlock().size : this
|
||||||
.isUnlockable()) + "\nUpgrade Cycle:"
|
.isUnlockable(0)) + "\nUpgrade Cycle:"
|
||||||
+ this.getUpgradeCycle() + " upgrade:"
|
+ this.getUpgradeCycle() + " upgrade:"
|
||||||
+ this.isUpgradableCycle() + "\nUpgrade Temperature:"
|
+ this.isUpgradableCycle() + "\nUpgrade Temperature:"
|
||||||
+ this.getUpgradeTemp() + " upgrade:" + this.isUpgradableTemp()
|
+ this.getUpgradeTemp() + " upgrade:" + this.isUpgradableTemp()
|
||||||
|
|
|
@ -0,0 +1,192 @@
|
||||||
|
package fr.evolving.automata;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.assets.InitWorlds;
|
||||||
|
import fr.evolving.assets.Preference;
|
||||||
|
|
||||||
|
public class Worlds extends Actor {
|
||||||
|
private ChangeEvent event;
|
||||||
|
private Array<Level> levels;
|
||||||
|
private String name;
|
||||||
|
private int usedworld;
|
||||||
|
private Level usedlevel;
|
||||||
|
private Array<Transmuter> Transmuters;
|
||||||
|
private State state;
|
||||||
|
|
||||||
|
public enum State {pause,simulating,notloaded,databasefailed};
|
||||||
|
|
||||||
|
public Worlds(String campaign) {
|
||||||
|
name=campaign;
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
levels=null;
|
||||||
|
usedworld=-1;
|
||||||
|
usedlevel=null;
|
||||||
|
if (!AssetLoader.Datahandler.verifyall()) {
|
||||||
|
Gdx.app.debug(getClass().getSimpleName(),"Pilotes de bases de donnée défaillant.");
|
||||||
|
state=State.databasefailed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state=State.notloaded;
|
||||||
|
this.load(name);
|
||||||
|
if (state==State.notloaded)
|
||||||
|
this.init(name);
|
||||||
|
onchanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveGrid() {
|
||||||
|
if (usedlevel!=null)
|
||||||
|
AssetLoader.Datahandler.user().setGrid(0, usedlevel.id, usedlevel.Grid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveLastGrid() {
|
||||||
|
if (usedlevel!=null)
|
||||||
|
AssetLoader.Datahandler.user().setGrid(0, usedlevel.id, "LAST", usedlevel.Grid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Forcereload() {
|
||||||
|
onchanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onchanged() {
|
||||||
|
ChangeEvent event=new ChangeEvent();
|
||||||
|
event.setTarget(this);
|
||||||
|
event.setListenerActor(this);
|
||||||
|
event.setStage(this.getStage());
|
||||||
|
if (event.getStage()!=null)
|
||||||
|
this.fire(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Array<Level> getLevels() {
|
||||||
|
Array<Level> tempworld=new Array<Level>();
|
||||||
|
if (state!=State.notloaded && this.levels!=null)
|
||||||
|
{
|
||||||
|
for(Level level:levels)
|
||||||
|
if (level!=null && level.aWorld==usedworld)
|
||||||
|
tempworld.add(level);
|
||||||
|
return tempworld;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public State getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int alevel) {
|
||||||
|
if (state!=State.notloaded)
|
||||||
|
if (usedworld>=0) {
|
||||||
|
Array<Level> tempworld=getLevels();
|
||||||
|
for(Level level:tempworld)
|
||||||
|
if (level.aLevel==alevel)
|
||||||
|
{
|
||||||
|
usedlevel=level;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Level getInformations() {
|
||||||
|
return usedlevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return usedlevel.aLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delLevel() {
|
||||||
|
usedlevel=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorld(int world) {
|
||||||
|
if (state!=State.notloaded)
|
||||||
|
if (world<getMaxWorlds()) {
|
||||||
|
usedworld=world;
|
||||||
|
onchanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void NextWorld() {
|
||||||
|
if (state!=State.notloaded)
|
||||||
|
if (usedworld<getMaxWorlds()-1) {
|
||||||
|
usedworld++;
|
||||||
|
onchanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PreviousWorld() {
|
||||||
|
if (state!=State.notloaded)
|
||||||
|
if (usedworld>0) {
|
||||||
|
usedworld--;
|
||||||
|
onchanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWorld() {
|
||||||
|
if (state!=State.notloaded)
|
||||||
|
return usedworld;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(String campaign) {
|
||||||
|
Gdx.app.log("*****", "Définition de la compagne "+campaign);
|
||||||
|
Preference.prefs.putString("world", campaign);
|
||||||
|
Preference.prefs.flush();
|
||||||
|
load(campaign);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void load(String campaign) {
|
||||||
|
Gdx.app.log("*****", "Chargement de la compagne "+campaign);
|
||||||
|
levels=AssetLoader.Datahandler.game().getCampaign(campaign);
|
||||||
|
name=campaign;
|
||||||
|
if (levels==null)
|
||||||
|
|
||||||
|
{
|
||||||
|
state=State.notloaded;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state=State.pause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(String campaign) {
|
||||||
|
Gdx.app.log("*****", "initialisation de la compagne "+campaign);
|
||||||
|
try {
|
||||||
|
levels=InitWorlds.go();
|
||||||
|
Preference.prefs.putString("world",campaign);
|
||||||
|
Preference.prefs.flush();
|
||||||
|
name=campaign;
|
||||||
|
AssetLoader.Datahandler.game().setCampaign(levels,name);
|
||||||
|
state=State.pause;
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
state=State.notloaded;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(String campaign) {
|
||||||
|
Gdx.app.log("*****", "enregistrement de la compagne "+campaign);
|
||||||
|
AssetLoader.Datahandler.game().setCampaign(levels,campaign);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxWorlds() {
|
||||||
|
int max = 0;
|
||||||
|
for (Level level : levels)
|
||||||
|
if (level != null && level.aWorld > max)
|
||||||
|
max = level.aWorld;
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package fr.evolving.automata;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Values;
|
import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ public class distributor extends Transmuter {
|
||||||
private static int Technology;
|
private static int Technology;
|
||||||
private static int Research;
|
private static int Research;
|
||||||
private static Transmuter Upgrade;
|
private static Transmuter Upgrade;
|
||||||
private static Transmuter Unlock;
|
private static Array<Transmuter> Unlock;
|
||||||
private static boolean showed;
|
private static boolean showed;
|
||||||
private static boolean CanUpgradeTemp;
|
private static boolean CanUpgradeTemp;
|
||||||
private static boolean CanUpgradeCycle;
|
private static boolean CanUpgradeCycle;
|
||||||
|
@ -111,18 +112,6 @@ public class distributor extends Transmuter {
|
||||||
this.level.Nrj += UsedNrj * UpgradedNrj;
|
this.level.Nrj += UsedNrj * UpgradedNrj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unlock() {
|
|
||||||
if (this.Unlock == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Upgrade() {
|
|
||||||
if (this.Upgrade == null)
|
|
||||||
return;
|
|
||||||
this.Unlock.SetShowed(true);
|
|
||||||
this.SetShowed(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Activate() {
|
public void Activate() {
|
||||||
if (this.Activable)
|
if (this.Activable)
|
||||||
|
@ -211,14 +200,6 @@ public class distributor extends Transmuter {
|
||||||
return Research;
|
return Research;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUpgradable() {
|
|
||||||
return this.Upgrade != null && this.Upgrade.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnlockable() {
|
|
||||||
return this.Unlock != null && this.Unlock.isShowed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowed() {
|
public boolean isShowed() {
|
||||||
return this.showed;
|
return this.showed;
|
||||||
}
|
}
|
||||||
|
@ -287,7 +268,7 @@ public class distributor extends Transmuter {
|
||||||
return this.Upgrade;
|
return this.Upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transmuter getUnlock() {
|
public Array<Transmuter> getUnlock() {
|
||||||
return this.Unlock;
|
return this.Unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,28 +23,28 @@ public abstract class Base {
|
||||||
|
|
||||||
// Gestion type Gamebase
|
// Gestion type Gamebase
|
||||||
|
|
||||||
public Array<String> getworlds() {
|
public Array<String> getCampaigns() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<Level> getworld(String description) {
|
public Array<Level> getCampaign(String description) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setworld(Array<Level> world, String description) {
|
public boolean setCampaign(Array<Level> campaign, String description) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean deleteworld(String description) {
|
public boolean deleteCampaign(String description) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gestion type Userbase
|
// Gestion type Userbase
|
||||||
public boolean getlevellock(int user, int level) {
|
public boolean getLevellock(int user, int level) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setlevelunlock(int user, int level) {
|
public boolean setLevelunlock(int user, int level) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public abstract class Base {
|
||||||
public void Close() {
|
public void Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getprefix() {
|
public String getPrefix() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class DatabaseManager {
|
||||||
Base back;
|
Base back;
|
||||||
try {
|
try {
|
||||||
back = (Base) classe.newInstance();
|
back = (Base) classe.newInstance();
|
||||||
if (back.getprefix().equals(Type)) {
|
if (back.getPrefix().equals(Type)) {
|
||||||
back = (Base) classe.getDeclaredConstructor(cArg)
|
back = (Base) classe.getDeclaredConstructor(cArg)
|
||||||
.newInstance(model, Url);
|
.newInstance(model, Url);
|
||||||
return back;
|
return back;
|
||||||
|
@ -92,7 +92,7 @@ public class DatabaseManager {
|
||||||
Base back;
|
Base back;
|
||||||
try {
|
try {
|
||||||
back = (Base) classe.newInstance();
|
back = (Base) classe.newInstance();
|
||||||
if (back.getprefix().equals(Type))
|
if (back.getPrefix().equals(Type))
|
||||||
return true;
|
return true;
|
||||||
} catch (InstantiationException | IllegalAccessException
|
} catch (InstantiationException | IllegalAccessException
|
||||||
| IllegalArgumentException | SecurityException e) {
|
| IllegalArgumentException | SecurityException e) {
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class LocalBase extends Base {
|
||||||
|
|
||||||
// Gestion model type gamedata
|
// Gestion model type gamedata
|
||||||
|
|
||||||
public Array<String> getworlds() {
|
public Array<String> getCampaigns() {
|
||||||
DatabaseCursor cursor = null;
|
DatabaseCursor cursor = null;
|
||||||
try {
|
try {
|
||||||
cursor = dbHandler.rawQuery("select desc,date from worlds;");
|
cursor = dbHandler.rawQuery("select desc,date from worlds;");
|
||||||
|
@ -114,7 +114,7 @@ public class LocalBase extends Base {
|
||||||
return returnvalue;
|
return returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<Level> getworld(String description) {
|
public Array<Level> getCampaign(String description) {
|
||||||
DatabaseCursor cursor = null;
|
DatabaseCursor cursor = null;
|
||||||
try {
|
try {
|
||||||
cursor = dbHandler
|
cursor = dbHandler
|
||||||
|
@ -138,7 +138,7 @@ public class LocalBase extends Base {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean deleteworld(String description) {
|
public boolean deleteCampaign(String description) {
|
||||||
try {
|
try {
|
||||||
dbHandler.rawQuery("delete from worlds where desc='" + description
|
dbHandler.rawQuery("delete from worlds where desc='" + description
|
||||||
+ "';");
|
+ "';");
|
||||||
|
@ -148,7 +148,7 @@ public class LocalBase extends Base {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setworld(Array<Level> world, String description) {
|
public boolean setCampaign(Array<Level> world, String description) {
|
||||||
String encoded = "";
|
String encoded = "";
|
||||||
try {
|
try {
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
@ -169,7 +169,7 @@ public class LocalBase extends Base {
|
||||||
|
|
||||||
// Gestion de données type userdata
|
// Gestion de données type userdata
|
||||||
|
|
||||||
public boolean getlevellock(int user, int level) {
|
public boolean getLevellock(int user, int level) {
|
||||||
DatabaseCursor cursor = null;
|
DatabaseCursor cursor = null;
|
||||||
try {
|
try {
|
||||||
cursor = dbHandler.rawQuery("select user from locks where user="
|
cursor = dbHandler.rawQuery("select user from locks where user="
|
||||||
|
@ -183,7 +183,7 @@ public class LocalBase extends Base {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setlevelunlock(int user, int level) {
|
public boolean setLevelunlock(int user, int level) {
|
||||||
try {
|
try {
|
||||||
dbHandler.rawQuery("insert into locks (user,level) values (" + user
|
dbHandler.rawQuery("insert into locks (user,level) values (" + user
|
||||||
+ "," + level + ");");
|
+ "," + level + ");");
|
||||||
|
@ -317,29 +317,19 @@ public class LocalBase extends Base {
|
||||||
public boolean setGrid(int user, int level, Grid data) {
|
public boolean setGrid(int user, int level, Grid data) {
|
||||||
String encoded = "";
|
String encoded = "";
|
||||||
try {
|
try {
|
||||||
Gdx.app.log("Base", "Infos:"+user+","+level);
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
Gdx.app.log("Base", "CK1");
|
|
||||||
ObjectOutputStream oos = new ObjectOutputStream(bos);
|
ObjectOutputStream oos = new ObjectOutputStream(bos);
|
||||||
Gdx.app.log("Base", "CK2");
|
|
||||||
oos.writeObject(data);
|
oos.writeObject(data);
|
||||||
Gdx.app.log("Base", "CK3");
|
|
||||||
oos.flush();
|
oos.flush();
|
||||||
Gdx.app.log("Base", "CK4");
|
|
||||||
oos.close();
|
oos.close();
|
||||||
bos.close();
|
bos.close();
|
||||||
byte[] bytes = bos.toByteArray();
|
byte[] bytes = bos.toByteArray();
|
||||||
Gdx.app.log("Base", "size"+bytes.length);
|
|
||||||
encoded = Base64Coder.encodeLines(bytes);
|
encoded = Base64Coder.encodeLines(bytes);
|
||||||
Gdx.app.log("Base", "size2"+encoded.length());
|
|
||||||
dbHandler.rawQuery("insert into grids (user,level,object) values ("
|
dbHandler.rawQuery("insert into grids (user,level,object) values ("
|
||||||
+ user + "," + level + ",'" + encoded + "');");
|
+ user + "," + level + ",'" + encoded + "');");
|
||||||
Gdx.app.log("Base", "CK5");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Gdx.app.log("Base", "cancel");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Gdx.app.log("Base", "Ok");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,7 +409,7 @@ public class LocalBase extends Base {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getprefix() {
|
public String getPrefix() {
|
||||||
return "local";
|
return "local";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class SqlBase extends Base {
|
||||||
public SqlBase() {
|
public SqlBase() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getprefix() {
|
public String getPrefix() {
|
||||||
return "mysql";
|
return "mysql";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,6 @@ public class LevelRenderer {
|
||||||
BitmapFont font;
|
BitmapFont font;
|
||||||
String reward,goal,ressource,handicap;
|
String reward,goal,ressource,handicap;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LevelRenderer(LevelScreen LevelScreen) {
|
public LevelRenderer(LevelScreen LevelScreen) {
|
||||||
this.reward=AssetLoader.language.get("[reward-levelscreen]");
|
this.reward=AssetLoader.language.get("[reward-levelscreen]");
|
||||||
this.goal=AssetLoader.language.get("[goal-levelscreen]");
|
this.goal=AssetLoader.language.get("[goal-levelscreen]");
|
||||||
|
@ -71,8 +67,8 @@ public class LevelRenderer {
|
||||||
public void render(float delta, float runTime) {
|
public void render(float delta, float runTime) {
|
||||||
Gdx.gl.glClearColor(0, 0, 0, 1);
|
Gdx.gl.glClearColor(0, 0, 0, 1);
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
|
||||||
if (LevelScreen.world >= 0)
|
if (LevelScreen.worlds.getWorld() >= 0)
|
||||||
font.setColor(AssetLoader.Levelcolors[LevelScreen.world]);
|
font.setColor(AssetLoader.Levelcolors[LevelScreen.worlds.getWorld()]);
|
||||||
batcher.begin();
|
batcher.begin();
|
||||||
batcher.setProjectionMatrix(AssetLoader.Camera.combined);
|
batcher.setProjectionMatrix(AssetLoader.Camera.combined);
|
||||||
batcher.setColor(0.25f, 0.25f, 0.25f, 1f);
|
batcher.setColor(0.25f, 0.25f, 0.25f, 1f);
|
||||||
|
|
|
@ -67,6 +67,7 @@ import fr.evolving.automata.Neutraliser_II;
|
||||||
import fr.evolving.automata.Transmuter;
|
import fr.evolving.automata.Transmuter;
|
||||||
import fr.evolving.automata.Transmuter.Angular;
|
import fr.evolving.automata.Transmuter.Angular;
|
||||||
import fr.evolving.automata.Transmuter.CaseType;
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
|
import fr.evolving.automata.Worlds;
|
||||||
import fr.evolving.renderers.GameRenderer;
|
import fr.evolving.renderers.GameRenderer;
|
||||||
|
|
||||||
public class GameScreen implements Screen {
|
public class GameScreen implements Screen {
|
||||||
|
@ -105,6 +106,7 @@ public class GameScreen implements Screen {
|
||||||
private Label fpsLabel, info_nom;
|
private Label fpsLabel, info_nom;
|
||||||
private TextArea info_desc, tooltip;
|
private TextArea info_desc, tooltip;
|
||||||
public boolean unroll;
|
public boolean unroll;
|
||||||
|
private Worlds worlds;
|
||||||
|
|
||||||
public enum calling {
|
public enum calling {
|
||||||
mouseover, mouseclick, mousedrag, longpress, tap, taptap, zoom, fling, pan, pinch
|
mouseover, mouseclick, mousedrag, longpress, tap, taptap, zoom, fling, pan, pinch
|
||||||
|
@ -198,13 +200,12 @@ public class GameScreen implements Screen {
|
||||||
GestureDetector gesturedetector;
|
GestureDetector gesturedetector;
|
||||||
|
|
||||||
// This is the constructor, not the class declaration
|
// This is the constructor, not the class declaration
|
||||||
public GameScreen(Level alevel) {
|
public GameScreen(Worlds aworlds) {
|
||||||
Gdx.app.log("game", "Ok");
|
Gdx.app.log("game", "Ok");
|
||||||
this.level = alevel;
|
this.worlds = aworlds;
|
||||||
Gdx.app.debug(getClass().getSimpleName(),
|
this.level=worlds.getInformations();
|
||||||
"Récupération des derniers niveaux.");
|
Gdx.app.debug(getClass().getSimpleName(),"Récupération des derniers niveaux.");
|
||||||
this.level.Grid = AssetLoader.Datahandler.user().getGrid(0,
|
this.level.Grid = AssetLoader.Datahandler.user().getGrid(0, this.level.id, "LAST");
|
||||||
this.level.id, "LAST");
|
|
||||||
if (this.level.Grid == null) {
|
if (this.level.Grid == null) {
|
||||||
Gdx.app.debug(getClass().getSimpleName(), "Copie monde original.");
|
Gdx.app.debug(getClass().getSimpleName(), "Copie monde original.");
|
||||||
this.level.Grid = this.level.Grid_orig;
|
this.level.Grid = this.level.Grid_orig;
|
||||||
|
@ -223,7 +224,6 @@ public class GameScreen implements Screen {
|
||||||
Gdx.app.debug("Barre", "Element changé");
|
Gdx.app.debug("Barre", "Element changé");
|
||||||
hideInfo();
|
hideInfo();
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
//map.fillempty(60);
|
|
||||||
menu.unSelect();
|
menu.unSelect();
|
||||||
map.setSelected(getselected());
|
map.setSelected(getselected());
|
||||||
}
|
}
|
||||||
|
@ -244,8 +244,7 @@ public class GameScreen implements Screen {
|
||||||
Gdx.app.debug(getClass().getSimpleName(), "Création des barres");
|
Gdx.app.debug(getClass().getSimpleName(), "Création des barres");
|
||||||
tooltip = new TextArea("tooltip:x\r\n tooltip:y",AssetLoader.Skin_level, "info_tooltip");
|
tooltip = new TextArea("tooltip:x\r\n tooltip:y",AssetLoader.Skin_level, "info_tooltip");
|
||||||
tooltip.setBounds(541, 27, 100, 50);
|
tooltip.setBounds(541, 27, 100, 50);
|
||||||
Gdx.app.debug(getClass().getSimpleName(),
|
Gdx.app.debug(getClass().getSimpleName(),"Création de la barre de gestion du haut");
|
||||||
"Création de la barre de gestion du haut");
|
|
||||||
cycle = new ImageTextButton(String.valueOf(level.Cycle),AssetLoader.Skin_level, "cycle2");
|
cycle = new ImageTextButton(String.valueOf(level.Cycle),AssetLoader.Skin_level, "cycle2");
|
||||||
cycle.setVisible(level.aWorld>=1);
|
cycle.setVisible(level.aWorld>=1);
|
||||||
cycle.setPosition(10, AssetLoader.height - 74);
|
cycle.setPosition(10, AssetLoader.height - 74);
|
||||||
|
@ -271,7 +270,7 @@ public class GameScreen implements Screen {
|
||||||
objectives.setVictory(level.Victory);
|
objectives.setVictory(level.Victory);
|
||||||
objectives.setPosition(890, AssetLoader.height - 95);
|
objectives.setPosition(890, AssetLoader.height - 95);
|
||||||
objectives.setVisible(level.Cout>0);
|
objectives.setVisible(level.Cout>0);
|
||||||
buttonlevel = new ButtonLevel(level, true, 1.0f);
|
buttonlevel = new ButtonLevel(level, true, 1.0f, false);
|
||||||
buttonlevel.setPosition(1760, AssetLoader.height - 125);
|
buttonlevel.setPosition(1760, AssetLoader.height - 125);
|
||||||
buttonlevel.addListener(new ClickListener() {
|
buttonlevel.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -328,7 +327,7 @@ public class GameScreen implements Screen {
|
||||||
info_up.addListener(new ClickListener() {
|
info_up.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
if (menu.getTransmuter()!=null && menu.getTransmuter().isUpgradable())
|
if (menu.getTransmuter()!=null && menu.getTransmuter().isUpgradable(0))
|
||||||
menu.getTransmuter().Upgrade();
|
menu.getTransmuter().Upgrade();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -352,7 +351,6 @@ public class GameScreen implements Screen {
|
||||||
menu.NextPage();
|
menu.NextPage();
|
||||||
Gdx.app.debug("menu", "Page suivante:"+menu.getPage());
|
Gdx.app.debug("menu", "Page suivante:"+menu.getPage());
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
//map.fillempty(53);
|
|
||||||
hideInfo();
|
hideInfo();
|
||||||
nextpage.setDisabled(menu.isNextEmpty());
|
nextpage.setDisabled(menu.isNextEmpty());
|
||||||
previouspage.setDisabled(menu.isPreviousEmpty());
|
previouspage.setDisabled(menu.isPreviousEmpty());
|
||||||
|
@ -368,7 +366,6 @@ public class GameScreen implements Screen {
|
||||||
menu.PreviousPage();
|
menu.PreviousPage();
|
||||||
Gdx.app.debug("menu", "Page précédente:"+menu.getPage());
|
Gdx.app.debug("menu", "Page précédente:"+menu.getPage());
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
//map.fillempty(53);
|
|
||||||
hideInfo();
|
hideInfo();
|
||||||
nextpage.setDisabled(menu.isNextEmpty());
|
nextpage.setDisabled(menu.isNextEmpty());
|
||||||
previouspage.setDisabled(menu.isPreviousEmpty());
|
previouspage.setDisabled(menu.isPreviousEmpty());
|
||||||
|
@ -383,7 +380,6 @@ public class GameScreen implements Screen {
|
||||||
Gdx.app.debug("Menu", "Element changé");
|
Gdx.app.debug("Menu", "Element changé");
|
||||||
hideInfo();
|
hideInfo();
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
//map.fillempty(60);
|
|
||||||
if (menu.getTransmuter() != null)
|
if (menu.getTransmuter() != null)
|
||||||
showInfo(menu.getTransmuter());
|
showInfo(menu.getTransmuter());
|
||||||
else
|
else
|
||||||
|
@ -700,7 +696,6 @@ public class GameScreen implements Screen {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preparebarre(String caller, int count) {
|
public void preparebarre(String caller, int count) {
|
||||||
//map.fillempty(53);
|
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
menu.EraseSurtile();
|
menu.EraseSurtile();
|
||||||
hideInfo();
|
hideInfo();
|
||||||
|
@ -725,21 +720,17 @@ public class GameScreen implements Screen {
|
||||||
if (winSave.isVisible())
|
if (winSave.isVisible())
|
||||||
readsaved();
|
readsaved();
|
||||||
} else if (caller == "save") {
|
} else if (caller == "save") {
|
||||||
Gdx.app.log("save", "Ok");
|
|
||||||
Gdx.app.debug("Barre", "Sauvegarde de la grille.");
|
Gdx.app.debug("Barre", "Sauvegarde de la grille.");
|
||||||
Gdx.app.debug("Barre", AssetLoader.Datahandler.user().toString());
|
Gdx.app.debug("Barre", AssetLoader.Datahandler.user().toString());
|
||||||
AssetLoader.Datahandler.user().setGrid(0, level.id, level.Grid);
|
worlds.SaveGrid();
|
||||||
readsaved();
|
readsaved();
|
||||||
} else if (caller == "levels") {
|
} else if (caller == "levels") {
|
||||||
Gdx.app.debug("Barre", "Affichage des niveaux.");
|
Gdx.app.debug("Barre", "Affichage des niveaux.");
|
||||||
AssetLoader.Datahandler.user().setGrid(0, level.id, "LAST",
|
worlds.SaveLastGrid();
|
||||||
this.level.Grid);
|
((Game) Gdx.app.getApplicationListener()).setScreen(new LevelScreen(worlds));
|
||||||
((Game) Gdx.app.getApplicationListener())
|
|
||||||
.setScreen(new LevelScreen(level.aWorld));
|
|
||||||
} else if (caller == "tree") {
|
} else if (caller == "tree") {
|
||||||
} else if (caller == "exits") {
|
} else if (caller == "exits") {
|
||||||
AssetLoader.Datahandler.user().setGrid(0, level.id, "LAST",
|
worlds.SaveLastGrid();
|
||||||
this.level.Grid);
|
|
||||||
Gdx.app.exit();
|
Gdx.app.exit();
|
||||||
} else if (caller == "screen") {
|
} else if (caller == "screen") {
|
||||||
DisplayMode currentMode = Gdx.graphics.getDesktopDisplayMode();
|
DisplayMode currentMode = Gdx.graphics.getDesktopDisplayMode();
|
||||||
|
@ -799,7 +790,6 @@ public class GameScreen implements Screen {
|
||||||
|
|
||||||
public void preparemenu(int menuitem) {
|
public void preparemenu(int menuitem) {
|
||||||
map.tempclear();
|
map.tempclear();
|
||||||
//map.fillempty(53);
|
|
||||||
horizbar.unSelect();
|
horizbar.unSelect();
|
||||||
menu.setPageType(0,menuitem);
|
menu.setPageType(0,menuitem);
|
||||||
nextpage.setDisabled(menu.isNextEmpty());
|
nextpage.setDisabled(menu.isNextEmpty());
|
||||||
|
@ -820,8 +810,7 @@ public class GameScreen implements Screen {
|
||||||
info_research.setVisible(transmuter.getResearch() > 0);
|
info_research.setVisible(transmuter.getResearch() > 0);
|
||||||
info_research.setText(String.valueOf(transmuter.getResearch()));
|
info_research.setText(String.valueOf(transmuter.getResearch()));
|
||||||
info_activation.setVisible(transmuter.isActivable());
|
info_activation.setVisible(transmuter.isActivable());
|
||||||
info_activation.setText(String.valueOf(transmuter
|
info_activation.setText(String.valueOf(transmuter.getMaxActivationLevel()));
|
||||||
.getMaxActivationLevel()));
|
|
||||||
info_up_cycle.setVisible(transmuter.isUpgradableCycle());
|
info_up_cycle.setVisible(transmuter.isUpgradableCycle());
|
||||||
info_up_nrj.setVisible(transmuter.isUpgradableNrj());
|
info_up_nrj.setVisible(transmuter.isUpgradableNrj());
|
||||||
info_up_temp.setVisible(transmuter.isUpgradableTemp());
|
info_up_temp.setVisible(transmuter.isUpgradableTemp());
|
||||||
|
@ -846,6 +835,8 @@ public class GameScreen implements Screen {
|
||||||
AssetLoader.Atlas_level.findRegion("jauge"
|
AssetLoader.Atlas_level.findRegion("jauge"
|
||||||
+ transmuter.getUpgradeRayon()));
|
+ transmuter.getUpgradeRayon()));
|
||||||
info_up_rayonval.setColor(AssetLoader.Levelcolors[2]);
|
info_up_rayonval.setColor(AssetLoader.Levelcolors[2]);
|
||||||
|
info_up.setVisible(transmuter.isUnlockable(0)||transmuter.isUpgradable(0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideInfo() {
|
public void hideInfo() {
|
||||||
|
|
|
@ -18,7 +18,9 @@ import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextArea;
|
import com.badlogic.gdx.scenes.scene2d.ui.TextArea;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
import fr.evolving.UI.ButtonLevel;
|
import fr.evolving.UI.ButtonLevel;
|
||||||
|
@ -30,6 +32,8 @@ import fr.evolving.assets.AssetLoader;
|
||||||
import fr.evolving.assets.InitWorlds;
|
import fr.evolving.assets.InitWorlds;
|
||||||
import fr.evolving.assets.Preference;
|
import fr.evolving.assets.Preference;
|
||||||
import fr.evolving.automata.Level;
|
import fr.evolving.automata.Level;
|
||||||
|
import fr.evolving.automata.Worlds;
|
||||||
|
import fr.evolving.automata.Worlds.State;
|
||||||
import fr.evolving.database.Base;
|
import fr.evolving.database.Base;
|
||||||
import fr.evolving.renderers.LevelRenderer;
|
import fr.evolving.renderers.LevelRenderer;
|
||||||
|
|
||||||
|
@ -51,48 +55,18 @@ public class LevelScreen implements Screen {
|
||||||
private ServerList Statdata, Userdata, Gamedata;
|
private ServerList Statdata, Userdata, Gamedata;
|
||||||
private Worldlist Worlddata;
|
private Worldlist Worlddata;
|
||||||
private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel;
|
private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel;
|
||||||
private Array<Level> thelevels;
|
|
||||||
private TextArea TextDescriptive;
|
private TextArea TextDescriptive;
|
||||||
public int world;
|
public Worlds worlds;
|
||||||
private Objectives Victory;
|
private Objectives Victory;
|
||||||
public ButtonLevel selected;
|
public ButtonLevel selected;
|
||||||
|
|
||||||
public int getMaxWorld() {
|
|
||||||
int max = 0;
|
|
||||||
for (Level level : thelevels)
|
|
||||||
if (level != null && level.aWorld > max)
|
|
||||||
max = level.aWorld;
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void play() {
|
public void play() {
|
||||||
if (!AssetLoader.Datahandler.verifyall())
|
if (worlds.getState()!=State.notloaded && worlds.getState()!=State.databasefailed) {
|
||||||
Gdx.app.debug(getClass().getSimpleName(),
|
Gdx.app.debug(getClass().getSimpleName(),"Afficher le monde 0");
|
||||||
"Pilotes de bases de donnée défaillant.");
|
if (worlds.getWorld() < 0)
|
||||||
else {
|
worlds.setWorld(0);
|
||||||
Gdx.app.debug(getClass().getSimpleName(),
|
worlds.Forcereload();
|
||||||
"Chargement des mondes depuis la base.");
|
|
||||||
try {
|
|
||||||
if (world < 0)
|
|
||||||
world = 0;
|
|
||||||
thelevels = AssetLoader.Datahandler.game().getworld(
|
|
||||||
Preference.prefs.getString("world"));
|
|
||||||
/*
|
|
||||||
thelevels= InitWorlds.go();
|
|
||||||
AssetLoader.Datahandler.game().setworld
|
|
||||||
(thelevels,Preference.prefs.getString("world"));
|
|
||||||
*/
|
|
||||||
loadWorld(world);
|
|
||||||
Previous.setVisible(true);
|
|
||||||
Next.setVisible(true);
|
|
||||||
buttonPlay.setVisible(true);
|
|
||||||
TextDescriptive.setVisible(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Previous.setVisible(false);
|
|
||||||
Next.setVisible(false);
|
|
||||||
buttonPlay.setVisible(false);
|
|
||||||
TextDescriptive.setVisible(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +154,6 @@ public class LevelScreen implements Screen {
|
||||||
buttonConnect.setVisible(true);
|
buttonConnect.setVisible(true);
|
||||||
buttonStat.setVisible(true);
|
buttonStat.setVisible(true);
|
||||||
SetButtonStat();
|
SetButtonStat();
|
||||||
if (Preference.prefs.contains("world"))
|
|
||||||
play();
|
play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +190,7 @@ public class LevelScreen implements Screen {
|
||||||
buttonPlaythis.setVisible(false);
|
buttonPlaythis.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadWorld(int aworld) {
|
public void loadWorld() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (buttonLevels != null)
|
if (buttonLevels != null)
|
||||||
for (int j = 0; j < 10; j++) {
|
for (int j = 0; j < 10; j++) {
|
||||||
|
@ -228,14 +201,13 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
buttonLevels = null;
|
buttonLevels = null;
|
||||||
buttonLevels = new ButtonLevel[10];
|
buttonLevels = new ButtonLevel[10];
|
||||||
for (Level level : thelevels) {
|
for (Level level : worlds.getLevels()) {
|
||||||
if (level != null && level.aWorld == aworld) {
|
if (level != null) {
|
||||||
if (level.Name.isEmpty())
|
if (level.Name.isEmpty())
|
||||||
level.Name=AssetLoader.language.get("[level"+(level.aWorld+1)+"/"+(level.aLevel+1)+"-name]");
|
level.Name=AssetLoader.language.get("[level"+(level.aWorld+1)+"/"+(level.aLevel+1)+"-name]");
|
||||||
if (level.Description.isEmpty())
|
if (level.Description.isEmpty())
|
||||||
level.Description=AssetLoader.language.get("[level"+(level.aWorld+1)+"/"+(level.aLevel+1)+"-desc]");
|
level.Description=AssetLoader.language.get("[level"+(level.aWorld+1)+"/"+(level.aLevel+1)+"-desc]");
|
||||||
buttonLevels[i] = new ButtonLevel(level, true,
|
buttonLevels[i] = new ButtonLevel(level, true, AssetLoader.ratio, true);
|
||||||
AssetLoader.ratio);
|
|
||||||
Gdx.app.debug(getClass().getSimpleName(), "Ajout du niveau :"
|
Gdx.app.debug(getClass().getSimpleName(), "Ajout du niveau :"
|
||||||
+ level.Name + " N°" + String.valueOf(level.aLevel));
|
+ level.Name + " N°" + String.valueOf(level.aLevel));
|
||||||
buttonLevels[i++].addListener(new ClickListener() {
|
buttonLevels[i++].addListener(new ClickListener() {
|
||||||
|
@ -278,14 +250,43 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Gdx.app.debug(getClass().getSimpleName(), "Mise en place du level 0.");
|
Gdx.app.debug(getClass().getSimpleName(), "Mise en place du level 0.");
|
||||||
world = world;
|
|
||||||
buttonLevels[0].setChecked(true);
|
buttonLevels[0].setChecked(true);
|
||||||
showlevel(buttonLevels[0]);
|
showlevel(buttonLevels[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LevelScreen(int aworld) {
|
public LevelScreen(Worlds aworlds) {
|
||||||
Gdx.app.log("level", "Ok");
|
this.worlds = aworlds;
|
||||||
this.world = aworld;
|
worlds.addListener(new ChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
|
if (worlds.getState()!=Worlds.State.notloaded && worlds.getWorld()>=0)
|
||||||
|
{
|
||||||
|
LevelScreen.this.loadWorld();
|
||||||
|
if (buttonLevels!=null)
|
||||||
|
for (int j = 0; j < 10; j++)
|
||||||
|
{
|
||||||
|
if (buttonLevels[j]!=null) {
|
||||||
|
buttonLevels[j].setChecked(false);
|
||||||
|
if (worlds.getInformations()!=null && buttonLevels[j].level.id == worlds.getInformations().id) {
|
||||||
|
selected=buttonLevels[j];
|
||||||
|
selected.setChecked(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Previous.setVisible(true);
|
||||||
|
Next.setVisible(true);
|
||||||
|
buttonPlay.setVisible(true);
|
||||||
|
TextDescriptive.setVisible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Previous.setVisible(false);
|
||||||
|
Next.setVisible(false);
|
||||||
|
buttonPlay.setVisible(false);
|
||||||
|
TextDescriptive.setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Gdx.app.debug(getClass().getSimpleName(),
|
Gdx.app.debug(getClass().getSimpleName(),
|
||||||
"Création des elements primordiaux du screen (stage, renderer, table)");
|
"Création des elements primordiaux du screen (stage, renderer, table)");
|
||||||
stage = new Stage(AssetLoader.viewport);
|
stage = new Stage(AssetLoader.viewport);
|
||||||
|
@ -371,8 +372,7 @@ public class LevelScreen implements Screen {
|
||||||
AssetLoader.Datahandler.Attach(Gamedata.getModel(),
|
AssetLoader.Datahandler.Attach(Gamedata.getModel(),
|
||||||
Gamedata.getUrl());
|
Gamedata.getUrl());
|
||||||
if (!AssetLoader.Datahandler.verifyall()) {
|
if (!AssetLoader.Datahandler.verifyall()) {
|
||||||
dialog.Show(
|
dialog.Show(AssetLoader.language.get("[dialog-levelscreen-errorloading]"),stage);
|
||||||
AssetLoader.language.get("[dialog-levelscreen-errorloading]"),stage);
|
|
||||||
initlevel();
|
initlevel();
|
||||||
} else
|
} else
|
||||||
menu();
|
menu();
|
||||||
|
@ -389,6 +389,7 @@ public class LevelScreen implements Screen {
|
||||||
else
|
else
|
||||||
Userdata.setColor(1f, 1f, 1f, 1f);
|
Userdata.setColor(1f, 1f, 1f, 1f);
|
||||||
Worlddata.Refresh();
|
Worlddata.Refresh();
|
||||||
|
worlds.init();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonSave = new TextButton(AssetLoader.language.get("[buttonSave-levelscreen]"), AssetLoader.Skin_ui);
|
buttonSave = new TextButton(AssetLoader.language.get("[buttonSave-levelscreen]"), AssetLoader.Skin_ui);
|
||||||
|
@ -399,6 +400,7 @@ public class LevelScreen implements Screen {
|
||||||
Preference.prefs.putString("userdata", Userdata.getUrl());
|
Preference.prefs.putString("userdata", Userdata.getUrl());
|
||||||
Preference.prefs.putString("gamedata", Gamedata.getUrl());
|
Preference.prefs.putString("gamedata", Gamedata.getUrl());
|
||||||
Preference.prefs.putString("statdata", Statdata.getUrl());
|
Preference.prefs.putString("statdata", Statdata.getUrl());
|
||||||
|
Preference.prefs.flush();
|
||||||
dialog.Show(
|
dialog.Show(
|
||||||
AssetLoader.language.get("[dialog-levelscreen-savedatabase]"),stage);
|
AssetLoader.language.get("[dialog-levelscreen-savedatabase]"),stage);
|
||||||
}
|
}
|
||||||
|
@ -416,8 +418,8 @@ public class LevelScreen implements Screen {
|
||||||
buttonPlay.addListener(new ClickListener() {
|
buttonPlay.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
((Game) Gdx.app.getApplicationListener())
|
worlds.setLevel(selected.level.aLevel);
|
||||||
.setScreen(new GameScreen(selected.level));
|
((Game) Gdx.app.getApplicationListener()).setScreen(new GameScreen(worlds));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonStat = new TextButton(AssetLoader.language.get("[buttonStat-levelscreen]"), AssetLoader.Skin_ui);
|
buttonStat = new TextButton(AssetLoader.language.get("[buttonStat-levelscreen]"), AssetLoader.Skin_ui);
|
||||||
|
@ -429,7 +431,7 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonPlaythis = new TextButton(AssetLoader.language.get("[buttonPlaythis-levelscreen]"), AssetLoader.Skin_ui);
|
buttonPlaythis = new TextButton(AssetLoader.language.get("[buttonPlaythis-levelscreen]"), AssetLoader.Skin_ui);
|
||||||
buttonPlaythis.setBounds(1480, 50, 190, 40);
|
buttonPlaythis.setBounds(1480, 50, 230, 40);
|
||||||
buttonPlaythis.addListener(new ClickListener() {
|
buttonPlaythis.addListener(new ClickListener() {
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
if (!AssetLoader.Datahandler.verifyall())
|
if (!AssetLoader.Datahandler.verifyall())
|
||||||
|
@ -438,8 +440,7 @@ public class LevelScreen implements Screen {
|
||||||
if (Worlddata.getSelected() == null)
|
if (Worlddata.getSelected() == null)
|
||||||
dialog.Show(AssetLoader.language.get("[dialog-levelscreen-errornoworld]"), stage);
|
dialog.Show(AssetLoader.language.get("[dialog-levelscreen-errornoworld]"), stage);
|
||||||
else {
|
else {
|
||||||
Preference.prefs.putString("world",
|
worlds.set((String) Worlddata.getSelected());
|
||||||
(String) Worlddata.getSelected());
|
|
||||||
Preference.prefs.flush();
|
Preference.prefs.flush();
|
||||||
play();
|
play();
|
||||||
}
|
}
|
||||||
|
@ -462,13 +463,10 @@ public class LevelScreen implements Screen {
|
||||||
Next.addListener(new ClickListener() {
|
Next.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
if (world < getMaxWorld()) {
|
worlds.NextWorld();
|
||||||
world++;
|
|
||||||
loadWorld(world);
|
|
||||||
}
|
|
||||||
Gdx.app.debug(event.getListenerActor().toString(),
|
Gdx.app.debug(event.getListenerActor().toString(),
|
||||||
"World:" + String.valueOf(world) + " Maxworld:"
|
"World:" + String.valueOf(worlds.getWorld()) + " Maxworld:"
|
||||||
+ String.valueOf(getMaxWorld()));
|
+ String.valueOf(worlds.getMaxWorlds()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Previous = new ImageButton(AssetLoader.Skin_level, "Previous");
|
Previous = new ImageButton(AssetLoader.Skin_level, "Previous");
|
||||||
|
@ -476,13 +474,10 @@ public class LevelScreen implements Screen {
|
||||||
Previous.addListener(new ClickListener() {
|
Previous.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
if (world > 0) {
|
worlds.PreviousWorld();
|
||||||
world--;
|
|
||||||
loadWorld(world);
|
|
||||||
}
|
|
||||||
Gdx.app.debug(event.getListenerActor().toString(),
|
Gdx.app.debug(event.getListenerActor().toString(),
|
||||||
"World:" + String.valueOf(world) + " Maxworld:"
|
"World:" + String.valueOf(worlds.getWorld()) + " Maxworld:"
|
||||||
+ String.valueOf(getMaxWorld()));
|
+ String.valueOf(worlds.getMaxWorlds()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cout = new ImageTextButton("5", AssetLoader.Skin_level, "cout");
|
cout = new ImageTextButton("5", AssetLoader.Skin_level, "cout");
|
||||||
|
@ -530,7 +525,7 @@ public class LevelScreen implements Screen {
|
||||||
Userdata.Refresh();
|
Userdata.Refresh();
|
||||||
Gamedata.Refresh();
|
Gamedata.Refresh();
|
||||||
Gdx.app.debug(getClass().getSimpleName(), "Affichage du menu.");
|
Gdx.app.debug(getClass().getSimpleName(), "Affichage du menu.");
|
||||||
if (aworld != -1)
|
if (worlds.getWorld() != -1)
|
||||||
level();
|
level();
|
||||||
else
|
else
|
||||||
menu();
|
menu();
|
||||||
|
@ -553,6 +548,7 @@ public class LevelScreen implements Screen {
|
||||||
public void show() {
|
public void show() {
|
||||||
Gdx.app.log("*****", "Affichage du choix des mondes & niveaux.");
|
Gdx.app.log("*****", "Affichage du choix des mondes & niveaux.");
|
||||||
table.setFillParent(true);
|
table.setFillParent(true);
|
||||||
|
stage.addActor(worlds);
|
||||||
stage.addActor(MenuSolo);
|
stage.addActor(MenuSolo);
|
||||||
stage.addActor(MenuMulti);
|
stage.addActor(MenuMulti);
|
||||||
stage.addActor(MenuScenario);
|
stage.addActor(MenuScenario);
|
||||||
|
|
|
@ -10,6 +10,8 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||||
|
|
||||||
import fr.evolving.assets.AssetLoader;
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.assets.Preference;
|
||||||
|
import fr.evolving.automata.Worlds;
|
||||||
import fr.evolving.game.main;
|
import fr.evolving.game.main;
|
||||||
|
|
||||||
public class SplashScreen implements Screen {
|
public class SplashScreen implements Screen {
|
||||||
|
@ -48,8 +50,7 @@ public class SplashScreen implements Screen {
|
||||||
}), Actions.run(new Runnable() {
|
}), Actions.run(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
((Game) Gdx.app.getApplicationListener())
|
((Game) Gdx.app.getApplicationListener()).setScreen(new LevelScreen(new Worlds(Preference.prefs.getString("world"))));
|
||||||
.setScreen(new LevelScreen(-1));
|
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue