Updated spawn lists, other minor fixes

This commit is contained in:
Anuken 2017-09-24 01:51:42 -04:00
parent 5f8e451750
commit 67b1fc4dbd
12 changed files with 204 additions and 190 deletions

View file

@ -79,7 +79,7 @@ project(":core") {
apply plugin: "java"
dependencies {
//compile 'com.github.anuken:ucore:bded68dbb2'
compile 'com.github.anuken:ucore:be4ae33e40'
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 290 B

Before After
Before After

View file

@ -1,859 +1,866 @@
sprites.png
size: 1024,32
size: 512,512
format: RGBA8888
filter: Nearest,Nearest
repeat: none
backgrounds/background
rotate: false
xy: 1, 241
size: 356, 270
orig: 356, 270
offset: 0, 0
index: -1
blank
rotate: false
xy: 13, 10
xy: 509, 510
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
blocks/block
rotate: false
xy: 469, 23
xy: 489, 503
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal1
rotate: false
xy: 489, 23
xy: 149, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal2
rotate: false
xy: 499, 23
xy: 359, 361
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal3
rotate: false
xy: 509, 23
xy: 499, 503
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coaldrill
rotate: false
xy: 519, 23
xy: 1, 71
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coalpurifier
rotate: false
xy: 529, 23
xy: 159, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/compositewall
rotate: false
xy: 539, 23
xy: 359, 351
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduit
rotate: false
xy: 549, 23
xy: 1, 61
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitbottom
rotate: false
xy: 559, 23
xy: 169, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitliquid
rotate: false
xy: 569, 23
xy: 359, 341
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduittop
rotate: false
xy: 579, 23
xy: 1, 51
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyor
rotate: false
xy: 589, 23
xy: 179, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyormove
rotate: false
xy: 599, 23
xy: 359, 331
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/core
rotate: false
xy: 609, 23
xy: 1, 41
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/cross
rotate: false
xy: 619, 23
xy: 189, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/crucible
rotate: false
xy: 629, 23
xy: 359, 321
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/deepwater
rotate: false
xy: 639, 23
xy: 1, 31
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt1
rotate: false
xy: 649, 23
xy: 199, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt2
rotate: false
xy: 659, 23
xy: 359, 311
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt3
rotate: false
xy: 669, 23
xy: 1, 21
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtblock
rotate: false
xy: 679, 23
xy: 209, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtedge
rotate: false
xy: 213, 3
xy: 359, 419
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/doubleturret
rotate: false
xy: 313, 21
xy: 359, 407
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/drill
rotate: false
xy: 689, 23
xy: 359, 301
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/duriumwall
rotate: false
xy: 699, 23
xy: 1, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/flameturret
rotate: false
xy: 325, 21
xy: 453, 501
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/grass1
rotate: false
xy: 709, 23
xy: 1, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass2
rotate: false
xy: 719, 23
xy: 219, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass3
rotate: false
xy: 729, 23
xy: 359, 291
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock
rotate: false
xy: 739, 23
xy: 229, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock2
rotate: false
xy: 749, 23
xy: 359, 281
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassedge
rotate: false
xy: 257, 19
xy: 407, 467
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/iron1
rotate: false
xy: 819, 23
xy: 269, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron2
rotate: false
xy: 829, 23
xy: 359, 241
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron3
rotate: false
xy: 839, 23
xy: 279, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/irondrill
rotate: false
xy: 849, 23
xy: 289, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/ironwall
rotate: false
xy: 859, 23
xy: 299, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/junction
rotate: false
xy: 869, 23
xy: 309, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/laserturret
rotate: false
xy: 337, 21
xy: 1, 115
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/liquidrouter
rotate: false
xy: 879, 23
xy: 319, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/machineturret
rotate: false
xy: 349, 21
xy: 113, 229
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/megarepairturret
rotate: false
xy: 361, 21
xy: 359, 395
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mortarturret
rotate: false
xy: 373, 21
xy: 465, 501
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mossblock
rotate: false
xy: 889, 23
xy: 329, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/mossstone
rotate: false
xy: 889, 23
xy: 329, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/omnidrill
rotate: false
xy: 899, 23
xy: 339, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/plasmaturret
rotate: false
xy: 385, 21
xy: 1, 103
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/pump
rotate: false
xy: 919, 23
xy: 359, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/repairturret
rotate: false
xy: 397, 21
xy: 125, 229
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/rock
rotate: false
xy: 929, 23
xy: 21, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2
rotate: false
xy: 939, 23
xy: 31, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2shadow
rotate: false
xy: 949, 23
xy: 41, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rockshadow
rotate: false
xy: 959, 23
xy: 51, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/router
rotate: false
xy: 969, 23
xy: 61, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shadow
rotate: false
xy: 409, 21
xy: 359, 383
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shotgunturret
rotate: false
xy: 421, 21
xy: 477, 501
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shrub
rotate: false
xy: 979, 23
xy: 71, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shrubshadow
rotate: false
xy: 989, 23
xy: 81, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/smelter
rotate: false
xy: 999, 23
xy: 91, 215
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/sniperturret
rotate: false
xy: 433, 21
xy: 1, 91
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/steelconveyor
rotate: false
xy: 1009, 23
xy: 101, 219
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelconveyormove
rotate: false
xy: 230, 9
xy: 111, 219
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelwall
rotate: false
xy: 240, 9
xy: 121, 219
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone
rotate: false
xy: 271, 19
xy: 423, 483
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stone1
rotate: false
xy: 250, 9
xy: 131, 219
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone2
rotate: false
xy: 260, 9
xy: 141, 219
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone3
rotate: false
xy: 270, 9
xy: 151, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock
rotate: false
xy: 280, 9
xy: 161, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock2
rotate: false
xy: 290, 9
xy: 171, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock3
rotate: false
xy: 300, 9
xy: 181, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stonedrill
rotate: false
xy: 310, 9
xy: 191, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneedge
rotate: false
xy: 285, 19
xy: 439, 499
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stonewall
rotate: false
xy: 320, 11
xy: 201, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium1
rotate: false
xy: 320, 1
xy: 211, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium2
rotate: false
xy: 330, 11
xy: 221, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium3
rotate: false
xy: 330, 1
xy: 231, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumdrill
rotate: false
xy: 340, 11
xy: 241, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumpurifier
rotate: false
xy: 340, 1
xy: 251, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumwall
rotate: false
xy: 350, 11
xy: 261, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/turret
rotate: false
xy: 445, 21
xy: 137, 229
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/water
rotate: false
xy: 350, 1
xy: 271, 221
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/wateredge
rotate: false
xy: 299, 19
xy: 1, 127
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/waveturret
rotate: false
xy: 457, 21
xy: 359, 371
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
bullet
rotate: false
xy: 479, 23
xy: 1, 81
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
circle
rotate: false
xy: 1, 1
xy: 101, 229
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
enemies/blastenemy-t1
rotate: false
xy: 21, 17
xy: 359, 497
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/blastenemy-t2
rotate: false
xy: 21, 1
xy: 1, 205
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/blastenemy-t3
rotate: false
xy: 37, 17
xy: 21, 225
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/enemy-t1
rotate: false
xy: 53, 17
xy: 375, 497
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/enemy-t2
rotate: false
xy: 229, 19
xy: 375, 435
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/enemy-t3
rotate: false
xy: 243, 19
xy: 391, 451
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/fastenemy-t1
rotate: false
xy: 53, 1
xy: 1, 189
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t2
rotate: false
xy: 69, 17
xy: 37, 225
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t3
rotate: false
xy: 69, 1
xy: 359, 465
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t1
rotate: false
xy: 85, 17
xy: 375, 481
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t2
rotate: false
xy: 85, 1
xy: 391, 497
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t3
rotate: false
xy: 101, 17
xy: 1, 173
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t1
rotate: false
xy: 117, 1
xy: 375, 465
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t2
rotate: false
xy: 133, 17
xy: 391, 481
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t3
rotate: false
xy: 133, 1
xy: 407, 497
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t1
rotate: false
xy: 165, 17
xy: 359, 433
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t2
rotate: false
xy: 165, 1
xy: 375, 449
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t3
rotate: false
xy: 181, 17
xy: 391, 465
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t1
rotate: false
xy: 181, 1
xy: 407, 481
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t2
rotate: false
xy: 197, 17
xy: 423, 497
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t3
rotate: false
xy: 197, 1
xy: 1, 141
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
icon-coal
rotate: false
xy: 759, 23
xy: 239, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-dirium
rotate: false
xy: 769, 23
xy: 359, 271
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-iron
rotate: false
xy: 779, 23
xy: 249, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-steel
rotate: false
xy: 789, 23
xy: 359, 261
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-stone
rotate: false
xy: 799, 23
xy: 259, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-titanium
rotate: false
xy: 809, 23
xy: 359, 251
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
laser
rotate: false
xy: 227, 3
xy: 17, 207
size: 1, 12
orig: 1, 12
offset: 0, 0
index: -1
laserend
rotate: false
xy: 1, 13
xy: 1, 221
size: 18, 18
orig: 18, 18
offset: 0, 0
index: -1
player
rotate: false
xy: 909, 23
xy: 349, 231
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/blaster
rotate: false
xy: 37, 1
xy: 359, 481
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/flamethrower
rotate: false
xy: 101, 1
xy: 53, 225
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/mortar
rotate: false
xy: 117, 17
xy: 359, 449
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/multigun
rotate: false
xy: 149, 17
xy: 1, 157
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/railgun
rotate: false
xy: 149, 1
xy: 69, 225
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/triblaster
rotate: false
xy: 213, 17
xy: 85, 225
size: 14, 14
orig: 14, 14
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before After
Before After

Binary file not shown.

View file

@ -93,30 +93,46 @@ public class Control extends Module{
spawns = Array.with(
new EnemySpawn(Enemy.class){{
scaling = 2;
tierscaleback = 4;
}},
new EnemySpawn(FastEnemy.class){{
after = 2;
scaling = 3;
}},
new EnemySpawn(FlamerEnemy.class){{
after = 14;
spacing = 5;
scaling = 2;
}},
new EnemySpawn(BlastEnemy.class){{
after = 12;
spacing = 2;
scaling = 3;
}},
new EnemySpawn(RapidEnemy.class){{
after = 7;
spacing = 5;
}},
new EnemySpawn(TankEnemy.class){{
after = 4;
spacing = 2;
scaling = 3;
}},
new EnemySpawn(MortarEnemy.class){{
after = 20;
spacing = 3;
scaling = 5;
}}
);
printEnemies(100);
for(int i = 1; i < 60; i ++){
UCore.log("\n\n--WAVE " + i);
printEnemies(i);
}
}
public void reset(){
@ -201,6 +217,7 @@ public class Control extends Module{
Constructor c = ClassReflection.getConstructor(spawn.type, int.class);
Enemy enemy = (Enemy)c.newInstance(fl);
enemy.set(tile.worldx(), tile.worldy());
enemy.tier = spawn.tier(wave, fl);
Effects.effect("spawn", enemy);
enemy.add();
@ -231,7 +248,7 @@ public class Control extends Module{
int spawnamount = spawn.evaluate(wave, 0);
if(spawnamount > 0){
UCore.log(ClassReflection.getSimpleName(spawn.type) + " x" + spawnamount);
UCore.log(ClassReflection.getSimpleName(spawn.type) + " t" + spawn.tier(wave, 0) + " x" + spawnamount);
}
}
}
@ -360,11 +377,13 @@ public class Control extends Module{
player.heal();
player.add();
Effects.sound("respawn");
ui.fadeRespawn(false);
}
}
if(enemies <= 0)
if(enemies <= 0){
wavetime -= delta();
}
if(wavetime <= 0 || (debug && Inputs.keyUp(Keys.F))){
runWave();

View file

@ -9,7 +9,6 @@ import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Colors;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.utils.Align;
@ -23,7 +22,6 @@ import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.function.VisibilityProvider;
import io.anuke.ucore.graphics.Textures;
import io.anuke.ucore.modules.SceneModule;
import io.anuke.ucore.scene.actions.Actions;
import io.anuke.ucore.scene.builders.*;
@ -32,7 +30,7 @@ import io.anuke.ucore.scene.ui.layout.*;
import io.anuke.ucore.util.Mathf;
public class UI extends SceneModule{
Table itemtable, weapontable, tools, loadingtable, desctable;
Table itemtable, weapontable, tools, loadingtable, desctable, respawntable;
SettingsDialog prefs;
KeybindDialog keys;
Dialog about, menu, restart, tutorial, levels, upgrades, load;
@ -59,9 +57,6 @@ public class UI extends SceneModule{
Dialog.closePadR = -1;
Dialog.closePadT = 5;
Textures.load("sprites/");
Textures.repeatWrap("conveyort", Gdx.app.getType() == ApplicationType.WebGL ? "back-web" : "back", "background");
Colors.put("description", Color.WHITE);
Colors.put("turretinfo", Color.ORANGE);
Colors.put("missingitems", Color.SCARLET);
@ -74,29 +69,11 @@ public class UI extends SceneModule{
Draw.color();
Texture back = Textures.get("background");
TextureRegion back = Draw.region("background");
float backscl = 5;
Draw.batch().draw(back, w/2 - back.getWidth()*backscl/2, h/2 - back.getHeight()*backscl/2,
back.getWidth()*backscl, back.getHeight()*backscl);
/*
Draw.color(Hue.lightness(0.6f));
int tw = w/64+1;
float scale = Unit.dp.inPixels(1f);
Texture texture = Textures.get(Gdx.app.getType() == ApplicationType.WebGL ? "back-web" : "back");
batch.draw(texture,
0, 0, w, h, 0, 0, (float)w/h/scale * h/texture.getHeight()/4f, -1f/scale * h/texture.getHeight()/4f);
for(int x = 0; x < tw; x ++){
float offset = (Timers.time()*2*(x%2-0.5f))/32f;
batch.draw(Textures.get("conveyort"), x*64*scale, 0, 32*scale, h*scale, 0, offset, 1, h/32 + offset);
}
*/
Draw.batch().draw(back, w/2 - back.getRegionWidth()*backscl/2, h/2 - back.getRegionHeight()*backscl/2,
back.getRegionWidth()*backscl, back.getRegionHeight()*backscl);
float logoscl = (int)Unit.dp.inPixels(7);
TextureRegion logo = skin.getRegion("logotext");
@ -104,7 +81,6 @@ public class UI extends SceneModule{
float logoh = logo.getRegionHeight()*logoscl;
Draw.color();
//Draw.color(Color.CORAL);
Draw.batch().draw(logo, w/2 - logow/2, h - logoh + 15, logow, logoh);
Draw.color();
@ -413,29 +389,27 @@ public class UI extends SceneModule{
}}.end();
}
new table("white"){{
respawntable = get();
respawntable.setColor(Color.CLEAR);
}}.end();
new table(){{
new table(){{
get().background("button");
new table("pane"){{
new label("Respawning in"){{
get().update(()->{
get().setText("[yellow]Respawning in " + (int)(control.getRespawnTime()/60));
});
get().setFontScale(0.75f);
}};
new label(()->"Respawning in " + (int)(control.getRespawnTime()/60)).scale(0.75f).pad(10);
visible(()->{
return control.getRespawnTime() > 0 && !GameState.is(State.menu);
});
}};
visible(()->control.getRespawnTime() > 0 && !GameState.is(State.menu));
}}.end();
}}.end();
loadingtable = new table("loadDim"){{
new table("button"){{
new label("[yellow]Loading..."){{
new label("[orange]Loading..."){{
get().setName("namelabel");
}}.scale(1).pad(Unit.dp.inPixels(10));
}}.scale(2f*Vars.fontscale).pad(Unit.dp.inPixels(10));
}}.end();
}}.end().get();
@ -469,6 +443,10 @@ public class UI extends SceneModule{
build.end();
}
public void fadeRespawn(boolean in){
respawntable.addAction(Actions.color(in ? new Color(0, 0, 0, 0.3f) : Color.CLEAR, 0.3f));
}
void updateRecipe(){
Recipe recipe = player.recipe;
desctable.clear();
@ -557,7 +535,7 @@ public class UI extends SceneModule{
}
public void showLoading(){
showLoading("[yellow]Loading..");
showLoading("[orange]Loading..");
}
public void showLoading(String text){

View file

@ -7,7 +7,6 @@ import io.anuke.mindustry.entities.Player;
import io.anuke.ucore.scene.ui.layout.Unit;
public class Vars{
//shorthand for whether or not this is running on android
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android);
//how far away from the player blocks can be placed

View file

@ -1,22 +1,30 @@
package io.anuke.mindustry.entities;
import io.anuke.mindustry.entities.enemies.Enemy;
import io.anuke.ucore.util.Mathf;
public class EnemySpawn{
public final Class<? extends Enemy> type;
int before = Integer.MAX_VALUE;
int after;
int spacing = 1;
float scaling = 9999f;
protected int before = Integer.MAX_VALUE;
protected int after;
protected int spacing = 1;
protected int tierscale = 15;
protected int tierscaleback = 1;
protected int max = 17;
protected float scaling = 9999f;
public EnemySpawn(Class<? extends Enemy> type){
this.type = type;
}
public int evaluate(int wave, int lane){
if(wave < after || wave > before || wave % spacing != 0){
if(wave < after || wave > before || (wave - after) % spacing != 0){
return 0;
}
return 1 * Math.max((int)((wave / spacing) / scaling), 1);
return Math.min(1 * Math.max((int)((wave / spacing) / scaling), 1) - (tier(wave, lane)-1) * tierscaleback, max);
}
public int tier(int wave, int lane){
return Mathf.clamp(1 + (wave-after)/tierscale, 1, Enemy.maxtier);
}
}

View file

@ -38,6 +38,7 @@ public class Player extends DestructibleEntity{
Effects.sound("die", this);
Vars.control.setRespawnTime(respawnduration);
ui.fadeRespawn(true);
}
@Override

View file

@ -19,7 +19,8 @@ import io.anuke.ucore.entities.*;
import io.anuke.ucore.util.Mathf;
public class Enemy extends DestructibleEntity{
public final static Color[] tierColors = {Color.YELLOW, Color.MAGENTA, Color.RED};
public final static Color[] tierColors = {Color.YELLOW, Color.ORANGE, Color.RED, Color.MAGENTA};
public final static int maxtier = 4;
protected float speed = 0.3f;
protected float reload = 40;
@ -38,7 +39,7 @@ public class Enemy extends DestructibleEntity{
public Vector2 direction = new Vector2();
public float xvelocity, yvelocity;
public Entity target;
public int tier = Mathf.random(1, 3);
public int tier = 1;
public Enemy(int spawn){
@ -64,11 +65,11 @@ public class Enemy extends DestructibleEntity{
target = World.findTileTarget(x, y, null, range, false);
//no tile found
if(target == null)
if(target == null){
target = Entities.getClosest(x, y, range, e->{
return e instanceof Player;
});
}
}
if(target != null && bullet != null){
@ -162,8 +163,9 @@ public class Enemy extends DestructibleEntity{
public void draw(){
Draw.color();
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + tier;
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + Mathf.clamp(tier, 1, 3);
//TODO is this necessary?
Draw.getShader(Outline.class).color.set(tierColors[tier-1]);
Draw.getShader(Outline.class).region = Draw.region(region);