Moved unit-related classes, added base flying types
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 281 B |
Binary file not shown.
|
Before Width: | Height: | Size: 514 B |
Binary file not shown.
|
Before Width: | Height: | Size: 250 B |
Binary file not shown.
|
Before Width: | Height: | Size: 603 B |
@@ -1,5 +1,5 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Apr 21 18:47:28 EDT 2018
|
#Sun Apr 22 16:19:48 EDT 2018
|
||||||
version=pre-alpha
|
version=pre-alpha
|
||||||
androidBuildCode=1087
|
androidBuildCode=1087
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
|
|||||||
6
core/src/io/anuke/mindustry/ai/BlockIndexer.java
Normal file
6
core/src/io/anuke/mindustry/ai/BlockIndexer.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package io.anuke.mindustry.ai;
|
||||||
|
|
||||||
|
/**Class used for indexing special target blocks for AI.
|
||||||
|
* TODO implement this class*/
|
||||||
|
public class BlockIndexer {
|
||||||
|
}
|
||||||
@@ -114,7 +114,10 @@ public class Recipes {
|
|||||||
new Recipe(liquid, LiquidBlocks.pump, stack(Items.steel, 10)),
|
new Recipe(liquid, LiquidBlocks.pump, stack(Items.steel, 10)),
|
||||||
new Recipe(liquid, LiquidBlocks.fluxpump, stack(Items.steel, 10), stack(Items.densealloy, 5)),
|
new Recipe(liquid, LiquidBlocks.fluxpump, stack(Items.steel, 10), stack(Items.densealloy, 5)),
|
||||||
|
|
||||||
new Recipe(units, UnitBlocks.flierFactory, stack(Items.steel, 10)),
|
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
|
||||||
|
new Recipe(units, UnitBlocks.vtolFactory, stack(Items.steel, 10)),
|
||||||
|
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
|
||||||
|
new Recipe(units, UnitBlocks.droneFactory, stack(Items.steel, 10)),
|
||||||
new Recipe(units, UnitBlocks.walkerFactory, stack(Items.steel, 10)),
|
new Recipe(units, UnitBlocks.walkerFactory, stack(Items.steel, 10)),
|
||||||
|
|
||||||
new Recipe(units, DebugBlocks.itemSource, stack(Items.steel, 10)).setDebug(),
|
new Recipe(units, DebugBlocks.itemSource, stack(Items.steel, 10)).setDebug(),
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.units.UnitType;
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
import io.anuke.mindustry.entities.units.types.Flier;
|
import io.anuke.mindustry.entities.units.types.Vtol;
|
||||||
import io.anuke.mindustry.entities.units.types.Scout;
|
import io.anuke.mindustry.entities.units.types.Scout;
|
||||||
|
|
||||||
public class UnitTypes {
|
public class UnitTypes {
|
||||||
public static final UnitType
|
public static final UnitType
|
||||||
|
|
||||||
|
drone = new Vtol(),
|
||||||
scout = new Scout(),
|
scout = new Scout(),
|
||||||
flier = new Flier();
|
vtol = new Vtol();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,22 @@ import io.anuke.mindustry.content.Items;
|
|||||||
import io.anuke.mindustry.content.UnitTypes;
|
import io.anuke.mindustry.content.UnitTypes;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.UnitFactory;
|
import io.anuke.mindustry.world.blocks.types.units.UnitFactory;
|
||||||
|
|
||||||
public class UnitBlocks {
|
public class UnitBlocks {
|
||||||
public static final Block
|
public static final Block
|
||||||
|
|
||||||
flierFactory = new UnitFactory("flierfactory"){{
|
droneFactory = new UnitFactory("dronefactory"){{
|
||||||
type = UnitTypes.flier;
|
type = UnitTypes.drone;
|
||||||
|
produceTime = 200;
|
||||||
|
size = 2;
|
||||||
|
requirements = new ItemStack[]{
|
||||||
|
new ItemStack(Items.stone, 5)
|
||||||
|
};
|
||||||
|
}},
|
||||||
|
|
||||||
|
vtolFactory = new UnitFactory("vtolfactory"){{
|
||||||
|
type = UnitTypes.vtol;
|
||||||
produceTime = 200;
|
produceTime = 200;
|
||||||
size = 2;
|
size = 2;
|
||||||
requirements = new ItemStack[]{
|
requirements = new ItemStack[]{
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class TurretBullets {
|
|||||||
hiteffect = BulletFx.hitLancer;
|
hiteffect = BulletFx.hitLancer;
|
||||||
despawneffect = Fx.none;
|
despawneffect = Fx.none;
|
||||||
hitsize = 4;
|
hitsize = 4;
|
||||||
lifetime = 20f;
|
lifetime = 16f;
|
||||||
pierce = true;
|
pierce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,12 +134,15 @@ public class TurretBullets {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), length);
|
float f = Mathf.curve(b.fin(), 0f, 0.2f);
|
||||||
|
float baseLen = length * f;
|
||||||
|
|
||||||
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
||||||
for(int s = 0; s < 3; s ++) {
|
for(int s = 0; s < 3; s ++) {
|
||||||
Draw.color(colors[s]);
|
Draw.color(colors[s]);
|
||||||
for (int i = 0; i < tscales.length; i++) {
|
for (int i = 0; i < tscales.length; i++) {
|
||||||
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
|
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), length * lenscales[i]);
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|||||||
10
core/src/io/anuke/mindustry/entities/units/types/Bomber.java
Normal file
10
core/src/io/anuke/mindustry/entities/units/types/Bomber.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||||
|
|
||||||
|
public class Bomber extends FlyingUnitType {
|
||||||
|
|
||||||
|
public Bomber(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||||
|
|
||||||
|
public class Cruiser extends FlyingUnitType {
|
||||||
|
|
||||||
|
public Cruiser(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||||
|
|
||||||
|
public class Reaper extends FlyingUnitType {
|
||||||
|
public Reaper(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||||
|
|
||||||
|
public class RepairDrone extends FlyingUnitType {
|
||||||
|
|
||||||
|
public RepairDrone(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,9 +2,9 @@ package io.anuke.mindustry.entities.units.types;
|
|||||||
|
|
||||||
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
import io.anuke.mindustry.entities.units.FlyingUnitType;
|
||||||
|
|
||||||
public class Flier extends FlyingUnitType {
|
public class Vtol extends FlyingUnitType {
|
||||||
|
|
||||||
public Flier(){
|
public Vtol(){
|
||||||
super("flier");
|
super("flier");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,11 +7,11 @@ import io.anuke.mindustry.game.Team;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.StaticBlock;
|
import io.anuke.mindustry.world.blocks.types.StaticBlock;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.Turret;
|
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -230,8 +230,7 @@ public class BlockRenderer{
|
|||||||
if((storeX == drawx - halfBlockWidth || storeX == drawx + halfBlockWidth || storeY == drawy - halfBlockHeight || storeY == drawy + halfBlockHeight) &&
|
if((storeX == drawx - halfBlockWidth || storeX == drawx + halfBlockWidth || storeY == drawy - halfBlockHeight || storeY == drawy + halfBlockHeight) &&
|
||||||
((tiley - control.input().getBlockY()) % block.size != 0 || (tilex - control.input().getBlockX()) % block.size != 0)) {
|
((tiley - control.input().getBlockY()) % block.size != 0 || (tilex - control.input().getBlockX()) % block.size != 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}else{
|
||||||
else {
|
|
||||||
storeX = drawx;
|
storeX = drawx;
|
||||||
storeY = drawy;
|
storeY = drawy;
|
||||||
}
|
}
|
||||||
@@ -241,14 +240,6 @@ public class BlockRenderer{
|
|||||||
Draw.color(Color.WHITE);
|
Draw.color(Color.WHITE);
|
||||||
Draw.alpha(opacity);
|
Draw.alpha(opacity);
|
||||||
|
|
||||||
if(block instanceof Turret) {
|
|
||||||
if (block.isMultiblock()) {
|
|
||||||
Draw.rect("block-" + block.size + "x" + block.size, drawx, drawy);
|
|
||||||
} else {
|
|
||||||
Draw.rect("block", drawx, drawy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
drawPreview(block, drawx, drawy, rotation, opacity);
|
drawPreview(block, drawx, drawy, rotation, opacity);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.types.units;
|
||||||
|
|
||||||
|
public class ResupplyPoint {
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package io.anuke.mindustry.world.blocks.types.production;
|
package io.anuke.mindustry.world.blocks.types.units;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Colors;
|
import com.badlogic.gdx.graphics.Colors;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.types.units;
|
||||||
|
|
||||||
|
public class UnloadPoint {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user