A few minor bugfixes, updated version to 3.3 release
This commit is contained in:
@@ -18,9 +18,10 @@ allprojects {
|
|||||||
apply plugin: "idea"
|
apply plugin: "idea"
|
||||||
|
|
||||||
version = 'release'
|
version = 'release'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
versionNumber = '3.3'
|
versionNumber = '3.3'
|
||||||
versionType = 'beta'
|
versionType = 'release'
|
||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
aiVersion = '1.8.1'
|
aiVersion = '1.8.1'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Tue Feb 20 23:46:44 EST 2018
|
#Wed Feb 21 15:00:37 EST 2018
|
||||||
version=beta
|
version=release
|
||||||
androidBuildCode=250
|
androidBuildCode=257
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.3
|
code=3.3
|
||||||
build=26
|
build=custom build
|
||||||
|
|||||||
@@ -51,14 +51,14 @@ public class Control extends Module{
|
|||||||
private float controlx, controly;
|
private float controlx, controly;
|
||||||
private boolean controlling;
|
private boolean controlling;
|
||||||
private Throwable error;
|
private Throwable error;
|
||||||
|
|
||||||
public Control(){
|
public Control(){
|
||||||
saves = new Saves();
|
saves = new Saves();
|
||||||
|
|
||||||
Inputs.useControllers(!gwt);
|
Inputs.useControllers(!gwt);
|
||||||
|
|
||||||
Gdx.input.setCatchBackKey(true);
|
Gdx.input.setCatchBackKey(true);
|
||||||
|
|
||||||
if(android){
|
if(android){
|
||||||
input = new AndroidInput();
|
input = new AndroidInput();
|
||||||
}else{
|
}else{
|
||||||
@@ -86,28 +86,28 @@ public class Control extends Module{
|
|||||||
return pointer == 0 ? getX() : super.getX(pointer);
|
return pointer == 0 ? getX() : super.getX(pointer);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Inputs.addProcessor(input);
|
Inputs.addProcessor(input);
|
||||||
|
|
||||||
Effects.setShakeFalloff(10000f);
|
Effects.setShakeFalloff(10000f);
|
||||||
|
|
||||||
Core.atlas = new Atlas("sprites.atlas");
|
Core.atlas = new Atlas("sprites.atlas");
|
||||||
|
|
||||||
for(Item item : Item.getAllItems()){
|
for(Item item : Item.getAllItems()){
|
||||||
item.init();
|
item.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Sounds.load("shoot.ogg", "place.ogg", "explosion.ogg", "enemyshoot.ogg",
|
Sounds.load("shoot.ogg", "place.ogg", "explosion.ogg", "enemyshoot.ogg",
|
||||||
"corexplode.ogg", "break.ogg", "spawn.ogg", "flame.ogg", "die.ogg",
|
"corexplode.ogg", "break.ogg", "spawn.ogg", "flame.ogg", "die.ogg",
|
||||||
"respawn.ogg", "purchase.ogg", "flame2.ogg", "bigshot.ogg", "laser.ogg", "lasershot.ogg",
|
"respawn.ogg", "purchase.ogg", "flame2.ogg", "bigshot.ogg", "laser.ogg", "lasershot.ogg",
|
||||||
"ping.ogg", "tesla.ogg", "waveend.ogg", "railgun.ogg", "blast.ogg", "bang2.ogg");
|
"ping.ogg", "tesla.ogg", "waveend.ogg", "railgun.ogg", "blast.ogg", "bang2.ogg");
|
||||||
|
|
||||||
Sounds.setFalloff(9000f);
|
Sounds.setFalloff(9000f);
|
||||||
|
|
||||||
Musics.load("1.ogg", "2.ogg", "3.ogg", "4.ogg");
|
Musics.load("1.ogg", "2.ogg", "3.ogg", "4.ogg");
|
||||||
|
|
||||||
DefaultKeybinds.load();
|
DefaultKeybinds.load();
|
||||||
|
|
||||||
for(int i = 0; i < saveSlots; i ++){
|
for(int i = 0; i < saveSlots; i ++){
|
||||||
Settings.defaults("save-" + i + "-autosave", !gwt);
|
Settings.defaults("save-" + i + "-autosave", !gwt);
|
||||||
Settings.defaults("save-" + i + "-name", "untitled");
|
Settings.defaults("save-" + i + "-name", "untitled");
|
||||||
@@ -124,11 +124,11 @@ public class Control extends Module{
|
|||||||
);
|
);
|
||||||
|
|
||||||
KeyBinds.load();
|
KeyBinds.load();
|
||||||
|
|
||||||
for(Map map : world.maps().list()){
|
for(Map map : world.maps().list()){
|
||||||
Settings.defaults("hiscore" + map.name, 0);
|
Settings.defaults("hiscore" + map.name, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
player = new Player();
|
player = new Player();
|
||||||
player.name = Settings.getString("name");
|
player.name = Settings.getString("name");
|
||||||
player.isAndroid = android;
|
player.isAndroid = android;
|
||||||
@@ -167,6 +167,7 @@ public class Control extends Module{
|
|||||||
|
|
||||||
ui.hudfrag.updateItems();
|
ui.hudfrag.updateItems();
|
||||||
ui.hudfrag.updateWeapons();
|
ui.hudfrag.updateWeapons();
|
||||||
|
ui.hudfrag.fadeRespawn(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.on(WaveEvent.class, () -> {
|
Events.on(WaveEvent.class, () -> {
|
||||||
@@ -212,24 +213,24 @@ public class Control extends Module{
|
|||||||
public boolean showCursor(){
|
public boolean showCursor(){
|
||||||
return controlling;
|
return controlling;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputHandler input(){
|
public InputHandler input(){
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playMap(Map map){
|
public void playMap(Map map){
|
||||||
ui.loadfrag.show();
|
ui.loadfrag.show();
|
||||||
saves.resetSave();
|
saves.resetSave();
|
||||||
|
|
||||||
Timers.runTask(10, () -> {
|
Timers.runTask(10, () -> {
|
||||||
logic.reset();
|
logic.reset();
|
||||||
world.loadMap(map);
|
world.loadMap(map);
|
||||||
logic.play();
|
logic.play();
|
||||||
});
|
});
|
||||||
|
|
||||||
Timers.runTask(18, () -> ui.loadfrag.hide());
|
Timers.runTask(18, () -> ui.loadfrag.hide());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHighScore(){
|
public boolean isHighScore(){
|
||||||
return hiscore;
|
return hiscore;
|
||||||
}
|
}
|
||||||
@@ -237,11 +238,11 @@ public class Control extends Module{
|
|||||||
public float getRespawnTime(){
|
public float getRespawnTime(){
|
||||||
return respawntime;
|
return respawntime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRespawnTime(float respawntime){
|
public void setRespawnTime(float respawntime){
|
||||||
this.respawntime = respawntime;
|
this.respawntime = respawntime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tutorial tutorial(){
|
public Tutorial tutorial(){
|
||||||
return tutorial;
|
return tutorial;
|
||||||
}
|
}
|
||||||
@@ -268,24 +269,24 @@ public class Control extends Module{
|
|||||||
Platform.instance.onGameExit();
|
Platform.instance.onGameExit();
|
||||||
Net.dispose();
|
Net.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pause(){
|
public void pause(){
|
||||||
wasPaused = state.is(State.paused);
|
wasPaused = state.is(State.paused);
|
||||||
if(state.is(State.playing)) state.set(State.paused);
|
if(state.is(State.playing)) state.set(State.paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resume(){
|
public void resume(){
|
||||||
if(state.is(State.paused) && !wasPaused){
|
if(state.is(State.paused) && !wasPaused){
|
||||||
state.set(State.playing);
|
state.set(State.playing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
Timers.run(1f, Musics::shuffleAll);
|
Timers.run(1f, Musics::shuffleAll);
|
||||||
|
|
||||||
Entities.initPhysics();
|
Entities.initPhysics();
|
||||||
Entities.collisions().setCollider(tilesize, world::solid);
|
Entities.collisions().setCollider(tilesize, world::solid);
|
||||||
|
|
||||||
@@ -293,7 +294,7 @@ public class Control extends Module{
|
|||||||
|
|
||||||
checkOldUser();
|
checkOldUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
|
|
||||||
@@ -345,19 +346,19 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
saves.update();
|
saves.update();
|
||||||
|
|
||||||
if(state.inventory.isUpdated() && (Timers.get("updateItems", 8) || state.is(State.paused))){
|
if(state.inventory.isUpdated() && (Timers.get("updateItems", 8) || state.is(State.paused))){
|
||||||
ui.hudfrag.updateItems();
|
ui.hudfrag.updateItems();
|
||||||
state.inventory.setUpdated(false);
|
state.inventory.setUpdated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!state.is(State.menu)){
|
if(!state.is(State.menu)){
|
||||||
input.update();
|
input.update();
|
||||||
|
|
||||||
if(Inputs.keyTap("pause") && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
if(Inputs.keyTap("pause") && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
||||||
state.set(state.is(State.playing) ? State.paused : State.playing);
|
state.set(state.is(State.playing) ? State.paused : State.playing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Inputs.keyTap("menu")){
|
if(Inputs.keyTap("menu")){
|
||||||
if(state.is(State.paused)){
|
if(state.is(State.paused)){
|
||||||
ui.paused.hide();
|
ui.paused.hide();
|
||||||
@@ -371,14 +372,14 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!state.is(State.paused) || Net.active()){
|
if(!state.is(State.paused) || Net.active()){
|
||||||
Entities.update(effectGroup);
|
Entities.update(effectGroup);
|
||||||
|
|
||||||
if(respawntime > 0){
|
if(respawntime > 0){
|
||||||
|
|
||||||
respawntime -= delta();
|
respawntime -= delta();
|
||||||
|
|
||||||
if(respawntime <= 0){
|
if(respawntime <= 0){
|
||||||
player.set(world.getSpawnX(), world.getSpawnY());
|
player.set(world.getSpawnX(), world.getSpawnY());
|
||||||
player.heal();
|
player.heal();
|
||||||
@@ -387,7 +388,7 @@ public class Control extends Module{
|
|||||||
ui.hudfrag.fadeRespawn(false);
|
ui.hudfrag.fadeRespawn(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tutorial.active()){
|
if(tutorial.active()){
|
||||||
tutorial.update();
|
tutorial.update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.BlockBar;
|
import io.anuke.mindustry.world.BlockBar;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class Router extends Block{
|
public class Router extends Block{
|
||||||
@@ -34,14 +35,19 @@ public class Router extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
tile.setRotation((byte)Mathf.mod(tile.getRotation(), 4));
|
tile.setRotation((byte)Mathf.mod(tile.getRotation(), 4));
|
||||||
|
|
||||||
if(tile.entity.totalItems() > 0){
|
int iterations = Math.max(1, (int) (Timers.delta() + 0.4f));
|
||||||
if(tile.getExtra() != tile.getRotation()
|
|
||||||
|| Mathf.chance(0.35)){ //sometimes dump backwards at a 1/4 chance... this somehow works?
|
for(int i = 0; i < iterations; i ++) {
|
||||||
tryDump(tile, tile.getRotation(), null);
|
|
||||||
|
if (tile.entity.totalItems() > 0) {
|
||||||
|
if (tile.getExtra() != tile.getRotation()
|
||||||
|
|| Mathf.chance(0.35)) { //sometimes dump backwards at a 1/4 chance... this somehow works?
|
||||||
|
tryDump(tile, tile.getRotation(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
tile.setRotation((byte) ((tile.getRotation() + 1) % 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
tile.setRotation((byte)((tile.getRotation() + 1) % 4));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user