Temporary loading screen
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.Texture;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.SpriteBatch;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.util.Log;
|
||||
import io.anuke.arc.util.Time;
|
||||
@@ -8,6 +12,7 @@ import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.game.EventType.GameLoadEvent;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
|
||||
import static io.anuke.arc.Core.batch;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Mindustry extends ApplicationCore{
|
||||
@@ -21,27 +26,38 @@ public class Mindustry extends ApplicationCore{
|
||||
|
||||
Time.mark();
|
||||
|
||||
Vars.init();
|
||||
Log.setUseColors(false);
|
||||
BundleLoader.load();
|
||||
content.load();
|
||||
content.loadColors();
|
||||
batch = new SpriteBatch();
|
||||
|
||||
add(logic = new Logic());
|
||||
add(world = new World());
|
||||
add(control = new Control());
|
||||
add(renderer = new Renderer());
|
||||
add(ui = new UI());
|
||||
add(netServer = new NetServer());
|
||||
add(netClient = new NetClient());
|
||||
Core.app.post(() -> Core.app.post(() -> {
|
||||
drawLoading();
|
||||
Core.app.post(() -> Core.app.post(() -> {
|
||||
Vars.init();
|
||||
Log.setUseColors(false);
|
||||
BundleLoader.load();
|
||||
content.load();
|
||||
content.loadColors();
|
||||
|
||||
add(logic = new Logic());
|
||||
add(world = new World());
|
||||
add(control = new Control());
|
||||
add(renderer = new Renderer());
|
||||
add(ui = new UI());
|
||||
add(netServer = new NetServer());
|
||||
add(netClient = new NetClient());
|
||||
|
||||
for(ApplicationListener listener : modules){
|
||||
listener.init();
|
||||
}
|
||||
|
||||
Log.info("Time to load [total]: {0}", Time.elapsed());
|
||||
Events.fire(new GameLoadEvent());
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
super.init();
|
||||
|
||||
Log.info("Time to load [total]: {0}", Time.elapsed());
|
||||
Events.fire(new GameLoadEvent());
|
||||
setup();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,4 +81,15 @@ public class Mindustry extends ApplicationCore{
|
||||
}
|
||||
}
|
||||
|
||||
void drawLoading(){
|
||||
Core.graphics.clear(Color.BLACK);
|
||||
Draw.proj().setOrtho(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||
|
||||
Texture icon = new Texture("sprites/logotext.png");
|
||||
Draw.rect(Draw.wrap(icon), Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f);
|
||||
Draw.flush();
|
||||
|
||||
icon.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class Renderer implements ApplicationListener{
|
||||
private float shakeIntensity, shaketime;
|
||||
|
||||
public Renderer(){
|
||||
batch = new SpriteBatch(4096);
|
||||
camera = new Camera();
|
||||
Lines.setCircleVertices(20);
|
||||
Shaders.init();
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Rules{
|
||||
/** No-build zone around enemy core radius. */
|
||||
public float enemyCoreBuildRadius = 400f;
|
||||
/** Radius around enemy wave drop zones.*/
|
||||
public float dropZoneRadius = 380f;
|
||||
public float dropZoneRadius = 300f;
|
||||
/** Player respawn time in ticks. */
|
||||
public float respawnTime = 60 * 4;
|
||||
/** Time between waves in ticks. */
|
||||
|
||||
Reference in New Issue
Block a user