From 9cdfefee8087de115c4984ecfade73179ff75a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Tue, 5 Jul 2016 01:17:24 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20ajout=20et=20modification=20des=20insuf?= =?UTF-8?q?leurs=20d=C3=A9but=20de=20gestion=20du=20drap=20and=20drop=20mu?= =?UTF-8?q?ltimonde=20ajout=20des=20fl=C3=A8ches=20en=20mode=20=C3=A9ditio?= =?UTF-8?q?n=20de=20lien?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/fr/evolving/automata/Insufler100.java | 31 ++++---- core/src/fr/evolving/automata/Insufler33.java | 28 +++---- core/src/fr/evolving/automata/Insufler50.java | 30 +++---- core/src/fr/evolving/automata/Worlds.java | 1 - core/src/fr/evolving/dialogs/PrefWindow.java | 8 +- core/src/fr/evolving/effects/Laser.java | 34 ++++---- .../fr/evolving/renderers/LevelRenderer.java | 18 ++++- core/src/fr/evolving/screens/LevelScreen.java | 78 ++++++++++++------- 8 files changed, 126 insertions(+), 102 deletions(-) diff --git a/core/src/fr/evolving/automata/Insufler100.java b/core/src/fr/evolving/automata/Insufler100.java index 89631d9..afd5d5a 100644 --- a/core/src/fr/evolving/automata/Insufler100.java +++ b/core/src/fr/evolving/automata/Insufler100.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.utils.ObjectMap.Values; import com.badlogic.gdx.utils.OrderedMap; import fr.evolving.assets.AssetLoader; +import fr.evolving.automata.Transmuter.CaseType; import fr.evolving.automata.Transmuter.Class; public class Insufler100 extends Transmuter { @@ -68,25 +69,25 @@ public class Insufler100 extends Transmuter { this.Activable = false; this.ActivationLevel = 0; this.Tilestype = new OrderedMap(); - this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien); this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, 1), CaseType.Rien); - this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre); this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre); - this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien); this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, -1), CaseType.Rien); + this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre); this.Tilesid = new OrderedMap(); - this.Tilesid.put(new Vector2(-1, 1), 120); - this.Tilesid.put(new Vector2(0,1), 121); - this.Tilesid.put(new Vector2(1, 1), 122); - this.Tilesid.put(new Vector2(-1, 0), 123); - this.Tilesid.put(new Vector2(0, 0), 124); - this.Tilesid.put(new Vector2(1, 0), 125); - this.Tilesid.put(new Vector2(-1, -1), 126); - this.Tilesid.put(new Vector2(0, -1), 127); - this.Tilesid.put(new Vector2(1, -1), 128); + this.Tilesid.put(new Vector2(-1, 1), 125); + this.Tilesid.put(new Vector2(0,1), 141); + this.Tilesid.put(new Vector2(1, 1), 142); + this.Tilesid.put(new Vector2(-1, 0), 128); + this.Tilesid.put(new Vector2(0, 0), 143); + this.Tilesid.put(new Vector2(1, 0), 130); + this.Tilesid.put(new Vector2(-1, -1), 131); + this.Tilesid.put(new Vector2(0, -1), 144); + this.Tilesid.put(new Vector2(1, -1), 118); } public String getName() { diff --git a/core/src/fr/evolving/automata/Insufler33.java b/core/src/fr/evolving/automata/Insufler33.java index 3c73509..d8b5738 100644 --- a/core/src/fr/evolving/automata/Insufler33.java +++ b/core/src/fr/evolving/automata/Insufler33.java @@ -69,25 +69,25 @@ public class Insufler33 extends Transmuter { this.Activable = false; this.ActivationLevel = 0; this.Tilestype = new OrderedMap(); - this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre_seul); + this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien); this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre_seul); - this.Tilestype.put(new Vector2(1, 1), CaseType.Rien); - this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre_seul); + this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre_seul); this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre_seul); - this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre_seul); - this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre_seul); + this.Tilestype.put(new Vector2(1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien); this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre_seul); - this.Tilestype.put(new Vector2(1, -1), CaseType.Rien); + this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre_seul); this.Tilesid = new OrderedMap(); - this.Tilesid.put(new Vector2(-1, 1), 120); - this.Tilesid.put(new Vector2(0,1), 121); - this.Tilesid.put(new Vector2(1, 1), 122); - this.Tilesid.put(new Vector2(-1, 0), 123); + this.Tilesid.put(new Vector2(-1, 1), 125); + this.Tilesid.put(new Vector2(0,1), 126); + this.Tilesid.put(new Vector2(1, 1), 127); + this.Tilesid.put(new Vector2(-1, 0), 128); this.Tilesid.put(new Vector2(0, 0), 129); - this.Tilesid.put(new Vector2(1, 0), 125); - this.Tilesid.put(new Vector2(-1, -1), 126); - this.Tilesid.put(new Vector2(0, -1), 127); - this.Tilesid.put(new Vector2(1, -1), 128); + this.Tilesid.put(new Vector2(1, 0), 130); + this.Tilesid.put(new Vector2(-1, -1), 131); + this.Tilesid.put(new Vector2(0, -1), 132); + this.Tilesid.put(new Vector2(1, -1), 133); } public String getName() { diff --git a/core/src/fr/evolving/automata/Insufler50.java b/core/src/fr/evolving/automata/Insufler50.java index 1d63fef..b3a3489 100644 --- a/core/src/fr/evolving/automata/Insufler50.java +++ b/core/src/fr/evolving/automata/Insufler50.java @@ -69,25 +69,25 @@ public class Insufler50 extends Transmuter { this.Activable = false; this.ActivationLevel = 0; this.Tilestype = new OrderedMap(); - this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien); this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, 1), CaseType.Rien); - this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre); this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre); - this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre); + this.Tilestype.put(new Vector2(1, 0), CaseType.Rien); + this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien); this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre); - this.Tilestype.put(new Vector2(1, -1), CaseType.Rien); + this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre); this.Tilesid = new OrderedMap(); - this.Tilesid.put(new Vector2(-1, 1), 120); - this.Tilesid.put(new Vector2(0,1), 121); - this.Tilesid.put(new Vector2(1, 1), 122); - this.Tilesid.put(new Vector2(-1, 0), 123); - this.Tilesid.put(new Vector2(0, 0), 130); - this.Tilesid.put(new Vector2(1, 0), 125); - this.Tilesid.put(new Vector2(-1, -1), 126); - this.Tilesid.put(new Vector2(0, -1), 127); - this.Tilesid.put(new Vector2(1, -1), 128); + this.Tilesid.put(new Vector2(-1, 1), 125); + this.Tilesid.put(new Vector2(0,1), 137); + this.Tilesid.put(new Vector2(1, 1), 138); + this.Tilesid.put(new Vector2(-1, 0), 128); + this.Tilesid.put(new Vector2(0, 0), 139); + this.Tilesid.put(new Vector2(1, 0), 130); + this.Tilesid.put(new Vector2(-1, -1), 131); + this.Tilesid.put(new Vector2(0, -1), 140); + this.Tilesid.put(new Vector2(1, -1), 138); } public String getName() { diff --git a/core/src/fr/evolving/automata/Worlds.java b/core/src/fr/evolving/automata/Worlds.java index 917239d..5a990c0 100644 --- a/core/src/fr/evolving/automata/Worlds.java +++ b/core/src/fr/evolving/automata/Worlds.java @@ -10,7 +10,6 @@ import fr.evolving.assets.InitWorlds; import fr.evolving.assets.Preference; public class Worlds extends Actor { - private ChangeEvent event; private Array levels; private String name; private int usedworld; diff --git a/core/src/fr/evolving/dialogs/PrefWindow.java b/core/src/fr/evolving/dialogs/PrefWindow.java index c6ed08b..1a2709d 100644 --- a/core/src/fr/evolving/dialogs/PrefWindow.java +++ b/core/src/fr/evolving/dialogs/PrefWindow.java @@ -121,7 +121,7 @@ public class PrefWindow extends Window { Setrefresh = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-refresh]"),AssetLoader.Skin_ui); table.add(Setrefresh).left(); table.row(); - table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-language]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left(); + table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-language]"), AssetLoader.Skin_ui,"medium", Color.WHITE)).left(); Setflag = new ImageButton(AssetLoader.Skin_level, "Setflag"); table.add(Setflag); table.row(); @@ -139,7 +139,7 @@ public class PrefWindow extends Window { SetVsynch = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-sync]"),AssetLoader.Skin_ui); table.add(SetVsynch).left(); Table tablev1 = new Table(); - tablev1.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-resolution]"), AssetLoader.Skin_ui, "default-font",Color.WHITE)).left().row(); + tablev1.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-resolution]"), AssetLoader.Skin_ui, "medium",Color.WHITE)).left().row(); selResolution = new SelectBox(AssetLoader.Skin_ui); selResolution.setItems(resolutions.values()); tablev1.add(selResolution).left().row(); @@ -149,7 +149,7 @@ public class PrefWindow extends Window { SetFullscreen = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-full]"), AssetLoader.Skin_ui); table.add(SetFullscreen).left(); Table tablev2 = new Table(); - tablev2.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-fill]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left().row(); + tablev2.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-fill]"), AssetLoader.Skin_ui,"medium", Color.WHITE)).left().row(); selAdaptscreen = new SelectBox(AssetLoader.Skin_ui); selAdaptscreen.setItems(adaptation.values()); tablev2.add(selAdaptscreen).left().row(); @@ -157,7 +157,7 @@ public class PrefWindow extends Window { table.row(); Table tablev3 = new Table(); - tablev3.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-quality]"), AssetLoader.Skin_ui, "default-font", Color.WHITE)).left().row(); + tablev3.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-quality]"), AssetLoader.Skin_ui, "medium", Color.WHITE)).left().row(); SetAnimation = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-animation]"),AssetLoader.Skin_ui); table.add(SetAnimation).left(); selTexturequal = new SelectBox(AssetLoader.Skin_ui); diff --git a/core/src/fr/evolving/effects/Laser.java b/core/src/fr/evolving/effects/Laser.java index 3eb1f8d..bc598b6 100644 --- a/core/src/fr/evolving/effects/Laser.java +++ b/core/src/fr/evolving/effects/Laser.java @@ -71,27 +71,21 @@ public class Laser { float y2 = yy2 + 20; Laser.begin(ShapeType.Filled); Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); - if (true) { - Vector2 vectorall = new Vector2(x2, y2).sub(new Vector2(x1, y1)); - float length = vectorall.len(); - float size = 20; - Vector2 vectoradd = vectorall.scl(size / length); - float adding = 0; - for (float i = 2; i + 2 < length / size; i += 1) { - float width = (float) (maxwidth - Math.random() * 2); - while (width >= 0) { - adding = (width * power / maxwidth); - Color Acolor = colorsrc.cpy().lerp(colordst.cpy(),(i / (length / size))); - Laser.setColor(Acolor.add(adding, adding, adding, 0.5f)); - if (Math.random() > 0.4) - Laser.rectLine(x1 + i * vectoradd.x, y1 + i * vectoradd.y, x1 + (i + 1) * vectoradd.x, y1+ (i + 1) * vectoradd.y, width); - width = width - 1; - } + Vector2 vectorall = new Vector2(x2, y2).sub(new Vector2(x1, y1)); + float length = vectorall.len(); + float size = 20; + Vector2 vectoradd = vectorall.scl(size / length); + float adding = 0; + for (float i = 0; i < length / size-1; i += 1) { + float width = (float) (maxwidth - Math.random() * 2); + while (width >= 0) { + adding = (width * power / maxwidth); + Color Acolor = colorsrc.cpy().lerp(colordst.cpy(),(i / (length / size))); + Laser.setColor(Acolor.add(adding, adding, adding, 0.5f)); + if (Math.random() > 0.4) + Laser.rectLine(x1 + i * vectoradd.x, y1 + i * vectoradd.y, x1 + (i + 1) * vectoradd.x, y1+ (i + 1) * vectoradd.y, width); + width = width - 1; } - } else { - Color Acolor = new Color(0.5f, 0.5f, 0.5f, 1f); - Laser.setColor(Acolor); - Laser.rectLine(x1, y1, x2, y2, 2); } Laser.end(); Gdx.gl.glDisable(GL20.GL_BLEND); diff --git a/core/src/fr/evolving/renderers/LevelRenderer.java b/core/src/fr/evolving/renderers/LevelRenderer.java index de92f4a..76c126e 100644 --- a/core/src/fr/evolving/renderers/LevelRenderer.java +++ b/core/src/fr/evolving/renderers/LevelRenderer.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; +import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import fr.evolving.UI.ButtonLevel; @@ -107,10 +108,19 @@ public class LevelRenderer { if ((item.length == 2) && (button2.level.aWorld == item[0]) && (button2.level.aLevel == item[1])) if (!LevelScreen.worlds.isDebug()) Laser.draw(batcher,button1.level.X,button1.level.Y* AssetLoader.ratio,button2.level.X,button2.level.Y* AssetLoader.ratio,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor()); - else - Laser.drawnotsoold(shapeRenderer,button1.level.X,button1.level.Y* AssetLoader.ratio,button2.level.X,button2.level.Y* AssetLoader.ratio,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor()); - - } + else { + Vector2 debut=new Vector2(button1.level.X,button1.level.Y* AssetLoader.ratio); + Vector2 fin=new Vector2(button2.level.X,button2.level.Y* AssetLoader.ratio); + Vector2 size=fin.cpy().sub(debut); + Vector2 newfin=size.cpy().limit(size.len()-40).add(debut); + Vector2 corps=fin.cpy().sub(debut).limit(45); + Vector2 fleche1=newfin.cpy().sub(corps.cpy().rotate(30)); + Vector2 fleche2=newfin.cpy().sub(corps.cpy().rotate(-30)); + Laser.drawnotsoold(shapeRenderer,debut.x,debut.y,fin.x,fin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor()); + Laser.drawnotsoold(shapeRenderer,fleche2.x,fleche2.y,newfin.x,newfin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor()); + Laser.drawnotsoold(shapeRenderer,fleche1.x,fleche1.y,newfin.x,newfin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor()); + } + } } } diff --git a/core/src/fr/evolving/screens/LevelScreen.java b/core/src/fr/evolving/screens/LevelScreen.java index 41ec0ff..c710297 100644 --- a/core/src/fr/evolving/screens/LevelScreen.java +++ b/core/src/fr/evolving/screens/LevelScreen.java @@ -71,7 +71,7 @@ public class LevelScreen implements Screen { private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave, buttonApply, buttonPlaythis; private ServerList Statdata, Userdata, Gamedata; private Worldlist Worlddata; - private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel, rewardlabel, goallavel, ressourcelabel, handicaplabel; + private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel, rewardlabel, goallabel, ressourcelabel, handicaplabel; private TextField worldfield; private TextArea TextDescriptive; public Worlds worlds; @@ -81,7 +81,6 @@ public class LevelScreen implements Screen { public int addervalue; private ButtonGroup