Implemented replacement blocks

This commit is contained in:
Anuken
2017-09-07 22:14:21 -04:00
parent a5e877028e
commit d53f12aeb9
14 changed files with 47 additions and 15 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="7"
android:versionName="1.1.3" >
android:versionCode="8"
android:versionName="1.1.4" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -17,7 +17,7 @@ public class Inventory{
if(debug){
items.put(Item.stone, 2000);
items.put(Item.iron, 2000);
items.put(Item.iron, 1);
items.put(Item.steel, 2000);
items.put(Item.coal, 2000);
}

View File

@ -337,17 +337,30 @@ public class UI extends SceneModule{
new table(){{
atop();
aleft();
itemtable = new table().top().left().get();
itemtable.background("button");
defaults().size(60).units(Unit.dp);
new button("M", ()->{
});
new button("P", ()->{
});
new button("S", ()->{
});
row();
itemtable = new table("button").end().top().left().colspan(3).fillX().size(-1).get();
get().setVisible(play);
Label fps = new Label("");
fps.update(()->{
fps.setText(Settings.getBool("fps") ? (Gdx.graphics.getFramesPerSecond() + " FPS") : "");
});
Label fps = new Label(()->(Settings.getBool("fps") ? (Gdx.graphics.getFramesPerSecond() + " FPS") : ""));
row();
add(fps);
add(fps).colspan(3).size(-1);
}}.end();
@ -599,13 +612,14 @@ public class UI extends SceneModule{
public void updateItems(){
itemtable.clear();
itemtable.left();
for(Item stack : Inventory.getItemTypes()){
Image image = new Image(Draw.region("icon-" + stack.name()));
Label label = new Label("" + Inventory.getAmount(stack));
label.setFontScale(fontscale*2f);
itemtable.add(image).size(32).units(Unit.dp);
itemtable.add(label);
itemtable.add(label).left();
itemtable.row();
}
}

View File

@ -15,7 +15,7 @@ public class Vars{
//respawn time in frames
public static final float respawnduration = 60*4;
//time between waves in frames
public static final float wavespace = 30*60*(android ? 2 : 1);
public static final float wavespace = 25*60*(android ? 2 : 1);
//how far away from spawn points the player can't place blocks
public static final float enemyspawnspace = 65;
//scale of the font

View File

@ -197,6 +197,11 @@ public class World{
}
Tile tile = tile(x, y);
if(tile.block() != type && ((tile.block().name.contains("wall") && type.name.contains("wall")) ||
(tile.block().name.contains("conveyor") && type.name.contains("conveyor")))){
return true;
}
return tile != null && tile.block() == Blocks.air;
}

View File

@ -22,6 +22,10 @@ public class Bullet extends BulletEntity{
type.draw(this);
}
public float drawSize(){
return 8;
}
@Override
public void update(){

View File

@ -25,7 +25,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
},
sniper = new BulletType(3f, 20){
public void draw(Bullet b){
Draw.color("lightgray");
Draw.color(Color.LIGHT_GRAY);
Draw.rect("bullet", b.x, b.y, b.angle());
Draw.reset();
}

View File

@ -41,6 +41,10 @@ public class Enemy extends DestructibleEntity{
heal();
}
public float drawSize(){
return 12;
}
void move(){
Vector2 vec = Pathfind.find(this);
vec.sub(x, y).setLength(speed);

View File

@ -21,7 +21,7 @@ public enum Recipe{
turret(defense, WeaponBlocks.turret, stack(Item.stone, 6)),
dturret(defense, WeaponBlocks.doubleturret, stack(Item.stone, 12)),
machineturret(defense, WeaponBlocks.machineturret, stack(Item.iron, 15), stack(Item.stone, 20)),
shotgunturret(defense, WeaponBlocks.shotgunturret, stack(Item.iron, 15), stack(Item.iron, 20)),
shotgunturret(defense, WeaponBlocks.shotgunturret, stack(Item.iron, 18), stack(Item.stone, 20)),
flameturret(defense, WeaponBlocks.flameturret, stack(Item.iron, 25), stack(Item.steel, 18)),
sniperturret(defense, WeaponBlocks.sniperturret, stack(Item.iron, 30), stack(Item.steel, 20)),

View File

@ -35,7 +35,7 @@ public class UpgradeDialog extends Dialog{
getButtonTable().addButton("Ok", ()->{
hide();
});
}).size(84, 48).pad(4);
Table weptab = new Table();
weptab.background("button");

View File

@ -32,6 +32,11 @@ public class RepairTurret extends Turret{
}
}
@Override
public void drawPixelOverlay(Tile tile){
}
@Override
public void drawOver(Tile tile){
TurretEntity entity = tile.entity();

Binary file not shown.