diff --git a/build.gradle b/build.gradle index 9e76f6d525..bc43fef102 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,7 @@ project(":core") { dependencies { compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" - //compile fileTree(dir: '../core/lib', include: '*.jar') + compile fileTree(dir: '../core/lib', include: '*.jar') } } diff --git a/core/assets/sprites/conveyor.png b/core/assets/sprites/conveyor.png new file mode 100644 index 0000000000..4432f5b42e Binary files /dev/null and b/core/assets/sprites/conveyor.png differ diff --git a/core/assets/sprites/conveyort.png b/core/assets/sprites/conveyort.png new file mode 100644 index 0000000000..afb9ebd8c7 Binary files /dev/null and b/core/assets/sprites/conveyort.png differ diff --git a/core/lib/ucore.jar b/core/lib/ucore.jar index 399c58b379..ca49b4c0d6 100644 Binary files a/core/lib/ucore.jar and b/core/lib/ucore.jar differ diff --git a/core/src/io/anuke/moment/Control.java b/core/src/io/anuke/moment/Control.java index 2bfd74f965..b55590a45c 100644 --- a/core/src/io/anuke/moment/Control.java +++ b/core/src/io/anuke/moment/Control.java @@ -12,8 +12,8 @@ import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; +import io.anuke.gif.GifRecorder; import io.anuke.moment.ai.Pathfind; -import io.anuke.moment.entities.Enemy; import io.anuke.moment.entities.TileEntity; import io.anuke.moment.resource.ItemStack; import io.anuke.moment.world.Tile; @@ -29,7 +29,7 @@ import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Timers; public class Control extends RendererModule{ - //GifRecorder recorder = new GifRecorder(batch); + GifRecorder recorder = new GifRecorder(batch); int rangex = 10, rangey = 10; float breaktime = 0; float breakdur = 50; @@ -173,9 +173,9 @@ public class Control extends RendererModule{ } //TODO - if(UInput.keyUp(Keys.G)){ - new Enemy(0).set(main.player.x, main.player.y).add(); - } + //if(UInput.keyUp(Keys.G)){ + // new Enemy(0).set(main.player.x, main.player.y).add(); + //} //new FlameEnemy(0).set(main.player.x, main.player.y).add(); if(UInput.buttonUp(Buttons.LEFT) && main.recipe != null && validPlace(tilex(), tiley(), main.recipe.result) && !get(UI.class).hasMouse()){ @@ -218,6 +218,7 @@ public class Control extends RendererModule{ tile.setBlock(TileType.air); Pathfind.updatePath(); breaktime = 0f; + USound.play("break"); } }else{ breaktime = 0f; @@ -289,7 +290,7 @@ public class Control extends RendererModule{ drawDefault(); - //recorder.update(); + recorder.update(); } @Override diff --git a/core/src/io/anuke/moment/Moment.java b/core/src/io/anuke/moment/Moment.java index fbd71f8abe..7436ad0a55 100644 --- a/core/src/io/anuke/moment/Moment.java +++ b/core/src/io/anuke/moment/Moment.java @@ -12,7 +12,9 @@ import io.anuke.moment.resource.Recipe; import io.anuke.moment.world.Generator; import io.anuke.moment.world.Tile; import io.anuke.moment.world.TileType; -import io.anuke.ucore.core.*; +import io.anuke.ucore.core.KeyBinds; +import io.anuke.ucore.core.Settings; +import io.anuke.ucore.core.USound; import io.anuke.ucore.entities.Effects; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.modules.ModuleController; @@ -85,13 +87,13 @@ public class Moment extends ModuleController{ if(!playing || paused) return; - if(UInput.keyUp(Keys.Q)) - System.out.println("Enemies: " + Enemy.amount + " Wavetime: " + wavetime + " Wave: " + wave + " Wavespace: " + wavespace); + //if(UInput.keyUp(Keys.Q)) + // System.out.println("Enemies: " + Enemy.amount + " Wavetime: " + wavetime + " Wave: " + wave + " Wavespace: " + wavespace); if(Enemy.amount <= 0) wavetime -= delta(); - if(wavetime <= 0){ + if(wavetime <= 0/* || UInput.keyUp(Keys.Q)*/){ runWave(); } } @@ -125,9 +127,9 @@ public class Moment extends ModuleController{ items.put(Item.stone, 20); - //items.put(Item.stone, 200); - //items.put(Item.iron, 200); - //items.put(Item.steel, 200); + items.put(Item.stone, 2000); + items.put(Item.iron, 2000); + items.put(Item.steel, 2000); if(get(UI.class).about != null) get(UI.class).updateItems(); diff --git a/core/src/io/anuke/moment/UI.java b/core/src/io/anuke/moment/UI.java index c2a53e618f..78d222964c 100644 --- a/core/src/io/anuke/moment/UI.java +++ b/core/src/io/anuke/moment/UI.java @@ -6,6 +6,9 @@ import java.util.function.BooleanSupplier; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.Texture.TextureWrap; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.utils.Array; import io.anuke.moment.entities.Enemy; @@ -21,12 +24,14 @@ import io.anuke.ucore.scene.ui.*; import io.anuke.ucore.scene.ui.layout.Stack; import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Timers; public class UI extends SceneModule{ Table itemtable; PrefsDialog prefs; KeybindDialog keys; Dialog about, menu, restart, tutorial; + Texture conveyor = new Texture("sprites/conveyor.png"), conveyort = new Texture("sprites/conveyort.png"); BooleanSupplier play = () -> { return main.playing; @@ -42,18 +47,36 @@ public class UI extends SceneModule{ Dialog.closePadR = -1; Dialog.closePadT = 4; + conveyor.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); + conveyort.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); } void drawBackground(){ + Batch batch = scene.getBatch(); Draw.color(); - float w = gwidth(); - float h = gheight(); + int w = gwidth(); + int h = gheight(); + + batch.draw(conveyor, 0, 0, (int)Timers.time(), 0, w, h); + + int tw = w/64+1;//, th = h/64+1; + + for(int x = 0; x < tw; x ++){ + batch.draw(conveyort, x*64, 0, 0, (int)Timers.time(), 32, h); + } + Draw.tscl(1.5f); + + Draw.text("[DARK_GRAY]-( Mindustry )-", w/2, h-16); Draw.text("[#f1de60]-( Mindustry )-", w/2, h-10); Draw.tscl(0.5f); + + + + //Draw.rect("conveyor", w/2, h/2, 1000, 1000); } @@ -306,10 +329,11 @@ public class UI extends SceneModule{ table.add().size(size); } - //TODO rows - //if((int)((float)recipes.size/rows+1) == 2){ - // table.row(); - //} + + if(sec == Section.distribution){ + table.row(); + table.add().size(size); + } table.setVisible(()->{ return button.isChecked();