Implemented more enemies and a tier system

This commit is contained in:
Anuken
2017-09-23 20:48:18 -04:00
parent b3ef1e2f2f
commit 5f8e451750
59 changed files with 529 additions and 160 deletions

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

View File

@ -0,0 +1,16 @@
uniform mat4 u_projTrans;
attribute vec4 a_position;
attribute vec2 a_texCoord0;
attribute vec4 a_color;
varying vec4 v_color;
varying vec2 v_texCoord;
uniform vec2 u_viewportInverse;
void main() {
gl_Position = u_projTrans * a_position;
v_texCoord = a_texCoord0;
v_color = a_color;
}

View File

@ -0,0 +1,35 @@
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
uniform sampler2D u_texture;
uniform vec4 u_color;
uniform vec2 u_texsize;
varying vec4 v_color;
varying vec2 v_texCoord;
void main() {
vec2 T = v_texCoord.xy;
vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y);
bool any = false;
float thickness = 1.0;
float step = 1.0;
if(texture2D(u_texture, T).a < 0.1 &&
(texture2D(u_texture, T + vec2(0, step) * v).a > 0.1 || texture2D(u_texture, T + vec2(0, -step) * v).a > 0.1 ||
texture2D(u_texture, T + vec2(step, 0) * v).a > 0.1 || texture2D(u_texture, T + vec2(-step, 0) * v).a > 0.1))
any = true;
if(any){
gl_FragColor = u_color;
}else{
gl_FragColor = texture2D(u_texture, T);
}
}

View File

@ -1,6 +1,6 @@
sprites.png
size: 512,32
size: 1024,32
format: RGBA8888
filter: Nearest,Nearest
repeat: none
@ -13,581 +13,588 @@ blank
index: -1
blocks/block
rotate: false
xy: 271, 23
xy: 469, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal1
rotate: false
xy: 291, 23
xy: 489, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal2
rotate: false
xy: 301, 23
xy: 499, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coal3
rotate: false
xy: 311, 23
xy: 509, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coaldrill
rotate: false
xy: 321, 23
xy: 519, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coalpurifier
rotate: false
xy: 331, 23
xy: 529, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/compositewall
rotate: false
xy: 341, 23
xy: 539, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduit
rotate: false
xy: 351, 23
xy: 549, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitbottom
rotate: false
xy: 361, 23
xy: 559, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduitliquid
rotate: false
xy: 371, 23
xy: 569, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conduittop
rotate: false
xy: 381, 23
xy: 579, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyor
rotate: false
xy: 391, 23
xy: 589, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/conveyormove
rotate: false
xy: 401, 23
xy: 599, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/core
rotate: false
xy: 411, 23
xy: 609, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/cross
rotate: false
xy: 421, 23
xy: 619, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/crucible
rotate: false
xy: 431, 23
xy: 629, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/deepwater
rotate: false
xy: 441, 23
xy: 639, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt1
rotate: false
xy: 451, 23
xy: 649, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt2
rotate: false
xy: 461, 23
xy: 659, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirt3
rotate: false
xy: 471, 23
xy: 669, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtblock
rotate: false
xy: 481, 23
xy: 679, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/dirtedge
rotate: false
xy: 85, 19
xy: 213, 3
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/doubleturret
rotate: false
xy: 113, 7
xy: 313, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/drill
rotate: false
xy: 491, 23
xy: 689, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/duriumwall
rotate: false
xy: 501, 23
xy: 699, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/flameturret
rotate: false
xy: 127, 21
xy: 325, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/grass1
rotate: false
xy: 128, 1
xy: 709, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass2
rotate: false
xy: 138, 11
xy: 719, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grass3
rotate: false
xy: 138, 1
xy: 729, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock
rotate: false
xy: 148, 11
xy: 739, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassblock2
rotate: false
xy: 148, 1
xy: 749, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/grassedge
rotate: false
xy: 85, 5
xy: 257, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/iron1
rotate: false
xy: 188, 11
xy: 819, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron2
rotate: false
xy: 188, 1
xy: 829, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/iron3
rotate: false
xy: 198, 11
xy: 839, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/irondrill
rotate: false
xy: 198, 1
xy: 849, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/ironwall
rotate: false
xy: 208, 11
xy: 859, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/junction
rotate: false
xy: 208, 1
xy: 869, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/laserturret
rotate: false
xy: 139, 21
xy: 337, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/liquidrouter
rotate: false
xy: 218, 11
xy: 879, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/machineturret
rotate: false
xy: 151, 21
xy: 349, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/megarepairturret
rotate: false
xy: 163, 21
xy: 361, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mortarturret
rotate: false
xy: 175, 21
xy: 373, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/mossblock
rotate: false
xy: 228, 11
xy: 889, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/mossstone
rotate: false
xy: 228, 11
xy: 889, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/omnidrill
rotate: false
xy: 228, 1
xy: 899, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/plasmaturret
rotate: false
xy: 187, 21
xy: 385, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/pump
rotate: false
xy: 238, 1
xy: 919, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/repairturret
rotate: false
xy: 199, 21
xy: 397, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/rock
rotate: false
xy: 248, 11
xy: 929, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2
rotate: false
xy: 248, 1
xy: 939, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rock2shadow
rotate: false
xy: 258, 11
xy: 949, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/rockshadow
rotate: false
xy: 258, 1
xy: 959, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/router
rotate: false
xy: 268, 11
xy: 969, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shadow
rotate: false
xy: 211, 21
xy: 409, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shotgunturret
rotate: false
xy: 223, 21
xy: 421, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/shrub
rotate: false
xy: 268, 1
xy: 979, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/shrubshadow
rotate: false
xy: 278, 13
xy: 989, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/smelter
rotate: false
xy: 278, 3
xy: 999, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/sniperturret
rotate: false
xy: 235, 21
xy: 433, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/steelconveyor
rotate: false
xy: 288, 13
xy: 1009, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelconveyormove
rotate: false
xy: 288, 3
xy: 230, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/steelwall
rotate: false
xy: 298, 13
xy: 240, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone
rotate: false
xy: 99, 19
xy: 271, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stone1
rotate: false
xy: 298, 3
xy: 250, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone2
rotate: false
xy: 308, 13
xy: 260, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stone3
rotate: false
xy: 308, 3
xy: 270, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock
rotate: false
xy: 318, 13
xy: 280, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock2
rotate: false
xy: 318, 3
xy: 290, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneblock3
rotate: false
xy: 328, 13
xy: 300, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stonedrill
rotate: false
xy: 328, 3
xy: 310, 9
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/stoneedge
rotate: false
xy: 99, 5
xy: 285, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/stonewall
rotate: false
xy: 338, 13
xy: 320, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium1
rotate: false
xy: 338, 3
xy: 320, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium2
rotate: false
xy: 348, 13
xy: 330, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium3
rotate: false
xy: 348, 3
xy: 330, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumdrill
rotate: false
xy: 358, 13
xy: 340, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumpurifier
rotate: false
xy: 340, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumwall
rotate: false
xy: 358, 3
xy: 350, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/turret
rotate: false
xy: 247, 21
xy: 445, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
blocks/water
rotate: false
xy: 368, 13
xy: 350, 1
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/wateredge
rotate: false
xy: 113, 19
xy: 299, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
blocks/waveturret
rotate: false
xy: 259, 21
xy: 457, 21
size: 10, 10
orig: 10, 10
offset: 0, 0
index: -1
bullet
rotate: false
xy: 281, 23
xy: 479, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -599,79 +606,198 @@ circle
orig: 10, 10
offset: 0, 0
index: -1
enemies/bossmech
enemies/blastenemy-t1
rotate: false
xy: 21, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/blastenemy-t2
rotate: false
xy: 21, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastmech
rotate: false
xy: 128, 11
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
enemies/firemech
enemies/blastenemy-t3
rotate: false
xy: 37, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mech1
enemies/enemy-t1
rotate: false
xy: 218, 1
size: 8, 8
orig: 8, 8
xy: 53, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/enemy-t2
rotate: false
xy: 229, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/enemy-t3
rotate: false
xy: 243, 19
size: 12, 12
orig: 12, 12
offset: 0, 0
index: -1
enemies/fastenemy-t1
rotate: false
xy: 53, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t2
rotate: false
xy: 69, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/fastenemy-t3
rotate: false
xy: 69, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t1
rotate: false
xy: 85, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t2
rotate: false
xy: 85, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/flamerenemy-t3
rotate: false
xy: 101, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t1
rotate: false
xy: 117, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t2
rotate: false
xy: 133, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/mortarenemy-t3
rotate: false
xy: 133, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t1
rotate: false
xy: 165, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t2
rotate: false
xy: 165, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/rapidenemy-t3
rotate: false
xy: 181, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t1
rotate: false
xy: 181, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t2
rotate: false
xy: 197, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
enemies/tankenemy-t3
rotate: false
xy: 197, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
icon-coal
rotate: false
xy: 158, 11
xy: 759, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-dirium
rotate: false
xy: 158, 1
xy: 769, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-iron
rotate: false
xy: 168, 11
xy: 779, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-steel
rotate: false
xy: 168, 1
xy: 789, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-stone
rotate: false
xy: 178, 11
xy: 799, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
icon-titanium
rotate: false
xy: 178, 1
xy: 809, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
laser
rotate: false
xy: 125, 5
xy: 227, 3
size: 1, 12
orig: 1, 12
offset: 0, 0
@ -685,49 +811,49 @@ laserend
index: -1
player
rotate: false
xy: 238, 11
xy: 909, 23
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
weapons/blaster
rotate: false
xy: 21, 17
xy: 37, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/flamethrower
rotate: false
xy: 37, 1
xy: 101, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/mortar
rotate: false
xy: 53, 17
xy: 117, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/multigun
rotate: false
xy: 53, 1
xy: 149, 17
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/railgun
rotate: false
xy: 69, 17
xy: 149, 1
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
weapons/triblaster
rotate: false
xy: 69, 1
xy: 213, 17
size: 14, 14
orig: 14, 14
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -8,13 +8,13 @@ import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.input.GestureDetector;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import com.badlogic.gdx.utils.reflect.Constructor;
import io.anuke.mindustry.GameState.State;
import io.anuke.mindustry.ai.Pathfind;
import io.anuke.mindustry.entities.EnemySpawn;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.enemies.Enemy;
import io.anuke.mindustry.entities.enemies.TestEnemy;
import io.anuke.mindustry.entities.enemies.*;
import io.anuke.mindustry.input.AndroidInput;
import io.anuke.mindustry.input.GestureHandler;
import io.anuke.mindustry.input.Input;
@ -91,9 +91,29 @@ public class Control extends Module{
player = new Player();
spawns = Array.with(
new EnemySpawn(Enemy.class){{
}},
new EnemySpawn(FastEnemy.class){{
}},
new EnemySpawn(FlamerEnemy.class){{
}},
new EnemySpawn(BlastEnemy.class){{
}},
new EnemySpawn(RapidEnemy.class){{
}},
new EnemySpawn(TankEnemy.class){{
}},
new EnemySpawn(MortarEnemy.class){{
}}
);
printEnemies(100);
@ -169,15 +189,17 @@ public class Control extends Module{
for(EnemySpawn spawn : spawns){
for(int lane = 0; lane < World.spawnpoints.size; lane ++){
int fl = lane;
Tile tile = World.spawnpoints.get(lane);
int spawnamount = spawn.evaluate(wave, lane);
for(int i = 0; i < spawnamount; i ++){
int index = i;
Timers.run(index*30f, ()->{
Timers.run(index*50f, ()->{
try{
Enemy enemy = (Enemy)ClassReflection.newInstance(spawn.type);
Constructor c = ClassReflection.getConstructor(spawn.type, int.class);
Enemy enemy = (Enemy)c.newInstance(fl);
enemy.set(tile.worldx(), tile.worldy());
Effects.effect("spawn", enemy);
enemy.add();

View File

@ -23,6 +23,15 @@ public class EffectLoader{
});
});
Effects.create("blastsmoke", 26, e -> {
Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{
float size = 2f+e.fract()*6f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
});
Effects.create("shellexplosion", 15, e -> {
Draw.thickness(1.3f - e.ifract());
Draw.color(Hue.mix(Color.WHITE, Color.ORANGE, e.ifract()));
@ -30,6 +39,13 @@ public class EffectLoader{
Draw.reset();
});
Effects.create("blastexplosion", 16, e -> {
Draw.thickness(1.2f - e.ifract());
Draw.color(Hue.mix(Color.WHITE, Color.SCARLET, e.ifract()));
Draw.circle(e.x, e.y, 1.5f + e.ifract() * 9f);
Draw.reset();
});
Effects.create("place", 16, e -> {
Draw.thickness(3f - e.ifract() * 2f);
Draw.square(e.x, e.y, Vars.tilesize / 2f + e.ifract() * 3f);

View File

@ -40,6 +40,7 @@ public class Renderer extends RendererModule{
pixelate();
Draw.addSurface("shadow", Core.cameraScale);
Shaders.create();
}
@Override

View File

@ -0,0 +1,28 @@
package io.anuke.mindustry;
import com.badlogic.gdx.graphics.Color;
import io.anuke.ucore.graphics.Shader;
import io.anuke.ucore.util.Tmp;
public class Shaders{
public static void create(){
new Outline();
}
public static class Outline extends Shader{
public Color color = new Color();
public Outline(){
super("outline", "default");
}
@Override
public void apply(){
shader.setUniformf("u_color", color);
shader.setUniformf("u_texsize", Tmp.v1.set(region.getTexture().getWidth(), region.getTexture().getHeight()));
}
}
}

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 = 25*60*(android ? 2 : 1);
public static final float wavespace = 35*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

@ -58,7 +58,7 @@ public class Bullet extends BulletEntity{
@Override
public int getDamage(){
return type.damage;
return damage == -1 ? type.damage : damage;
}
}

View File

@ -38,7 +38,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
Draw.reset();
}
},
shell = new BulletType(1.1f, 110){
shell = new BulletType(1.1f, 80){
{
lifetime = 110f;
hitsize = 8f;
@ -75,15 +75,43 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
});
}
},
blast = new BulletType(1.1f, 80){
{
lifetime = 0f;
hitsize = 8f;
speed = 0f;
}
public void despawned(Bullet b){
removed(b);
}
public void removed(Bullet b){
Effects.shake(3f, 3f, b);
Effects.effect("blastsmoke", b);
Effects.effect("blastexplosion", b);
Angles.circle(30, f->{
Angles.translation(f, 6f);
Bullet o = new Bullet(blastshot, b.owner, b.x + Angles.x(), b.y + Angles.y(), f).add();
o.damage = b.damage/9;
});
}
public void draw(Bullet b){}
},
shellshot = new BulletType(1.5f, 6){
{
lifetime = 7f;
}
public void draw(Bullet b){
// Draw.color("orange");
// Draw.rect("bullet", b.x, b.y, b.angle());
// Draw.reset();
public void draw(Bullet b){}
},
blastshot = new BulletType(1.6f, 6){
{
lifetime = 7f;
}
public void draw(Bullet b){}
},
small = new BulletType(1.5f, 1){
public void draw(Bullet b){

View File

@ -0,0 +1,27 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.entities.Bullet;
import io.anuke.mindustry.entities.BulletType;
public class BlastEnemy extends Enemy{
public BlastEnemy(int spawn) {
super(spawn);
maxhealth = 15;
speed = 0.65f;
bullet = null;
turretrotatespeed = 0f;
heal();
}
void move(){
super.move();
if(target != null && target.distanceTo(this) < 10f){
Bullet b = new Bullet(BulletType.blast, this, x, y, 0).add();
b.damage = BulletType.blast.damage + (tier-1) * 50;
damage(999);
}
}
}

View File

@ -1,25 +1,35 @@
package io.anuke.mindustry.entities.enemies;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import io.anuke.mindustry.Shaders.Outline;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.ai.Pathfind;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Bullet;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.World;
import io.anuke.ucore.core.Draw;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
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};
protected float speed = 0.3f;
protected float reload = 40;
protected float range = 60;
protected float length = 4;
protected float rotatespeed = 8f;
protected float rotatespeed = 7f;
protected float turretrotatespeed = 0.2f;
protected BulletType bullet = BulletType.small;
protected String shootsound = "enemyshoot";
protected int damage;
public Tile[] path;
public int spawn;
@ -28,7 +38,7 @@ public class Enemy extends DestructibleEntity{
public Vector2 direction = new Vector2();
public float xvelocity, yvelocity;
public Entity target;
public StatusEffect effect = StatusEffect.none;
public int tier = Mathf.random(1, 3);
public Enemy(int spawn){
@ -61,7 +71,7 @@ public class Enemy extends DestructibleEntity{
}
if(target != null){
if(target != null && bullet != null){
if(Timers.get(this, "reload", reload*Vars.multiplier)){
shoot();
Effects.sound(shootsound, this);
@ -72,7 +82,7 @@ public class Enemy extends DestructibleEntity{
void shoot(){
vector.set(length, 0).rotate(direction.angle());
Bullet out = new Bullet(bullet, this, x+vector.x, y+vector.y, direction.angle()).add();
out.damage = (int)(bullet.damage*Vars.multiplier);
out.damage = (int)(damage*Vars.multiplier);
}
public void findClosestNode(){
@ -95,6 +105,20 @@ public class Enemy extends DestructibleEntity{
node = cindex;
}
@Override
public void added(){
if(bullet != null){
damage = (int)(bullet.damage * (1 + (tier - 1) * 0.5f));
}
maxhealth *= tier;
speed += 0.04f*tier + Mathf.range(0.1f);
reload /= Math.max(tier /1.5f, 1f);
range += tier*5;
heal();
}
@Override
public boolean collides(SolidEntity other){
return (other instanceof Bullet) && !(((Bullet)other).owner instanceof Enemy);
@ -111,8 +135,9 @@ public class Enemy extends DestructibleEntity{
@Override
public void removed(){
if(!dead)
if(!dead){
Vars.control.enemyDeath();
}
}
@Override
@ -129,13 +154,21 @@ public class Enemy extends DestructibleEntity{
direction.limit(speed*rotatespeed);
}else{
float angle = angleTo(target);
direction.lerp(vector.set(0, 1).setAngle(angle), 0.25f);
direction.lerp(vector.set(0, 1).setAngle(angle), turretrotatespeed * Timers.delta());
}
}
@Override
public void draw(){
Draw.color();
Draw.rect("mech1", x, y, direction.angle()-90);
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + tier;
Draw.getShader(Outline.class).color.set(tierColors[tier-1]);
Draw.getShader(Outline.class).region = Draw.region(region);
Draw.shader(Outline.class);
Draw.rect(region, x, y, direction.angle()-90);
Draw.shader();
}
}

View File

@ -1,7 +1,5 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.ucore.core.Draw;
public class FastEnemy extends Enemy{
public FastEnemy(int spawn) {
@ -14,9 +12,4 @@ public class FastEnemy extends Enemy{
heal();
}
@Override
public void draw(){
Draw.rect("fastmech", x, y, direction.angle()-90);
}
}

View File

@ -1,11 +1,10 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.ucore.core.Draw;
public class FlameEnemy extends Enemy{
public class FlamerEnemy extends Enemy{
public FlameEnemy(int spawn) {
public FlamerEnemy(int spawn) {
super(spawn);
speed = 0.35f;
@ -20,9 +19,4 @@ public class FlameEnemy extends Enemy{
heal();
}
@Override
public void draw(){
Draw.rect("firemech", x, y, direction.angle()-90);
}
}

View File

@ -0,0 +1,19 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.entities.BulletType;
public class MortarEnemy extends Enemy{
public MortarEnemy(int spawn) {
super(spawn);
maxhealth = 200;
speed = 0.2f;
reload = 100f;
bullet = BulletType.shell;
turretrotatespeed = 0.15f;
rotatespeed = 7f;
range = 120f;
}
}

View File

@ -1,11 +1,10 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.ucore.core.Draw;
public class BossEnemy extends Enemy{
public class RapidEnemy extends Enemy{
public BossEnemy(int spawn) {
public RapidEnemy(int spawn) {
super(spawn);
reload = 8;
@ -19,9 +18,4 @@ public class BossEnemy extends Enemy{
range = 70;
}
@Override
public void draw(){
Draw.rect("bossmech", x, y, direction.angle()-90);
}
}

View File

@ -0,0 +1,16 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.entities.BulletType;
public class TankEnemy extends Enemy{
public TankEnemy(int spawn) {
super(spawn);
maxhealth = 400;
speed = 0.2f;
reload = 140f;
bullet = BulletType.iron;
}
}

View File

@ -90,8 +90,8 @@ public class SaveIO{
private static final Array<Class<? extends Enemy>> enemyIDs = Array.with(
Enemy.class,
FastEnemy.class,
BossEnemy.class,
FlameEnemy.class
RapidEnemy.class,
FlamerEnemy.class
);
private static final ObjectMap<Class<? extends Enemy>, Byte> idEnemies = new ObjectMap<Class<? extends Enemy>, Byte>(){{

View File

@ -39,10 +39,11 @@ public enum Recipe{
irondrill(production, ProductionBlocks.irondrill, stack(Item.stone, 40)),
coaldrill(production, ProductionBlocks.coaldrill, stack(Item.stone, 40), stack(Item.iron, 40)),
titaniumdrill(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)),
omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 40), stack(Item.dirium, 40)),
smelter(production, ProductionBlocks.smelter, stack(Item.stone, 80), stack(Item.iron, 80)),
crucible(production, ProductionBlocks.crucible, stack(Item.titanium, 80), stack(Item.steel, 80)),
coalpurifier(production, ProductionBlocks.coalpurifier, stack(Item.steel, 20), stack(Item.iron, 20)),
titaniumpurifier(production, ProductionBlocks.titaniumpurifier, stack(Item.steel, 60), stack(Item.iron, 60)),
omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 40), stack(Item.dirium, 40)),
conduit(distribution, ProductionBlocks.conduit, stack(Item.steel, 1)),
liquidrouter(distribution, ProductionBlocks.liquidrouter, stack(Item.steel, 5)),

View File

@ -62,7 +62,7 @@ public class Generator{
floor = Blocks.coal;
}
if(Noise.nnoise(x, y, 9, 1) > 0.254){
if(Noise.nnoise(x + 9999, y + 9999, 8, 1) > 0.253){
floor = Blocks.titanium;
}
}

View File

@ -115,7 +115,7 @@ public class ProductionBlocks{
coalpurifier = new Purifier("coalpurifier"){
{
formalName = "coal purifier";
formalName = "coal extractor";
input = Item.stone;
inputLiquid = Liquid.water;
output = Item.coal;
@ -127,6 +127,24 @@ public class ProductionBlocks{
}
},
titaniumpurifier = new Purifier("titaniumpurifier"){
{
formalName = "titanium\nextractor";
input = Item.iron;
inputAmount = 11;
inputLiquid = Liquid.water;
liquidAmount = 40f;
liquidCapacity = 41f;
purifyTime = 90;
output = Item.titanium;
}
@Override
public String description(){
return "Takes in iron + water, outputs coal.";
}
},
stonedrill = new Drill("stonedrill"){{
resource = Blocks.stone;
result = Item.stone;

View File

@ -18,12 +18,14 @@ public class Purifier extends Conduit{
public float liquidAmount = 19.99f;
public Item output = null;
public int itemCapacity = 100;
public int purifyTime = 90;
public int purifyTime = 80;
public Purifier(String name) {
super(name);
update = true;
rotate = false;
solid = true;
health = 60;
liquidCapacity = 20f;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB