1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-21 13:28:12 +03:00

Added tutorial map and useless tutorial button

This commit is contained in:
Anuken 2017-10-13 17:19:12 -04:00
parent 0decc18d76
commit c167e117c0
9 changed files with 25 additions and 22 deletions

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -47,9 +47,7 @@ public class Control extends Module{
float respawntime;
public Control(){
String[] args = Mindustry.args;
if(args.length > 0 && args[0].equals("-debug")){
if(Mindustry.args.contains("-debug", false)){
Vars.debug = true;
}

View File

@ -2,6 +2,8 @@ package io.anuke.mindustry;
import java.util.Date;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.GameState.State;
import io.anuke.mindustry.io.Formatter;
import io.anuke.ucore.core.Inputs;
@ -9,7 +11,7 @@ import io.anuke.ucore.core.Timers;
import io.anuke.ucore.modules.ModuleCore;
public class Mindustry extends ModuleCore {
public static String[] args = {};
public static Array<String> args = new Array<>();
public static Formatter formatter = new Formatter(){
@Override

View File

@ -40,7 +40,7 @@ public class Renderer extends RendererModule{
Core.cameraScale = baseCameraScale;
pixelate();
Draw.addSurface("shadow", Core.cameraScale);
Graphics.addSurface("shadow", Core.cameraScale);
Shaders.create();
}
@ -141,7 +141,7 @@ public class Renderer extends RendererModule{
OrthographicCamera camera = Core.camera;
Draw.end();
Graphics.end();
int crangex = (int) (camera.viewportWidth / (chunksize * tilesize)) + 1;
int crangey = (int) (camera.viewportHeight / (chunksize * tilesize)) + 1;
@ -162,7 +162,7 @@ public class Renderer extends RendererModule{
}
}
Draw.begin();
Graphics.begin();
Draw.reset();
int rangex = (int) (camera.viewportWidth * camera.zoom / tilesize / 2) + 2;
@ -175,7 +175,7 @@ public class Renderer extends RendererModule{
//2 = over blocks
for(int l = (noshadows ? 1 : 0); l < 3; l++){
if(l == 0){
Draw.surface("shadow");
Graphics.surface("shadow");
}
for(int x = -rangex; x <= rangex; x++){
@ -200,7 +200,7 @@ public class Renderer extends RendererModule{
if(l == 0){
Draw.color(0, 0, 0, 0.15f);
Draw.flushSurface();
Graphics.flushSurface();
Draw.color();
}
}
@ -348,8 +348,8 @@ public class Renderer extends RendererModule{
public void setCameraScale(int amount){
targetscale = amount;
clampScale();
Draw.getSurface("pixel").setScale(targetscale);
Draw.getSurface("shadow").setScale(targetscale);
Graphics.getSurface("pixel").setScale(targetscale);
Graphics.getSurface("shadow").setScale(targetscale);
}
public void scaleCamera(int amount){

View File

@ -80,7 +80,7 @@ public class UI extends SceneModule{
TextureRegion back = Draw.region("background");
float backscl = 5;
Draw.batch().draw(back, w/2 - back.getRegionWidth()*backscl/2, h/2 - back.getRegionHeight()*backscl/2,
Core.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);
@ -89,7 +89,7 @@ public class UI extends SceneModule{
float logoh = logo.getRegionHeight()*logoscl;
Draw.color();
Draw.batch().draw(logo, w/2 - logow/2, h - logoh + 15, logow, logoh);
Core.batch.draw(logo, w/2 - logow/2, h - logoh + 15, logow, logoh);
Draw.color();
@ -386,6 +386,10 @@ public class UI extends SceneModule{
levels.show();
});
new button("Tutorial", ()->{
//TODO
});
if(Gdx.app.getType() != ApplicationType.WebGL){
row();

View File

@ -12,9 +12,7 @@ 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.core.*;
import io.anuke.ucore.entities.*;
import io.anuke.ucore.util.Mathf;
@ -173,12 +171,12 @@ public class Enemy extends DestructibleEntity{
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + Mathf.clamp(tier, 1, 3);
//TODO is this really necessary?
Draw.getShader(Outline.class).color.set(tierColors[tier-1]);
Draw.getShader(Outline.class).region = Draw.region(region);
Graphics.getShader(Outline.class).color.set(tierColors[tier-1]);
Graphics.getShader(Outline.class).region = Draw.region(region);
Draw.shader(Outline.class);
Graphics.shader(Outline.class);
Draw.color();
Draw.rect(region, x, y, direction.angle()-90);
Draw.shader();
Graphics.shader();
}
}

View File

@ -6,6 +6,7 @@ import java.util.Date;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Mindustry;
import io.anuke.mindustry.io.Formatter;
@ -34,7 +35,7 @@ public class DesktopLauncher {
}
};
Mindustry.args = arg;
Mindustry.args = Array.with(arg);
new Lwjgl3Application(new Mindustry(), config);
}