From 6e691f7bcc2dff24262b495f03edb83801c6fdde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Sat, 8 Aug 2015 13:19:29 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20am=C3=A9lioration=20de=20la=20cr=C3=A9a?= =?UTF-8?q?tion=20des=20pistes=20&=20fibre=20par=20le=20biais=20de=20plusi?= =?UTF-8?q?eurs=20outils=20>=20pinceau,=20stylo,=20gomme,=20balayette.=20p?= =?UTF-8?q?ossibilit=C3=A9=20de=20d=C3=A9truire=20s=C3=A9lectivement=20tra?= =?UTF-8?q?nsmuteur,=20pistes=20&=20fibre.=20cr=C3=A9ation=20d'une=20fonct?= =?UTF-8?q?ion=20qui=20trouve=20le=20tile=20principal=20(vector2)=20a=20pa?= =?UTF-8?q?rtir=20d'un=20num=C3=A9ro=20de=20tile=20(avec=20rotation).=20le?= =?UTF-8?q?=20menu=20se=20rempli=20en=20fonction=20des=20classes=20d=C3=A9?= =?UTF-8?q?clar=C3=A9e=20dans=20transmuter=20(enum=C3=A9ration=20class)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/fr/evolving/UI/Menu.java | 3 +- core/src/fr/evolving/UI/TouchMaptiles.java | 15 +- core/src/fr/evolving/assets/AssetLoader.java | 11 +- core/src/fr/evolving/automata/Grid.java | 3 + .../src/fr/evolving/automata/Positiver_I.java | 4 +- .../fr/evolving/automata/Positiver_II.java | 4 +- .../fr/evolving/automata/Positiver_III.java | 4 +- core/src/fr/evolving/automata/Transmuter.java | 12 +- core/src/fr/evolving/screens/GameScreen.java | 159 ++++++++++++++---- 9 files changed, 163 insertions(+), 52 deletions(-) diff --git a/core/src/fr/evolving/UI/Menu.java b/core/src/fr/evolving/UI/Menu.java index 6d74e0c..dccfb61 100644 --- a/core/src/fr/evolving/UI/Menu.java +++ b/core/src/fr/evolving/UI/Menu.java @@ -65,8 +65,9 @@ public void clear() public void setMenu(int x,int y,int tile) { Cell cell=((TiledMapTileLayer)map.getLayers().get(0)).getCell(x,y); - if (cell!=null) + if (cell!=null) { cell.setTile(AssetLoader.tileSet.getTile(tile)); + } } public int getMenu(int x,int y) diff --git a/core/src/fr/evolving/UI/TouchMaptiles.java b/core/src/fr/evolving/UI/TouchMaptiles.java index b421ed9..682642d 100644 --- a/core/src/fr/evolving/UI/TouchMaptiles.java +++ b/core/src/fr/evolving/UI/TouchMaptiles.java @@ -62,19 +62,20 @@ public Vector2 screentoworldsize(float x, float y) { } public void redraw(int tile) { + for (int x=0;x tiles=this.getTiles(); Iterator keySetIterator = tiles.keySet().iterator(); int Idrec=this.getMainTile(); - if (Id==Idrec) + if ((Id & 0xFFFF)==Idrec) return new Vector2(); + Transmuter.Angular oldrotation=this.getRotation(); + this.setRotation(Transmuter.Angular.values()[Id>>16]); while(keySetIterator.hasNext()){ Vector2 key = keySetIterator.next(); Idrec++; - if (Id==Idrec) - return new Vector2().sub(key); + if ((Id & 0xFFFF)==Idrec) { + this.setRotation(oldrotation); + return new Vector2().sub(key); + } } + this.setRotation(oldrotation); return null; } @@ -222,7 +227,6 @@ public abstract class Transmuter { } - public Angular getRotation() { return this.Rotation; } diff --git a/core/src/fr/evolving/screens/GameScreen.java b/core/src/fr/evolving/screens/GameScreen.java index d83fb2c..434791c 100644 --- a/core/src/fr/evolving/screens/GameScreen.java +++ b/core/src/fr/evolving/screens/GameScreen.java @@ -65,8 +65,7 @@ public class GameScreen implements Screen { private ImageButton[] Barre; private ImageTextButton cycle,temp,nrj,rayon,cout,tech; private ImageTextButton[] Barre2; - String[] tocreate={"run","stop","speed","separator","move","zoomp","zoomm","separator","raz","save","levels","tree","exits","separator","screen","sound","tuto","settings","separator","stat"}; - String[] tocreate2={"Structure","Charge","Direction","Selection","Création","Détection","Action","Scénario"}; + String[] tocreate={"run","stop","speed","separator","move","zoomp","zoomm","infos","separator","raz","save","levels","tree","exits","separator","screen","sound","tuto","settings","separator","stat"}; public Actor selected; public Transmuter selected_transmuter; private ButtonLevel buttonlevel; @@ -114,17 +113,18 @@ public class GameScreen implements Screen { Gdx.app.debug(getClass().getSimpleName(),"Création des barres"); Barre=new ImageButton[tocreate.length]; int i=0; + Gdx.app.debug(getClass().getSimpleName(),"Barre bas:"+Barre.length+" elements"); for (String tocreateitem: tocreate) { Barre[i]= new ImageButton(AssetLoader.Skin_level,tocreateitem); Barre[i++].setName(tocreateitem); } - Barre2=new ImageTextButton[tocreate2.length]; - i=0; - for (String tocreateitem: tocreate2) { - Barre2[i]= new ImageTextButton(tocreateitem,AssetLoader.Skin_level); - Barre2[i++].setName(tocreateitem); + Barre2=new ImageTextButton[Transmuter.Class.values().length]; + Gdx.app.debug(getClass().getSimpleName(),"Menu:"+Barre2.length+" elements"); + for (i=0;i99) { Transmuter transmuter=AssetLoader.getTransmuter(tile); @@ -539,9 +632,9 @@ public class GameScreen implements Screen { @Override public void show() { Gdx.app.log("*****","Affichage du niveau."); - for (int i=0;i