Added a bunch more turrets

This commit is contained in:
Anuken
2017-04-29 22:15:41 -04:00
parent 218ba8a942
commit 4c26efaef6
8 changed files with 286 additions and 137 deletions

View File

@@ -6,203 +6,217 @@ filter: Nearest,Nearest
repeat: none
block
rotate: false
xy: 57, 23
xy: 105, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
bullet
rotate: false
xy: 67, 23
xy: 115, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
coal1
rotate: false
xy: 77, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
coal2
rotate: false
xy: 87, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
coal3
rotate: false
xy: 97, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
coaldrill
rotate: false
xy: 107, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
conveyor
rotate: false
xy: 117, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
conveyormove
rotate: false
xy: 127, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
core
rotate: false
xy: 137, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt1
rotate: false
xy: 147, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt2
rotate: false
xy: 157, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt3
rotate: false
xy: 167, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirtblock
rotate: false
xy: 177, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
doubleturret
circle
rotate: false
xy: 1, 1
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
drill
coal1
rotate: false
xy: 187, 23
xy: 125, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
furnace
coal2
rotate: false
xy: 197, 23
xy: 135, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
smelter
coal3
rotate: false
xy: 197, 23
xy: 145, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
grass
coaldrill
rotate: false
xy: 207, 23
xy: 155, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
healturret
conveyor
rotate: false
xy: 165, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
conveyormove
rotate: false
xy: 175, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
core
rotate: false
xy: 185, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt1
rotate: false
xy: 195, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt2
rotate: false
xy: 205, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirt3
rotate: false
xy: 215, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
dirtblock
rotate: false
xy: 225, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
doubleturret
rotate: false
xy: 13, 1
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
icon-coal
drill
rotate: false
xy: 217, 23
xy: 235, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-iron
flameturret
rotate: false
xy: 227, 23
xy: 21, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
furnace
rotate: false
xy: 245, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-steel
smelter
rotate: false
xy: 237, 23
xy: 245, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-stone
rotate: false
xy: 247, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron1
grass
rotate: false
xy: 25, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron2
healturret
rotate: false
xy: 33, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
icon-coal
rotate: false
xy: 25, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron3
icon-iron
rotate: false
xy: 35, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
irondrill
icon-steel
rotate: false
xy: 35, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
ironwall
icon-stone
rotate: false
xy: 45, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron1
rotate: false
xy: 45, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron2
rotate: false
xy: 55, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
iron3
rotate: false
xy: 55, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
irondrill
rotate: false
xy: 65, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
ironwall
rotate: false
xy: 65, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
laser
rotate: false
xy: 55, 7
xy: 135, 9
size: 1, 12
orig: 1, 12
offset: 0, 0
@@ -216,112 +230,126 @@ laserend
index: -1
machineturret
rotate: false
xy: 21, 21
xy: 45, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
mech1
rotate: false
xy: 45, 1
xy: 75, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
player
rotate: false
xy: 58, 13
xy: 75, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
router
rotate: false
xy: 68, 13
xy: 85, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
shadow
rotate: false
xy: 33, 21
xy: 57, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
shotgunturret
rotate: false
xy: 69, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
sniperturret
rotate: false
xy: 81, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
steelconveyor
rotate: false
xy: 78, 13
xy: 85, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
steelconveyormove
rotate: false
xy: 88, 13
xy: 95, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone
rotate: false
xy: 98, 13
xy: 95, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone1
rotate: false
xy: 108, 13
xy: 105, 13
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone2
rotate: false
xy: 118, 13
xy: 105, 3
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone3
rotate: false
xy: 128, 13
xy: 115, 13
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stoneblock
rotate: false
xy: 138, 13
xy: 115, 3
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stonedrill
rotate: false
xy: 148, 13
xy: 125, 13
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stonedrillhead
rotate: false
xy: 148, 13
xy: 125, 13
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stonewall
rotate: false
xy: 158, 13
xy: 125, 3
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
turret
rotate: false
xy: 45, 21
xy: 93, 21
size: 10, 10
orig: 10, 10
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -4,7 +4,6 @@ import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import io.anuke.aabb.Collider;
import io.anuke.moment.entities.Enemy;
import io.anuke.moment.entities.Player;
import io.anuke.moment.resource.Item;
@@ -67,8 +66,7 @@ public class Moment extends ModuleController<Moment>{
items.put(Item.stone, 200);
items.put(Item.iron, 200);
Collider.defaultDrag = 0.2f;
items.put(Item.steel, 200);
player = new Player().add();

View File

@@ -20,6 +20,13 @@ public enum BulletType{
Draw.clear();
}
},
sniper(3f, 17){
public void draw(Bullet b){
Draw.color("light gray");
Draw.rect("bullet", b.x, b.y, b.angle());
Draw.clear();
}
},
small(1.5f, 1){
public void draw(Bullet b){
Draw.color("orange");
@@ -27,6 +34,14 @@ public enum BulletType{
Draw.clear();
}
},
flame(0.6f, 4){
public void draw(Bullet b){
Draw.color(Color.YELLOW, Color.SCARLET, b.time/lifetime);
float size = 6f-b.time/lifetime*5f;
Draw.rect("circle", b.x, b.y, size, size);
Draw.clear();
}
},
shot(2.4f, 2){
{lifetime=40;}
public void draw(Bullet b){

View File

@@ -9,12 +9,16 @@ public enum Recipe{
irondrill(TileType.irondrill, stack(Item.stone, 30)),
coaldrill(TileType.coaldrill, stack(Item.stone, 30), stack(Item.iron, 30)),
conveyor(TileType.conveyor, stack(Item.stone, 1)),
fastconveyor(TileType.steelconveyor, stack(Item.steel, 1)),
router(TileType.router, stack(Item.stone, 3)),
smelter(TileType.smelter, stack(Item.stone, 40), stack(Item.iron, 40)),
healturret(TileType.healturret, stack(Item.iron, 20)),
turret(TileType.turret, stack(Item.stone, 4)),
dturret(TileType.doubleturret, stack(Item.stone, 6)),
machineturret(TileType.machineturret, stack(Item.iron, 8), stack(Item.stone, 6));
machineturret(TileType.machineturret, stack(Item.iron, 10), stack(Item.stone, 6)),
shotgunturret(TileType.shotgunturret, stack(Item.iron, 10), stack(Item.steel, 8)),
flameturret(TileType.flameturret, stack(Item.iron, 12), stack(Item.steel, 12)),
sniperturret(TileType.sniperturret, stack(Item.iron, 15), stack(Item.steel, 20));
public TileType result;
public ItemStack[] requirements;

View File

@@ -33,7 +33,7 @@ public class Generator{
}
if(color == white){
block = TileType.dirtblock;
block = TileType.stoneblock;
}else if(color == blue){

View File

@@ -179,7 +179,7 @@ public enum TileType{
}
public String description(){
return "Moves Items (faster than a normal conveyor!)";
return "Moves Items\nFaster than a normal conveyor";
}
@Override
@@ -273,7 +273,7 @@ public enum TileType{
doubleturret(true, true, false){
{
range = 40;
reload = 10f;
reload = 13f;
bullet = BulletType.stone;
ammo = Item.stone;
health = 50;
@@ -294,11 +294,19 @@ public enum TileType{
public String description(){
return "Shoots things.";
}
@Override
void shoot(Tile tile){
vector.set(4, -2).rotate(tile.entity.rotation);
bullet(tile, tile.entity.rotation);
vector.set(4, 2).rotate(tile.entity.rotation);
bullet(tile, tile.entity.rotation);
}
},
machineturret(true, true, false){
{
range = 65;
reload = 5f;
reload = 7f;
bullet = BulletType.iron;
ammo = Item.iron;
health = 65;
@@ -320,6 +328,91 @@ public enum TileType{
return "Shoots things.";
}
},
flameturret(true, true, false){
{
range = 30f;
reload = 6f;
bullet = BulletType.flame;
ammo = Item.coal;
health = 75;
}
public void update(Tile tile){
updateTurret(tile);
}
public void draw(Tile tile){
Draw.rect("block", tile.worldx(), tile.worldy());
}
public void drawOver(Tile tile){
Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90);
}
public String description(){
return "Burns things.";
}
},
sniperturret(true, true, false){
{
range = 100;
reload = 60f;
bullet = BulletType.sniper;
ammo = Item.steel;
health = 60;
}
public void update(Tile tile){
updateTurret(tile);
}
public void draw(Tile tile){
Draw.rect("block", tile.worldx(), tile.worldy());
}
public void drawOver(Tile tile){
Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90);
}
public String description(){
return "Shoots things.";
}
},
shotgunturret(true, true, false){
{
range = 65;
reload = 40f;
bullet = BulletType.iron;
ammo = Item.iron;
health = 70;
}
public void update(Tile tile){
updateTurret(tile);
}
public void draw(Tile tile){
Draw.rect("block", tile.worldx(), tile.worldy());
}
public void drawOver(Tile tile){
Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90);
}
public String description(){
return "Shoots things.";
}
@Override
void shoot(Tile tile){
vector.set(0, 4).setAngle(tile.entity.rotation);
for(int i = 0; i < 6; i ++)
Timers.run(i, ()->{
bullet(tile, tile.entity.rotation + Mathf.range(6));
});
}
},
healturret(true, true, false){
{
range = 30;
@@ -415,24 +508,34 @@ public enum TileType{
tile.entity.shots += 20;
tile.entity.removeItem(ammo, 1);
}
if(tile.entity.shots > 0){
//TODO readd
//if(tile.entity.shots > 0){
Enemy enemy = findTarget(tile, range);
if(enemy != null){
tile.entity.rotation = MathUtils.lerpAngleDeg(tile.entity.rotation, Angles.predictAngle(tile.worldx(), tile.worldy(), enemy.x, enemy.y, enemy.xvelocity, enemy.yvelocity, bullet.speed - 0.1f), 0.2f);
if(Timers.get(tile, reload)){
new Bullet(bullet, tile.entity, tile.worldx(), tile.worldy(), tile.entity.rotation).add();
shoot(tile);
tile.entity.shots--;
}
}
}
//}
}
void shoot(Tile tile){
vector.set(0, 4).setAngle(tile.entity.rotation);
new Bullet(bullet, tile.entity, tile.worldx()+vector.x, tile.worldy()+vector.y, tile.entity.rotation).add();
}
void bullet(Tile tile, float angle){
new Bullet(bullet, tile.entity, tile.worldx()+vector.x, tile.worldy()+vector.y, angle).add();
}
Enemy findTarget(Tile tile, float range){
Entity closest = null;
float dst = 0;
Array<SolidEntity> array = Entities.getNearby(tile.worldx(), tile.worldy(), 100);
Array<SolidEntity> array = Entities.getNearby(tile.worldx(), tile.worldy(), range*2);
for(Entity e : array){

View File

@@ -11,6 +11,7 @@ public class DesktopLauncher {
config.setTitle("Moment");
config.setMaximized(true);
config.useVsync(false);
config.setWindowedMode(800, 600);
new Lwjgl3Application(new Moment(), config);
}
}