More fixes

This commit is contained in:
Anuken 2017-04-30 20:11:15 -04:00
parent 42c2ea68f1
commit f5e30f53e0
11 changed files with 42 additions and 33 deletions

BIN
core/assets/music/place.wav Normal file

Binary file not shown.

BIN
core/assets/music/shoot.wav Normal file

Binary file not shown.

View File

@ -165,13 +165,6 @@ grass
orig: 8, 8 orig: 8, 8
offset: 0, 0 offset: 0, 0
index: -1 index: -1
healturret
rotate: false
xy: 49, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
icon-coal icon-coal
rotate: false rotate: false
xy: 247, 23 xy: 247, 23
@ -251,7 +244,7 @@ laserend
index: -1 index: -1
machineturret machineturret
rotate: false rotate: false
xy: 49, 9 xy: 49, 21
size: 10, 10 size: 10, 10
orig: 10, 10 orig: 10, 10
offset: 0, 0 offset: 0, 0
@ -263,9 +256,9 @@ mech1
orig: 8, 8 orig: 8, 8
offset: 0, 0 offset: 0, 0
index: -1 index: -1
megahealturret megarepairturret
rotate: false rotate: false
xy: 61, 21 xy: 49, 9
size: 10, 10 size: 10, 10
orig: 10, 10 orig: 10, 10
offset: 0, 0 offset: 0, 0
@ -277,6 +270,13 @@ player
orig: 8, 8 orig: 8, 8
offset: 0, 0 offset: 0, 0
index: -1 index: -1
repairturret
rotate: false
xy: 61, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
router router
rotate: false rotate: false
xy: 198, 13 xy: 198, 13

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -12,7 +12,6 @@ import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector2;
import io.anuke.gif.GifRecorder;
import io.anuke.moment.ai.Pathfind; import io.anuke.moment.ai.Pathfind;
import io.anuke.moment.entities.TileEntity; import io.anuke.moment.entities.TileEntity;
import io.anuke.moment.resource.ItemStack; import io.anuke.moment.resource.ItemStack;
@ -29,7 +28,7 @@ import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Timers; import io.anuke.ucore.util.Timers;
public class Control extends RendererModule<Moment>{ public class Control extends RendererModule<Moment>{
GifRecorder recorder = new GifRecorder(batch); //GifRecorder recorder = new GifRecorder(batch);
int rangex = 10, rangey = 10; int rangex = 10, rangey = 10;
float breaktime = 0; float breaktime = 0;
float breakdur = 50; float breakdur = 50;
@ -290,7 +289,7 @@ public class Control extends RendererModule<Moment>{
drawDefault(); drawDefault();
recorder.update(); //recorder.update();
} }
@Override @Override
@ -431,7 +430,7 @@ public class Control extends RendererModule<Moment>{
buffers.remove("shadow"); buffers.remove("shadow");
buffers.add("shadow", (int) (Gdx.graphics.getWidth() / cameraScale), (int) (Gdx.graphics.getHeight() / cameraScale)); buffers.add("shadow", (int) (Gdx.graphics.getWidth() / cameraScale), (int) (Gdx.graphics.getHeight() / cameraScale));
rangex = (int) (width / tilesize / cameraScale/2)+1; rangex = (int) (width / tilesize / cameraScale/2)+2;
rangey = (int) (height / tilesize / cameraScale/2)+1; rangey = (int) (height / tilesize / cameraScale/2)+2;
} }
} }

View File

@ -34,7 +34,7 @@ public class Moment extends ModuleController<Moment>{
public float respawntime = 60*5; public float respawntime = 60*5;
public int wave = 1; public int wave = 1;
public float wavespace = 20*60; public float wavespace = 35*60;
public float wavetime; public float wavetime;
public float spawnspace = 65; public float spawnspace = 65;
public Tile core; public Tile core;
@ -90,6 +90,7 @@ public class Moment extends ModuleController<Moment>{
//if(UInput.keyUp(Keys.Q)) //if(UInput.keyUp(Keys.Q))
// System.out.println("Enemies: " + Enemy.amount + " Wavetime: " + wavetime + " Wave: " + wave + " Wavespace: " + wavespace); // System.out.println("Enemies: " + Enemy.amount + " Wavetime: " + wavetime + " Wave: " + wave + " Wavespace: " + wavespace);
//System.out.println(Enemy.amount);
if(Enemy.amount <= 0) if(Enemy.amount <= 0)
wavetime -= delta(); wavetime -= delta();
@ -123,13 +124,13 @@ public class Moment extends ModuleController<Moment>{
generate(); generate();
player.x = core.worldx(); player.x = core.worldx();
player.y = core.worldy()+10; player.y = core.worldy()-8;
items.put(Item.stone, 20); items.put(Item.stone, 20);
items.put(Item.stone, 2000); //items.put(Item.stone, 2000);
items.put(Item.iron, 2000); //items.put(Item.iron, 2000);
items.put(Item.steel, 2000); //items.put(Item.steel, 2000);
if(get(UI.class).about != null) if(get(UI.class).about != null)
get(UI.class).updateItems(); get(UI.class).updateItems();
@ -160,19 +161,20 @@ public class Moment extends ModuleController<Moment>{
int x = core.x, y = core.y; int x = core.x, y = core.y;
set(x, y-1, TileType.conveyor, 1); set(x, y-1, TileType.conveyor, 1);
set(x, y-2, TileType.router, 0); set(x, y-2, TileType.conveyor, 1);
set(x, y-3, TileType.conveyor, 1); set(x, y-3, TileType.conveyor, 1);
set(x, y-4, TileType.stonedrill, 0); set(x, y-4, TileType.stonedrill, 0);
//just in case //just in case
tiles[x][y-4].setFloor(TileType.stone); tiles[x][y-4].setFloor(TileType.stone);
set(x+1, y-2, TileType.conveyor, 0);
set(x+2, y-2, TileType.conveyor, 1); tiles[x+2][y-2].setFloor(TileType.stone);
set(x+2, y-2, TileType.stonedrill, 0);
set(x+2, y-1, TileType.conveyor, 1); set(x+2, y-1, TileType.conveyor, 1);
set(x+2, y, TileType.turret, 0); set(x+2, y, TileType.turret, 0);
set(x-1, y-2, TileType.conveyor, 2); tiles[x-2][y-2].setFloor(TileType.stone);
set(x-2, y-2, TileType.conveyor, 1); set(x-2, y-2, TileType.stonedrill, 0);
set(x-2, y-1, TileType.conveyor, 1); set(x-2, y-1, TileType.conveyor, 1);
set(x-2, y, TileType.turret, 0); set(x-2, y, TileType.turret, 0);
} }

View File

@ -169,12 +169,14 @@ public class UI extends SceneModule<Moment>{
tutorial.content().add( tutorial.content().add(
"[GREEN]Default Controls:[WHITE]\n[YELLOW][[WASD][] to move, [YELLOW][[R][] to rotate blocks." "[GREEN]Default Controls:[WHITE]\n[YELLOW][[WASD][] to move, [YELLOW][[R][] to rotate blocks."
+ "\n[YELLOW][[R-MOUSE][] to destroy blocks, [YELLOW][[L-MOUSE][] to place them." + "\nHold [YELLOW][[R-MOUSE][] to destroy blocks, click [YELLOW][[L-MOUSE][] to place them."
+ "\n[YELLOW][[L-MOUSE][] to shoot." + "\n[YELLOW][[L-MOUSE][] to shoot."
+ "\n\n[GOLD]Every 20 seconds, a new wave will appear." + "\n\n[GOLD]Every 20 seconds, a new wave will appear."
+ "\nBuild turrets to defend the core." + "\nBuild turrets to defend the core."
+ "\nIf the core is destroyed, you lose the game." + "\nIf the core is destroyed, you lose the game."
+ "\n[LIME]To collect building resources, \nmove them into the core with conveyors." + "\n[LIME]To collect building resources, \nmove them into the core with conveyors."
+ "\n[LIME]Place [ORANGE]drills[] on the right material,\nthey will automatically mine material\nand dump it to nearby conveyors or turrets."
+ "\n\n[SCARLET]To produce steel, feed coal and iron into a smelter."
); );
tutorial.content().pad(8); tutorial.content().pad(8);

View File

@ -47,6 +47,12 @@ public class Enemy extends DestructibleEntity{
//if(Timers.get(this, 10)) //if(Timers.get(this, 10))
target = TileType.findTileTarget(x, y, null, range, false); target = TileType.findTileTarget(x, y, null, range, false);
//no tile found
if(target == null)
target = Entities.getClosest(x, y, range, e->{
return e instanceof Player;
});
if(target != null){ if(target != null){
if(Timers.get(this, reload)){ if(Timers.get(this, reload)){
shoot(); shoot();

View File

@ -36,7 +36,7 @@ public class Player extends DestructibleEntity{
Effects.effect("respawn", this); Effects.effect("respawn", this);
Timers.run(Moment.i.respawntime, ()->{ Timers.run(Moment.i.respawntime, ()->{
set(Moment.i.core.worldx(), Moment.i.core.worldy()+8); set(Moment.i.core.worldx(), Moment.i.core.worldy()-8);
heal(); heal();
add(); add();
}); });
@ -53,7 +53,7 @@ public class Player extends DestructibleEntity{
@Override @Override
public void update(){ public void update(){
if(health < maxhealth && Timers.get(this, 30)) if(health < maxhealth && Timers.get(this, 50))
health ++; health ++;
vector.set(0, 0); vector.set(0, 0);

View File

@ -22,8 +22,8 @@ public enum Recipe{
flameturret(defense, TileType.flameturret, stack(Item.iron, 25), stack(Item.steel, 18)), flameturret(defense, TileType.flameturret, stack(Item.iron, 25), stack(Item.steel, 18)),
sniperturret(defense, TileType.sniperturret, stack(Item.iron, 30), stack(Item.steel, 20)), sniperturret(defense, TileType.sniperturret, stack(Item.iron, 30), stack(Item.steel, 20)),
healturret(defense, TileType.healturret, stack(Item.iron, 40)), healturret(defense, TileType.repairturret, stack(Item.iron, 40)),
megahealturret(defense, TileType.megahealturret, stack(Item.iron, 30), stack(Item.steel, 40)), megahealturret(defense, TileType.megarepairturret, stack(Item.iron, 30), stack(Item.steel, 40)),
drill(production, TileType.stonedrill, stack(Item.stone, 6)), drill(production, TileType.stonedrill, stack(Item.stone, 6)),
irondrill(production, TileType.irondrill, stack(Item.stone, 40)), irondrill(production, TileType.irondrill, stack(Item.stone, 40)),

View File

@ -415,7 +415,7 @@ public enum TileType{
} }
}, },
healturret(true, true, false){ repairturret(true, true, false){
{ {
range = 30; range = 30;
reload = 40f; reload = 40f;
@ -469,7 +469,7 @@ public enum TileType{
return "Heals nearby tiles."; return "Heals nearby tiles.";
} }
}, },
megahealturret(true, true, false){ megarepairturret(true, true, false){
{ {
range = 30; range = 30;
reload = 20f; reload = 20f;