Added new conveyor animation
|
|
@ -176,7 +176,6 @@ project(":core") {
|
|||
}
|
||||
|
||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
core/assets-raw/sprites/blocks/distribution/conveyor-arrow.png
Normal file
|
After Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 195 B |
|
Before Width: | Height: | Size: 195 B |
|
After Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 KiB |
|
|
@ -10,8 +10,8 @@ import io.anuke.mindustry.game.EventType.TileChangeEvent;
|
|||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.game.TeamInfo.TeamData;
|
||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||
import io.anuke.ucore.core.Events;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.Geometry;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.blocks.*;
|
||||
import io.anuke.mindustry.content.blocks.DefenseBlocks;
|
||||
import io.anuke.mindustry.content.blocks.DistributionBlocks;
|
||||
import io.anuke.mindustry.content.blocks.WeaponBlocks;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
|
|
@ -14,7 +16,35 @@ public class Recipes implements ContentList{
|
|||
@Override
|
||||
public void load (){
|
||||
new Recipe(defense, DefenseBlocks.ironwall, new ItemStack(Items.iron, 12));
|
||||
new Recipe(defense, DefenseBlocks.ironwalllarge, new ItemStack(Items.iron, 12));
|
||||
new Recipe(defense, DefenseBlocks.ironwalllarge, new ItemStack(Items.iron, 12*4));
|
||||
|
||||
new Recipe(weapon, WeaponBlocks.duo, new ItemStack(Items.iron, 12));
|
||||
new Recipe(weapon, WeaponBlocks.scatter, new ItemStack(Items.iron, 8), new ItemStack(Items.lead, 6));
|
||||
new Recipe(weapon, WeaponBlocks.scorch, new ItemStack(Items.iron, 12), new ItemStack(Items.lead, 8));
|
||||
new Recipe(weapon, WeaponBlocks.hail, new ItemStack(Items.iron, 12), new ItemStack(Items.lead, 12), new ItemStack(Items.steel, 6));
|
||||
|
||||
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.iron, 1));
|
||||
new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.iron, 2), new ItemStack(Items.titanium, 1));
|
||||
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.iron, 2), new ItemStack(Items.lead, 4));
|
||||
new Recipe(distribution, DistributionBlocks.multiplexer, new ItemStack(Items.iron, 8), new ItemStack(Items.lead, 8));
|
||||
new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.iron, 2));
|
||||
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.iron, 4), new ItemStack(Items.lead, 4));
|
||||
new Recipe(distribution, DistributionBlocks.splitter, new ItemStack(Items.iron, 2), new ItemStack(Items.lead, 4));
|
||||
new Recipe(distribution, DistributionBlocks.overflowgate, new ItemStack(Items.steel, 4));
|
||||
|
||||
//new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.steel, 50));
|
||||
//new Recipe(distribution, StorageBlocks.core, new ItemStack(Items.steel, 50));
|
||||
//new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.steel, 5));
|
||||
//new Recipe(distribution, StorageBlocks.sortedunloader, new ItemStack(Items.steel, 5));
|
||||
|
||||
new Recipe(distribution, DistributionBlocks.bridgeconveyor, new ItemStack(Items.steel, 8), new ItemStack(Items.iron, 8));
|
||||
|
||||
//new Recipe(distribution, DistributionBlocks.laserconveyor, new ItemStack(Items.steel, 5));
|
||||
//new Recipe(distribution, DistributionBlocks.massdriver, new ItemStack(Items.steel, 1));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
new Recipe(defense, DefenseBlocks.steelwall, new ItemStack(Items.steel, 12));
|
||||
new Recipe(defense, DefenseBlocks.titaniumwall, new ItemStack(Items.titanium, 12));
|
||||
new Recipe(defense, DefenseBlocks.diriumwall, new ItemStack(Items.surgealloy, 12));
|
||||
|
|
@ -28,27 +58,9 @@ public class Recipes implements ContentList{
|
|||
new Recipe(defense, DefenseBlocks.phasewall, new ItemStack(Items.titanium, 1));
|
||||
new Recipe(defense, DefenseBlocks.phasewalllarge, new ItemStack(Items.titanium, 1));
|
||||
|
||||
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.iron, 1));
|
||||
new Recipe(distribution, DistributionBlocks.steelconveyor, new ItemStack(Items.steel, 1));
|
||||
new Recipe(distribution, DistributionBlocks.pulseconveyor, new ItemStack(Items.surgealloy, 1));
|
||||
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.iron, 2));
|
||||
new Recipe(distribution, DistributionBlocks.multiplexer, new ItemStack(Items.iron, 8));
|
||||
new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.iron, 2));
|
||||
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.steel, 2));
|
||||
new Recipe(distribution, DistributionBlocks.splitter, new ItemStack(Items.steel, 1));
|
||||
new Recipe(distribution, DistributionBlocks.overflowgate, new ItemStack(Items.steel, 1));
|
||||
new Recipe(distribution, StorageBlocks.vault, new ItemStack(Items.steel, 50));
|
||||
new Recipe(distribution, StorageBlocks.core, new ItemStack(Items.steel, 50));
|
||||
new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.steel, 5));
|
||||
new Recipe(distribution, StorageBlocks.sortedunloader, new ItemStack(Items.steel, 5));
|
||||
new Recipe(distribution, DistributionBlocks.bridgeconveyor, new ItemStack(Items.steel, 5));
|
||||
new Recipe(distribution, DistributionBlocks.laserconveyor, new ItemStack(Items.steel, 5));
|
||||
new Recipe(distribution, DistributionBlocks.massdriver, new ItemStack(Items.steel, 1));
|
||||
|
||||
new Recipe(weapon, WeaponBlocks.duo, new ItemStack(Items.iron, 1));
|
||||
new Recipe(weapon, WeaponBlocks.scatter, new ItemStack(Items.iron, 1));
|
||||
new Recipe(weapon, WeaponBlocks.scorch, new ItemStack(Items.iron, 1));
|
||||
new Recipe(weapon, WeaponBlocks.hail, new ItemStack(Items.iron, 1));
|
||||
|
||||
|
||||
new Recipe(weapon, WeaponBlocks.wave, new ItemStack(Items.iron, 1));
|
||||
new Recipe(weapon, WeaponBlocks.lancer, new ItemStack(Items.iron, 1));
|
||||
new Recipe(weapon, WeaponBlocks.arc, new ItemStack(Items.iron, 1));
|
||||
|
|
@ -139,7 +151,7 @@ public class Recipes implements ContentList{
|
|||
new Recipe(units, DebugBlocks.itemVoid, new ItemStack(Items.steel, 10)).setDebug();
|
||||
new Recipe(units, DebugBlocks.liquidSource, new ItemStack(Items.steel, 10)).setDebug();
|
||||
new Recipe(units, DebugBlocks.powerVoid, new ItemStack(Items.steel, 10)).setDebug();
|
||||
new Recipe(units, DebugBlocks.powerInfinite, new ItemStack(Items.steel, 10), new ItemStack(Items.surgealloy, 5)).setDebug();
|
||||
new Recipe(units, DebugBlocks.powerInfinite, new ItemStack(Items.steel, 10), new ItemStack(Items.surgealloy, 5)).setDebug();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,25 +5,20 @@ import io.anuke.mindustry.world.Block;
|
|||
import io.anuke.mindustry.world.blocks.distribution.*;
|
||||
|
||||
public class DistributionBlocks extends BlockList implements ContentList{
|
||||
public static Block conveyor, steelconveyor, pulseconveyor, router, multiplexer, junction,
|
||||
public static Block conveyor, titaniumconveyor, router, multiplexer, junction,
|
||||
bridgeconveyor, laserconveyor, sorter, splitter, overflowgate, massdriver;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
conveyor = new Conveyor("conveyor") {{
|
||||
health = 40;
|
||||
speed = 0.02f;
|
||||
health = 45;
|
||||
speed = 0.03f;
|
||||
}};
|
||||
|
||||
steelconveyor = new Conveyor("steelconveyor") {{
|
||||
health = 55;
|
||||
speed = 0.04f;
|
||||
}};
|
||||
|
||||
pulseconveyor = new Conveyor("poweredconveyor") {{
|
||||
health = 75;
|
||||
speed = 0.09f;
|
||||
titaniumconveyor = new Conveyor("titanium-conveyor") {{
|
||||
health = 65;
|
||||
speed = 0.07f;
|
||||
}};
|
||||
|
||||
router = new Router("router");
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ public class Control extends Module{
|
|||
Core.atlas.setErrorRegion("error");
|
||||
ContentLoader.initialize(Content::load);
|
||||
|
||||
db.load();
|
||||
//TODO load database
|
||||
//not loaded currently for testing
|
||||
//db.load();
|
||||
|
||||
gdxInput = Gdx.input;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package io.anuke.mindustry.core;
|
||||
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.game.EventType.GameOverEvent;
|
||||
|
|
@ -46,16 +47,22 @@ public class Logic extends Module {
|
|||
state.wavetime = wavespace * state.difficulty.timeScaling * 2;
|
||||
|
||||
//fill inventory with items for debugging
|
||||
for(TeamData team : state.teams.getTeams()) {
|
||||
|
||||
for (TeamData team : state.teams.getTeams()) {
|
||||
for (Tile tile : team.cores) {
|
||||
for (Item item : Item.all()) {
|
||||
if (item.type == ItemType.material) {
|
||||
tile.entity.items.addItem(item, 1000);
|
||||
if(debug) {
|
||||
for (Item item : Item.all()) {
|
||||
if (item.type == ItemType.material) {
|
||||
tile.entity.items.addItem(item, 1000);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
tile.entity.items.addItem(Items.iron, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Events.fire(PlayEvent.class);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class BlockInventoryFragment implements Fragment {
|
|||
|
||||
public void showFor(Tile t){
|
||||
this.tile = t.target();
|
||||
if(tile == null || tile.entity == null || !tile.block().isAccessible()) return;
|
||||
if(tile == null || tile.entity == null || !tile.block().isAccessible() || tile.entity.items.totalItems() == 0) return;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package io.anuke.mindustry.world.blocks.distribution;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import com.badlogic.gdx.utils.LongArray;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
|
|
@ -32,6 +34,8 @@ public class Conveyor extends Block{
|
|||
|
||||
private final Translator tr1 = new Translator();
|
||||
private final Translator tr2 = new Translator();
|
||||
private final TextureRegion region1 = new TextureRegion();
|
||||
private final TextureRegion region2 = new TextureRegion();
|
||||
|
||||
protected float speed = 0f;
|
||||
protected float carryCapacity = 8f;
|
||||
|
|
@ -60,9 +64,27 @@ public class Conveyor extends Block{
|
|||
public void draw(Tile tile){
|
||||
byte rotation = tile.getRotation();
|
||||
|
||||
Draw.rect(name() +
|
||||
(Timers.time() % ((20 / 100f) / speed) < (10 / 100f) / speed && acceptItem(Items.stone, tile, null) ? "" : "move"),
|
||||
tile.worldx(), tile.worldy(), rotation * 90);
|
||||
GridPoint2 point = Geometry.d4[rotation];
|
||||
|
||||
int offset = acceptItem(Items.stone, tile, null) ? (int)((Timers.time()/4f)%8) : 0;
|
||||
TextureRegion region = Draw.region(name);
|
||||
|
||||
region1.setRegion(region, 0, 0, region.getRegionWidth() - offset, region.getRegionHeight());
|
||||
region2.setRegion(region, region.getRegionWidth() - offset, 0, offset, region.getRegionHeight());
|
||||
|
||||
float x = tile.drawx(), y = tile.drawy();
|
||||
|
||||
if(offset % 2 == 1){
|
||||
if(point.x < 0) x += 0.5f;
|
||||
if(point.y < 0) y += 0.5f;
|
||||
}
|
||||
|
||||
Draw.rect(region1,
|
||||
x + (point.x * (tilesize/2f - region1.getRegionWidth()/2f)),
|
||||
y + (point.y * (tilesize/2f - region1.getRegionWidth()/2f)), rotation * 90);
|
||||
Draw.rect(region2,
|
||||
x - (point.x * (tilesize/2f - region2.getRegionWidth()/2f)),
|
||||
y - (point.y * (tilesize/2f - region2.getRegionWidth()/2f)), rotation * 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||