Added test unit type
|
Before Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 340 B |
|
Before Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 339 B |
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 451 B |
|
Before Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 297 B |
|
Before Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 346 B |
|
Before Width: | Height: | Size: 397 B |
|
Before Width: | Height: | Size: 407 B |
BIN
core/assets-raw/sprites/enemies/scout-base.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
core/assets-raw/sprites/enemies/scout-leg.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
core/assets-raw/sprites/enemies/scout.png
Normal file
|
After Width: | Height: | Size: 264 B |
|
Before Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 339 B |
|
Before Width: | Height: | Size: 301 B |
|
Before Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 383 B |
|
Before Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Fri Mar 16 00:30:24 EDT 2018
|
#Fri Mar 16 21:46:55 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=525
|
androidBuildCode=528
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class Logic extends Module {
|
|||||||
Entities.update(Entities.defaultGroup());
|
Entities.update(Entities.defaultGroup());
|
||||||
Entities.update(bulletGroup);
|
Entities.update(bulletGroup);
|
||||||
for(EntityGroup group : unitGroups){
|
for(EntityGroup group : unitGroups){
|
||||||
if(!group.isEmpty()) Entities.update(group);
|
Entities.update(group);
|
||||||
}
|
}
|
||||||
Entities.update(tileGroup);
|
Entities.update(tileGroup);
|
||||||
Entities.update(shieldGroup);
|
Entities.update(shieldGroup);
|
||||||
|
|||||||
@@ -86,8 +86,12 @@ public class BaseUnit extends Unit {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void added(){
|
public void added(){
|
||||||
|
maxhealth = type.health;
|
||||||
|
|
||||||
hitbox.setSize(type.hitsize);
|
hitbox.setSize(type.hitsize);
|
||||||
hitboxTile.setSize(type.hitsizeTile);
|
hitboxTile.setSize(type.hitsizeTile);
|
||||||
|
|
||||||
|
heal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -117,6 +121,7 @@ public class BaseUnit extends Unit {
|
|||||||
data.putFloat(x);
|
data.putFloat(x);
|
||||||
data.putFloat(y);
|
data.putFloat(y);
|
||||||
data.putShort((short)(rotation *2));
|
data.putShort((short)(rotation *2));
|
||||||
|
data.putShort((short)(baseRotation *2));
|
||||||
data.putShort((short)health);
|
data.putShort((short)health);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,10 +129,11 @@ public class BaseUnit extends Unit {
|
|||||||
public void read(ByteBuffer data, long time) {
|
public void read(ByteBuffer data, long time) {
|
||||||
float x = data.getFloat();
|
float x = data.getFloat();
|
||||||
float y = data.getFloat();
|
float y = data.getFloat();
|
||||||
short angle = data.getShort();
|
short rotation = data.getShort();
|
||||||
|
short baserotation = data.getShort();
|
||||||
short health = data.getShort();
|
short health = data.getShort();
|
||||||
|
|
||||||
|
interpolator.read(this.x, this.y, x, y, rotation/2f, baserotation/2f, time);
|
||||||
this.health = health;
|
this.health = health;
|
||||||
interpolator.read(this.x, this.y, x, y, angle/2f, time);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,11 +77,12 @@ public abstract class UnitType {
|
|||||||
if(Net.server()){
|
if(Net.server()){
|
||||||
NetEvents.handleUnitDeath(unit);
|
NetEvents.handleUnitDeath(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unit.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRemoteDeath(BaseUnit unit){
|
public void onRemoteDeath(BaseUnit unit){
|
||||||
onDeath(unit);
|
onDeath(unit);
|
||||||
unit.remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removed(BaseUnit unit){
|
public void removed(BaseUnit unit){
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package io.anuke.mindustry.entities.units;
|
package io.anuke.mindustry.entities.units;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.types.Scout;
|
||||||
|
|
||||||
public class UnitTypes {
|
public class UnitTypes {
|
||||||
//TODO list types here.
|
public static final UnitType
|
||||||
|
|
||||||
|
scout = new Scout();
|
||||||
}
|
}
|
||||||
|
|||||||
10
core/src/io/anuke/mindustry/entities/units/types/Scout.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.GroundUnitType;
|
||||||
|
|
||||||
|
public class Scout extends GroundUnitType {
|
||||||
|
|
||||||
|
public Scout(){
|
||||||
|
super("scout");
|
||||||
|
}
|
||||||
|
}
|
||||||
6
core/src/io/anuke/mindustry/io/MapIO.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package io.anuke.mindustry.io;
|
||||||
|
|
||||||
|
/**Reads and writes map files.*/
|
||||||
|
public class MapIO {
|
||||||
|
//TODO implementation
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ package io.anuke.mindustry.ui.fragments;
|
|||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import io.anuke.mindustry.entities.Player;
|
import io.anuke.mindustry.entities.Player;
|
||||||
|
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||||
|
import io.anuke.mindustry.entities.units.UnitTypes;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.scene.builders.button;
|
import io.anuke.ucore.scene.builders.button;
|
||||||
@@ -46,17 +48,13 @@ public class DebugFragment implements Fragment {
|
|||||||
row();
|
row();
|
||||||
new button("noclip", "toggle", () -> noclip = !noclip);
|
new button("noclip", "toggle", () -> noclip = !noclip);
|
||||||
row();
|
row();
|
||||||
new button("hideplayer", "toggle", () -> showPlayer = !showPlayer);
|
|
||||||
row();
|
|
||||||
new button("blocks", "toggle", () -> showBlockDebug = !showBlockDebug);
|
new button("blocks", "toggle", () -> showBlockDebug = !showBlockDebug);
|
||||||
row();
|
row();
|
||||||
new button("paths", "toggle", () -> showPaths = !showPaths);
|
new button("paths", "toggle", () -> showPaths = !showPaths);
|
||||||
row();
|
row();
|
||||||
new button("wave", () -> state.wavetime = 0f);
|
new button("wave", () -> state.wavetime = 0f);
|
||||||
row();
|
row();
|
||||||
new button("time 0", () -> Timers.resetTime(0f));
|
new button("spawn", () -> new BaseUnit(UnitTypes.scout).set(player.x, player.y).add());
|
||||||
row();
|
|
||||||
new button("time max", () -> Timers.resetTime(1080000 - 60*10));
|
|
||||||
row();
|
row();
|
||||||
}}.end();
|
}}.end();
|
||||||
|
|
||||||
|
|||||||