feat: amélioration de la création des pistes & fibre par le biais de plusieurs outils > pinceau, stylo, gomme, balayette. possibilité de détruire sélectivement transmuteur, pistes & fibre. création d'une fonction qui trouve le tile principal (vector2) a partir d'un numéro de tile (avec rotation). le menu se rempli en fonction des classes déclarée dans transmuter (enumération class)

This commit is contained in:
Nicolas Hordé 2015-08-08 13:19:29 +02:00
parent e2f28ba535
commit 6e691f7bcc
9 changed files with 163 additions and 52 deletions

View File

@ -65,8 +65,9 @@ public void clear()
public void setMenu(int x,int y,int tile) public void setMenu(int x,int y,int tile)
{ {
Cell cell=((TiledMapTileLayer)map.getLayers().get(0)).getCell(x,y); Cell cell=((TiledMapTileLayer)map.getLayers().get(0)).getCell(x,y);
if (cell!=null) if (cell!=null) {
cell.setTile(AssetLoader.tileSet.getTile(tile)); cell.setTile(AssetLoader.tileSet.getTile(tile));
}
} }
public int getMenu(int x,int y) public int getMenu(int x,int y)

View File

@ -62,19 +62,20 @@ public Vector2 screentoworldsize(float x, float y) {
} }
public void redraw(int tile) { public void redraw(int tile) {
for (int x=0;x<level.Grid.sizeX;x++)
for (int y=0;y<level.Grid.sizeY;y++) {
((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setTile(null);
((TiledMapTileLayer)map.getLayers().get(1)).getCell((int)x, (int)y).setTile(null);
((TiledMapTileLayer)map.getLayers().get(0)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(tile));
}
for (int x=0;x<level.Grid.sizeX;x++) for (int x=0;x<level.Grid.sizeX;x++)
for (int y=0;y<level.Grid.sizeY;y++) { for (int y=0;y<level.Grid.sizeY;y++) {
if (level.Grid.getCopper(x,y)) if (level.Grid.getCopper(x,y))
((TiledMapTileLayer)map.getLayers().get(1)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(level.Grid.getCoppercalc(x,y))); ((TiledMapTileLayer)map.getLayers().get(1)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(level.Grid.getCoppercalc(x,y)));
else
((TiledMapTileLayer)map.getLayers().get(1)).getCell((int)x, (int)y).setTile(null);
if (level.Grid.GetFiber(x,y)) if (level.Grid.GetFiber(x,y))
((TiledMapTileLayer)map.getLayers().get(0)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(61)); ((TiledMapTileLayer)map.getLayers().get(0)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(61));
else if (level.Grid.getTransmutercalc(x, y)!=0)
((TiledMapTileLayer)map.getLayers().get(0)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(tile)); {
if (level.Grid.getTransmutercalc(x, y)==0)
((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setTile(null);
else {
((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(level.Grid.getTransmutercalc(x, y))); ((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setTile(AssetLoader.tileSet.getTile(level.Grid.getTransmutercalc(x, y)));
((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setRotation(level.Grid.getTransmuterrot(x, y)); ((TiledMapTileLayer)map.getLayers().get(2)).getCell((int)x, (int)y).setRotation(level.Grid.getTransmuterrot(x, y));
} }

View File

@ -24,6 +24,7 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapTileSet; import com.badlogic.gdx.maps.tiled.TiledMapTileSet;
import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.ScalingViewport; import com.badlogic.gdx.utils.viewport.ScalingViewport;
@ -122,7 +123,7 @@ public class AssetLoader {
Gdx.app.debug("AssetLoader","Création des tiles..."); Gdx.app.debug("AssetLoader","Création des tiles...");
tileSet = new TiledMapTileSet(); tileSet = new TiledMapTileSet();
tileSet.setName("copper"); tileSet.setName("copper");
for (int i = 0; i < 70; i++) { for (int i = 0; i < 99; i++) {
TextureRegion tileText = Atlas_level.findRegion("sprite"+i); TextureRegion tileText = Atlas_level.findRegion("sprite"+i);
if (tileText != null) { if (tileText != null) {
StaticTiledMapTile atile= new StaticTiledMapTile(tileText); StaticTiledMapTile atile= new StaticTiledMapTile(tileText);
@ -158,6 +159,14 @@ public class AssetLoader {
return null; return null;
} }
public static Vector2 resolveTransmuterMain(int Id) {
Transmuter transmuter=getTransmuter(Id);
if (transmuter!=null)
return transmuter.getPostitionMainTile(Id);
else
return null;
}
public static int setpref() { public static int setpref() {
prefs = Gdx.app.getPreferences("WireWorld - Evolving Games"); prefs = Gdx.app.getPreferences("WireWorld - Evolving Games");
if (prefs.contains("log")) if (prefs.contains("log"))

View File

@ -26,6 +26,9 @@ public class Grid implements Serializable{
public void tiling_transmuter() { public void tiling_transmuter() {
for (int x=0;x<this.sizeX;x++) for (int x=0;x<this.sizeX;x++)
for (int y=0;y<this.sizeY;y++)
GetXY(x,y).Transmuter_calc=0;
for (int x=0;x<this.sizeX;x++)
for (int y=0;y<this.sizeY;y++) { for (int y=0;y<this.sizeY;y++) {
Transmuter transmuter=getTransmuter(x,y); Transmuter transmuter=getTransmuter(x,y);
if (transmuter!=null) if (transmuter!=null)

View File

@ -134,8 +134,8 @@ public class Positiver_I extends Transmuter {
} }
public int FindMainTile(int Id) { public int FindMainTile(int Id) {
int thesize=Id/100; int thesize=(Id & 0xFFFF)/100;
int deltaid=Id-thesize*100; int deltaid=(Id & 0xFFFF)-thesize*100;
return thesize*100+((int)(deltaid/thesize))*thesize; return thesize*100+((int)(deltaid/thesize))*thesize;
} }

View File

@ -132,8 +132,8 @@ public class Positiver_II extends Transmuter {
} }
public int FindMainTile(int Id) { public int FindMainTile(int Id) {
int thesize=Id/100; int thesize=(Id & 0xFFFF)/100;
int deltaid=Id-thesize*100; int deltaid=(Id & 0xFFFF)-thesize*100;
return thesize*100+((int)(deltaid/thesize))*thesize; return thesize*100+((int)(deltaid/thesize))*thesize;
} }

View File

@ -132,8 +132,8 @@ public class Positiver_III extends Transmuter {
} }
public int FindMainTile(int Id) { public int FindMainTile(int Id) {
int thesize=Id/100; int thesize=(Id & 0xFFFF)/100;
int deltaid=Id-thesize*100; int deltaid=(Id & 0xFFFF)-thesize*100;
return thesize*100+((int)(deltaid/thesize))*thesize; return thesize*100+((int)(deltaid/thesize))*thesize;
} }

View File

@ -71,14 +71,19 @@ public abstract class Transmuter {
HashMap<Vector2,CaseType> tiles=this.getTiles(); HashMap<Vector2,CaseType> tiles=this.getTiles();
Iterator<Vector2> keySetIterator = tiles.keySet().iterator(); Iterator<Vector2> keySetIterator = tiles.keySet().iterator();
int Idrec=this.getMainTile(); int Idrec=this.getMainTile();
if (Id==Idrec) if ((Id & 0xFFFF)==Idrec)
return new Vector2(); return new Vector2();
Transmuter.Angular oldrotation=this.getRotation();
this.setRotation(Transmuter.Angular.values()[Id>>16]);
while(keySetIterator.hasNext()){ while(keySetIterator.hasNext()){
Vector2 key = keySetIterator.next(); Vector2 key = keySetIterator.next();
Idrec++; Idrec++;
if (Id==Idrec) if ((Id & 0xFFFF)==Idrec) {
return new Vector2().sub(key); this.setRotation(oldrotation);
return new Vector2().sub(key);
}
} }
this.setRotation(oldrotation);
return null; return null;
} }
@ -222,7 +227,6 @@ public abstract class Transmuter {
} }
public Angular getRotation() { public Angular getRotation() {
return this.Rotation; return this.Rotation;
} }

View File

@ -65,8 +65,7 @@ public class GameScreen implements Screen {
private ImageButton[] Barre; private ImageButton[] Barre;
private ImageTextButton cycle,temp,nrj,rayon,cout,tech; private ImageTextButton cycle,temp,nrj,rayon,cout,tech;
private ImageTextButton[] Barre2; 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[] tocreate={"run","stop","speed","separator","move","zoomp","zoomm","infos","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"};
public Actor selected; public Actor selected;
public Transmuter selected_transmuter; public Transmuter selected_transmuter;
private ButtonLevel buttonlevel; private ButtonLevel buttonlevel;
@ -114,17 +113,18 @@ public class GameScreen implements Screen {
Gdx.app.debug(getClass().getSimpleName(),"Création des barres"); Gdx.app.debug(getClass().getSimpleName(),"Création des barres");
Barre=new ImageButton[tocreate.length]; Barre=new ImageButton[tocreate.length];
int i=0; int i=0;
Gdx.app.debug(getClass().getSimpleName(),"Barre bas:"+Barre.length+" elements");
for (String tocreateitem: tocreate) { for (String tocreateitem: tocreate) {
Barre[i]= new ImageButton(AssetLoader.Skin_level,tocreateitem); Barre[i]= new ImageButton(AssetLoader.Skin_level,tocreateitem);
Barre[i++].setName(tocreateitem); Barre[i++].setName(tocreateitem);
} }
Barre2=new ImageTextButton[tocreate2.length]; Barre2=new ImageTextButton[Transmuter.Class.values().length];
i=0; Gdx.app.debug(getClass().getSimpleName(),"Menu:"+Barre2.length+" elements");
for (String tocreateitem: tocreate2) { for (i=0;i<Barre2.length;i++) {
Barre2[i]= new ImageTextButton(tocreateitem,AssetLoader.Skin_level); Barre2[i]= new ImageTextButton(Transmuter.Class.values()[i].toString(),AssetLoader.Skin_level);
Barre2[i++].setName(tocreateitem); Barre2[i].setName(Transmuter.Class.values()[i].toString());
} }
Barre[10].addListener(new ClickListener(){ Barre[11].addListener(new ClickListener(){
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
Gdx.app.debug(event.getListenerActor().toString(),"Barre:Niveaux"); Gdx.app.debug(event.getListenerActor().toString(),"Barre:Niveaux");
@ -191,8 +191,8 @@ public class GameScreen implements Screen {
} }
}); });
if (Gdx.graphics.isFullscreen()) if (Gdx.graphics.isFullscreen())
Barre[14].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("windows")); Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("windows"));
Barre[14].addListener(new ClickListener(){ Barre[15].addListener(new ClickListener(){
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
Gdx.app.debug(event.getListenerActor().toString(),"Barre:Ecran"); Gdx.app.debug(event.getListenerActor().toString(),"Barre:Ecran");
@ -201,19 +201,19 @@ public class GameScreen implements Screen {
{ {
Gdx.app.debug(event.getListenerActor().toString(),"vers fenetre."); Gdx.app.debug(event.getListenerActor().toString(),"vers fenetre.");
Gdx.graphics.setDisplayMode(currentMode.width, currentMode.height, false); Gdx.graphics.setDisplayMode(currentMode.width, currentMode.height, false);
Barre[14].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("screen")); Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("screen"));
} }
else else
{ {
Gdx.app.debug(event.getListenerActor().toString(),"vers plein ecran."); Gdx.app.debug(event.getListenerActor().toString(),"vers plein ecran.");
Gdx.graphics.setDisplayMode(currentMode.width, currentMode.height, true); Gdx.graphics.setDisplayMode(currentMode.width, currentMode.height, true);
Barre[14].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("windows")); Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("windows"));
} }
} }
}); });
if (AssetLoader.intro.getVolume()==0) if (AssetLoader.intro.getVolume()==0)
Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("nosound")); Barre[16].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("nosound"));
Barre[15].addListener(new ClickListener(){ Barre[16].addListener(new ClickListener(){
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
Gdx.app.debug(event.getListenerActor().getName(),"Barre:Son"); Gdx.app.debug(event.getListenerActor().getName(),"Barre:Son");
@ -221,24 +221,24 @@ public class GameScreen implements Screen {
{ {
Gdx.app.debug(event.getListenerActor().toString(),"arret son."); Gdx.app.debug(event.getListenerActor().toString(),"arret son.");
AssetLoader.intro.setVolume(0f); AssetLoader.intro.setVolume(0f);
Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("nosound")); Barre[16].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("nosound"));
} }
else else
{ {
Gdx.app.debug(event.getListenerActor().toString(),"marche son."); Gdx.app.debug(event.getListenerActor().toString(),"marche son.");
AssetLoader.intro.setVolume(1f); AssetLoader.intro.setVolume(1f);
Barre[15].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("sound")); Barre[16].getStyle().up =new TextureRegionDrawable(AssetLoader.Atlas_level.findRegion("sound"));
} }
} }
}); });
Barre[12].addListener(new ClickListener(){ Barre[13].addListener(new ClickListener(){
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
Gdx.app.debug(event.getListenerActor().toString(),"Barre:Quitter"); Gdx.app.debug(event.getListenerActor().toString(),"Barre:Quitter");
Gdx.app.exit(); Gdx.app.exit();
} }
}); });
for (i=4;i<7;i++) { for (i=4;i<8;i++) {
Barre[i].addListener(new ClickListener(){ Barre[i].addListener(new ClickListener(){
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
@ -256,9 +256,16 @@ public class GameScreen implements Screen {
menu.clear(); menu.clear();
map.fillempty(53); map.fillempty(53);
selected=null; selected=null;
menu.setMenu(0, 7, 10); menu.setMenu(0, 7, 71);
menu.setMenu(1, 7, 61); menu.setMenu(1, 7, 72);
menu.setMenu(2, 7, 53); menu.setMenu(2, 7, 73);
menu.setMenu(1, 5, 70);
menu.setMenu(0, 6, 74);
menu.setMenu(1, 6, 75);
menu.setMenu(2, 6, 76);
menu.setMenu(0, 5, 77);
menu.setMenu(2, 5, 78);
menu.setMenu(3, 3, 79);
Barre2[0].setChecked(true); Barre2[0].setChecked(true);
} }
}); });
@ -366,6 +373,19 @@ public class GameScreen implements Screen {
oldy=0; oldy=0;
if (selected==null) if (selected==null)
; ;
else if (selected.getName()=="cleaner")
{
for(x=0;x<level.Grid.sizeX;x++)
for(y=0;y<level.Grid.sizeY;y++) {
level.Grid.GetXY(x, y).Copper=false;
level.Grid.GetXY(x, y).Fiber=0;
level.Grid.GetXY(x, y).Transmuter=null;
}
level.Grid.tiling_copper();
level.Grid.tiling_transmuter();
map.redraw(60);
return false;
}
else if (selected.getName()=="zoomp") else if (selected.getName()=="zoomp")
{ {
map.setZoom(0.9f); map.setZoom(0.9f);
@ -378,7 +398,7 @@ public class GameScreen implements Screen {
map.setDec((AssetLoader.width/2-x)/2,(AssetLoader.height/2-y)/2); map.setDec((AssetLoader.width/2-x)/2,(AssetLoader.height/2-y)/2);
return false; return false;
} }
else if (selected.getName()=="copper") else if (selected.getName()=="copper-pen")
{ {
Vector2 coords=map.screentoworld(x, y); Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null) if (level.Grid.GetXY(coords.x,coords.y)!=null)
@ -392,7 +412,7 @@ public class GameScreen implements Screen {
map.redraw(60); map.redraw(60);
} }
} }
else if (selected.getName()=="fiber") else if (selected.getName()=="fiber-pen")
{ {
Vector2 coords=map.screentoworld(x, y); Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null) if (level.Grid.GetXY(coords.x,coords.y)!=null)
@ -444,7 +464,7 @@ public class GameScreen implements Screen {
oldx=x; oldx=x;
oldy=y; oldy=y;
} }
else if (selected.getName()=="copper") else if (selected.getName()=="copper-brush")
{ {
Vector2 coords=map.screentoworld(x, y); Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null) if (level.Grid.GetXY(coords.x,coords.y)!=null)
@ -455,7 +475,7 @@ public class GameScreen implements Screen {
map.redraw(60); map.redraw(60);
} }
} }
else if (selected.getName()=="fiber") else if (selected.getName()=="fiber-brush")
{ {
Vector2 coords=map.screentoworld(x, y); Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null) if (level.Grid.GetXY(coords.x,coords.y)!=null)
@ -465,6 +485,66 @@ public class GameScreen implements Screen {
map.redraw(60); map.redraw(60);
} }
} }
else if (selected.getName()=="copper-eraser")
{
Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null)
{
Gdx.app.debug(event.getListenerActor().toString(),"Screen coordinates translated to world coordinates: "+ "X: " + coords.x + " Y: " + coords.y);
level.Grid.GetXY(coords.x,coords.y).Copper=false;
level.Grid.tiling_copper();
map.redraw(60);
}
}
else if (selected.getName()=="fiber-eraser")
{
Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null)
{
Gdx.app.debug(event.getListenerActor().toString(),"Screen coordinates translated to world coordinates: "+ "X: " + coords.x + " Y: " + coords.y);
level.Grid.GetXY(coords.x,coords.y).Fiber=0;
map.redraw(60);
}
}
else if (selected.getName()=="transmuter-eraser")
{
Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null)
{
if (level.Grid.GetXY(coords.x,coords.y).Transmuter_calc!=0)
{
Gdx.app.debug(event.getListenerActor().toString(),"Screen coordinates translated to world coordinates: "+ "X: " + coords.x + " Y: " + coords.y);
Vector2 gotomain=AssetLoader.resolveTransmuterMain(level.Grid.GetXY(coords.x,coords.y).Transmuter_calc);
if (gotomain!=null) {
level.Grid.GetXY(coords.x+gotomain.x,coords.y+gotomain.y).Transmuter=null;
Gdx.app.debug(event.getListenerActor().toString(),"transmuter deplacement vers origine:"+String.valueOf(gotomain.x)+","+String.valueOf(gotomain.y)+" coords:"+(coords.x+gotomain.x)+"x"+(coords.y+gotomain.y));
}
level.Grid.tiling_transmuter();
map.redraw(53);
}
}
}
else if (selected.getName()=="all-eraser")
{
Vector2 coords=map.screentoworld(x, y);
if (level.Grid.GetXY(coords.x,coords.y)!=null)
{
if (level.Grid.GetXY(coords.x,coords.y).Transmuter_calc!=0)
{
Gdx.app.debug(event.getListenerActor().toString(),"Screen coordinates translated to world coordinates: "+ "X: " + coords.x + " Y: " + coords.y);
Vector2 gotomain=AssetLoader.resolveTransmuterMain(level.Grid.GetXY(coords.x,coords.y).Transmuter_calc);
if (gotomain!=null) {
level.Grid.GetXY(coords.x+gotomain.x,coords.y+gotomain.y).Transmuter=null;
Gdx.app.debug(event.getListenerActor().toString(),"transmuter deplacement vers origine:"+String.valueOf(gotomain.x)+","+String.valueOf(gotomain.y)+" coords:"+(coords.x+gotomain.x)+"x"+(coords.y+gotomain.y));
}
level.Grid.tiling_transmuter();
}
level.Grid.GetXY(coords.x,coords.y).Fiber=0;
level.Grid.GetXY(coords.x,coords.y).Copper=false;
level.Grid.tiling_copper();
map.redraw(60);
}
}
else if (selected.getName()=="blank") else if (selected.getName()=="blank")
{ {
Vector2 coords=map.screentoworld(x, y); Vector2 coords=map.screentoworld(x, y);
@ -492,13 +572,26 @@ public class GameScreen implements Screen {
Vector2 coords2=menu.worldtoscreen((int)coords.x,(int)coords.y); Vector2 coords2=menu.worldtoscreen((int)coords.x,(int)coords.y);
menuactor.setBounds(coords2.x, coords2.y, 60, 60); menuactor.setBounds(coords2.x, coords2.y, 60, 60);
selected=menuactor; selected=menuactor;
if (tile==10 || tile==61 || tile==53)
map.fillempty(60); map.fillempty(60);
if (tile==10) if (tile==71)
selected.setName("copper"); selected.setName("copper-pen");
else if (tile==61) if (tile==72)
selected.setName("fiber"); selected.setName("copper-brush");
else if (tile==53) if (tile==73)
selected.setName("copper-eraser");
if (tile==74)
selected.setName("fiber-pen");
if (tile==75)
selected.setName("fiber-brush");
if (tile==76)
selected.setName("fiber-eraser");
if (tile==77)
selected.setName("transmuter-eraser");
if (tile==78)
selected.setName("all-eraser");
if (tile==79)
selected.setName("cleaner");
else if (tile==70)
selected.setName("blank"); selected.setName("blank");
else if (tile>99) { else if (tile>99) {
Transmuter transmuter=AssetLoader.getTransmuter(tile); Transmuter transmuter=AssetLoader.getTransmuter(tile);
@ -539,9 +632,9 @@ public class GameScreen implements Screen {
@Override @Override
public void show() { public void show() {
Gdx.app.log("*****","Affichage du niveau."); Gdx.app.log("*****","Affichage du niveau.");
for (int i=0;i<tocreate2.length;i++) for (int i=0;i<Barre2.length;i++)
table2.addActor(Barre2[i]); table2.addActor(Barre2[i]);
for (int i=0;i<tocreate.length;i++) for (int i=0;i<Barre.length;i++)
table.addActor(Barre[i]); table.addActor(Barre[i]);
stage2.addActor(map); stage2.addActor(map);
stage.addActor(objectives); stage.addActor(objectives);