Filled map list, added more blocks
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 315 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 378 B |
BIN
core/assets-raw/sprites/ui/icon-quit.png
Normal file
|
After Width: | Height: | Size: 199 B |
BIN
core/assets-raw/sprites/ui/icon-save.png
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
core/assets/maps/arena.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.4 KiB |
BIN
core/assets/maps/islands.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
BIN
core/assets/maps/out-1512092193155.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
core/assets/maps/out-1512096271461.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
core/assets/maps/scorch.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
core/assets/maps/spiral.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
@@ -11,8 +11,9 @@ import io.anuke.mindustry.world.World;
|
|||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class Vars{
|
public class Vars{
|
||||||
|
public static final boolean testAndroid = false;
|
||||||
//shorthand for whether or not this is running on android
|
//shorthand for whether or not this is running on android
|
||||||
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android);
|
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid;
|
||||||
//shorthand for whether or not this is running on GWT
|
//shorthand for whether or not this is running on GWT
|
||||||
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
|
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
|
||||||
//how far away from the player blocks can be placed
|
//how far away from the player blocks can be placed
|
||||||
|
|||||||
@@ -30,21 +30,24 @@ public class EditorControl extends Module{
|
|||||||
RidgedPerlin rid = new RidgedPerlin(1, 10, 20f);
|
RidgedPerlin rid = new RidgedPerlin(1, 10, 20f);
|
||||||
RidgedPerlin rid2 = new RidgedPerlin(1, 6, 1f);
|
RidgedPerlin rid2 = new RidgedPerlin(1, 6, 1f);
|
||||||
RidgedPerlin rid3 = new RidgedPerlin(1, 6, 1f);
|
RidgedPerlin rid3 = new RidgedPerlin(1, 6, 1f);
|
||||||
String map = "volcano";
|
String map = "fortress";
|
||||||
ObjectMap<String, Boolean> prefs = new OrderedMap<String, Boolean>(){
|
ObjectMap<String, Boolean> prefs = new OrderedMap<String, Boolean>(){
|
||||||
{
|
{
|
||||||
put("replace", true);
|
put("replace", true);
|
||||||
put("terrain", false);
|
put("terrain", false);
|
||||||
|
put("circle", false);
|
||||||
put("distort", false);
|
put("distort", false);
|
||||||
put("sand", false);
|
put("sand", false);
|
||||||
put("grass", false);
|
put("grass", false);
|
||||||
put("stone", false);
|
put("stone", false);
|
||||||
put("allgrass", false);
|
put("allgrass", false);
|
||||||
put("allsnow", false);
|
put("allsnow", false);
|
||||||
|
put("allsand", false);
|
||||||
put("lavarock", false);
|
put("lavarock", false);
|
||||||
put("water", false);
|
put("water", false);
|
||||||
put("oil", false);
|
put("oil", false);
|
||||||
put("lavariver", false);
|
put("lavariver", false);
|
||||||
|
put("slavariver", false);
|
||||||
put("river", false);
|
put("river", false);
|
||||||
put("iceriver", false);
|
put("iceriver", false);
|
||||||
put("oilriver", false);
|
put("oilriver", false);
|
||||||
@@ -102,7 +105,7 @@ public class EditorControl extends Module{
|
|||||||
for(int x = 0; x < pixmap.getWidth(); x++){
|
for(int x = 0; x < pixmap.getWidth(); x++){
|
||||||
for(int y = 0; y < pixmap.getHeight(); y++){
|
for(int y = 0; y < pixmap.getHeight(); y++){
|
||||||
float dist = Vector2.dst((float) x / pixmap.getWidth(), (float) y / pixmap.getHeight(), 0.5f, 0.5f) * 2f;
|
float dist = Vector2.dst((float) x / pixmap.getWidth(), (float) y / pixmap.getHeight(), 0.5f, 0.5f) * 2f;
|
||||||
double noise = sim.octaveNoise2D(5, 0.6, 1 / 150.0, x, y + 9999) + dist / 10f;
|
double noise = sim.octaveNoise2D(6, 0.6, 1 / 180.0, x, y + 9999) / (prefs.get("circle") ? 1.7 : 1f) + dist / 10f;
|
||||||
|
|
||||||
if(dist > 0.8){
|
if(dist > 0.8){
|
||||||
noise += 2 * (dist - 0.8);
|
noise += 2 * (dist - 0.8);
|
||||||
@@ -122,10 +125,10 @@ public class EditorControl extends Module{
|
|||||||
int dx = 0, dy = 0;
|
int dx = 0, dy = 0;
|
||||||
|
|
||||||
if(prefs.get("distort")){
|
if(prefs.get("distort")){
|
||||||
double intensity = 10;
|
double intensity = 12;
|
||||||
double scale = 80;
|
double scale = 80;
|
||||||
double octaves = 3;
|
double octaves = 4;
|
||||||
double falloff = 0.7;
|
double falloff = 0.6;
|
||||||
double nx = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y) - 0.5f) * intensity;
|
double nx = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y) - 0.5f) * intensity;
|
||||||
double ny = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y + 99999) - 0.5f) * intensity;
|
double ny = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y + 99999) - 0.5f) * intensity;
|
||||||
dx = (int) nx;
|
dx = (int) nx;
|
||||||
@@ -148,23 +151,27 @@ public class EditorControl extends Module{
|
|||||||
double noil = sim.octaveNoise2D(1, 1.0, 1 / 150.0, x + 9999, y) + sim.octaveNoise2D(1, 1.0, 1 / 2.0, x, y) / 290.0;
|
double noil = sim.octaveNoise2D(1, 1.0, 1 / 150.0, x + 9999, y) + sim.octaveNoise2D(1, 1.0, 1 / 2.0, x, y) / 290.0;
|
||||||
|
|
||||||
if(!floor || prefs.get("replace")){
|
if(!floor || prefs.get("replace")){
|
||||||
|
|
||||||
if(prefs.get("allgrass")){
|
if(prefs.get("allgrass")){
|
||||||
block = floor ? Blocks.grass : Blocks.grassblock;
|
block = floor ? Blocks.grass : Blocks.grassblock;
|
||||||
}
|
}else if(prefs.get("allsnow")){
|
||||||
|
|
||||||
if(prefs.get("allsnow")){
|
|
||||||
block = floor ? Blocks.snow : Blocks.snowblock;
|
block = floor ? Blocks.snow : Blocks.snowblock;
|
||||||
|
}else if(prefs.get("allsand")){
|
||||||
|
block = floor ? Blocks.sand : Blocks.sandblock;
|
||||||
|
}else if(prefs.get("replace")){
|
||||||
|
block = floor ? Blocks.stone : Blocks.stoneblock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(noise > 0.7 && prefs.get("grass")){
|
if(noise > 0.7 && prefs.get("grass")){
|
||||||
block = floor ? Blocks.grass : Blocks.grassblock;
|
block = floor ? Blocks.grass : Blocks.grassblock;
|
||||||
}else if(noise > 0.7 && prefs.get("lavarock")){
|
}
|
||||||
|
if(noise > 0.7 && prefs.get("lavarock")){
|
||||||
block = floor ? Blocks.blackstone : Blocks.blackstoneblock;
|
block = floor ? Blocks.blackstone : Blocks.blackstoneblock;
|
||||||
}else if(noise > 0.7 && prefs.get("sand")){
|
}
|
||||||
|
if(noise > 0.7 && prefs.get("sand")){
|
||||||
block = floor ? Blocks.sand : Blocks.sandblock;
|
block = floor ? Blocks.sand : Blocks.sandblock;
|
||||||
}else if(noise > 0.8 && prefs.get("stone")){
|
}
|
||||||
block = floor ? Blocks.stone : Blocks.stoneblock;
|
if(noise > 0.8 && prefs.get("stone")){
|
||||||
}else if(prefs.get("replace") && !prefs.get("allgrass") && !prefs.get("allsnow")){
|
|
||||||
block = floor ? Blocks.stone : Blocks.stoneblock;
|
block = floor ? Blocks.stone : Blocks.stoneblock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,6 +202,16 @@ public class EditorControl extends Module{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(floor && prefs.get("slavariver")){
|
||||||
|
double lava = rid.getValue(x, y, 1 / 40f);
|
||||||
|
double t = 0.7;
|
||||||
|
if(lava > t){
|
||||||
|
block = Blocks.lava;
|
||||||
|
}else if(lava > t - 0.3){
|
||||||
|
block = Blocks.blackstone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(floor && prefs.get("oilriver")){
|
if(floor && prefs.get("oilriver")){
|
||||||
double lava = rid3.getValue(x, y, 1 / 100f);
|
double lava = rid3.getValue(x, y, 1 / 100f);
|
||||||
double t = 0.9;
|
double t = 0.9;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
|||||||
import io.anuke.ucore.scene.utils.Elements;
|
import io.anuke.ucore.scene.utils.Elements;
|
||||||
|
|
||||||
public class LevelDialog extends FloatingDialog{
|
public class LevelDialog extends FloatingDialog{
|
||||||
private Map selectedMap = Map.delta;
|
private Map selectedMap = Map.maze;
|
||||||
private TextureRegion region = new TextureRegion();
|
private TextureRegion region = new TextureRegion();
|
||||||
|
|
||||||
public LevelDialog(){
|
public LevelDialog(){
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.GameState;
|
import io.anuke.mindustry.core.GameState;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
|
import io.anuke.ucore.scene.builders.build;
|
||||||
|
import io.anuke.ucore.scene.builders.imagebutton;
|
||||||
import io.anuke.ucore.scene.ui.ConfirmDialog;
|
import io.anuke.ucore.scene.ui.ConfirmDialog;
|
||||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
import io.anuke.ucore.scene.ui.layout.Cell;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
@@ -17,58 +19,85 @@ public class MenuDialog extends FloatingDialog{
|
|||||||
private LoadDialog load = new LoadDialog();
|
private LoadDialog load = new LoadDialog();
|
||||||
public boolean wasPaused = false;
|
public boolean wasPaused = false;
|
||||||
|
|
||||||
public MenuDialog(){
|
public MenuDialog() {
|
||||||
super("Paused");
|
super("Paused");
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
content().defaults().width(220).height(50).units(Unit.dp);
|
shown(() -> {
|
||||||
|
|
||||||
content().addButton("Back", ()->{
|
|
||||||
hide();
|
|
||||||
if(!wasPaused)
|
|
||||||
GameState.set(State.playing);
|
|
||||||
});
|
|
||||||
|
|
||||||
shown(()->{
|
|
||||||
wasPaused = GameState.is(State.paused);
|
wasPaused = GameState.is(State.paused);
|
||||||
GameState.set(State.paused);
|
GameState.set(State.paused);
|
||||||
});
|
});
|
||||||
|
|
||||||
content().row();
|
|
||||||
content().addButton("Settings", ()->{
|
|
||||||
ui.showPrefs();
|
|
||||||
});
|
|
||||||
|
|
||||||
if(!Vars.android){
|
if(!Vars.android){
|
||||||
content().row();
|
content().defaults().width(220).height(50).units(Unit.dp);
|
||||||
content().addButton("Controls", ()->{
|
|
||||||
ui.showControls();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Gdx.app.getType() != ApplicationType.WebGL){
|
content().addButton("Back", () -> {
|
||||||
content().row();
|
|
||||||
content().addButton("Save Game", ()->{
|
|
||||||
save.show();
|
|
||||||
});
|
|
||||||
|
|
||||||
content().row();
|
|
||||||
content().addButton("Load Game", ()->{
|
|
||||||
load.show();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
content().row();
|
|
||||||
content().addButton("Back to menu", ()->{
|
|
||||||
new ConfirmDialog("Confirm", "Are you sure you want to quit?", ()->{
|
|
||||||
hide();
|
hide();
|
||||||
GameState.set(State.menu);
|
if(!wasPaused)
|
||||||
}){{
|
GameState.set(State.playing);
|
||||||
for(Cell<?> cell : getButtonTable().getCells())
|
});
|
||||||
cell.pad(3).size(180, 44).units(Unit.dp);
|
|
||||||
}}.show();
|
content().row();
|
||||||
});
|
content().addButton("Settings", () -> {
|
||||||
|
ui.showPrefs();
|
||||||
|
});
|
||||||
|
|
||||||
|
if(Gdx.app.getType() != ApplicationType.WebGL){
|
||||||
|
content().row();
|
||||||
|
content().addButton("Save Game", () -> {
|
||||||
|
save.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
content().row();
|
||||||
|
content().addButton("Load Game", () -> {
|
||||||
|
load.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
content().row();
|
||||||
|
content().addButton("Quit", () -> {
|
||||||
|
new ConfirmDialog("Confirm", "Are you sure you want to quit?", () -> {
|
||||||
|
hide();
|
||||||
|
GameState.set(State.menu);
|
||||||
|
}){
|
||||||
|
{
|
||||||
|
for(Cell<?> cell : getButtonTable().getCells())
|
||||||
|
cell.pad(3).size(180, 44).units(Unit.dp);
|
||||||
|
}
|
||||||
|
}.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{
|
||||||
|
build.begin(content());
|
||||||
|
|
||||||
|
content().defaults().size(120f).pad(5).units(Unit.dp);
|
||||||
|
float isize = Unit.dp.inPixels(14f*4);
|
||||||
|
|
||||||
|
new imagebutton("icon-play-2", isize, () -> {
|
||||||
|
hide();
|
||||||
|
if(!wasPaused)
|
||||||
|
GameState.set(State.playing);
|
||||||
|
}).text("Back").padTop(4f);
|
||||||
|
|
||||||
|
new imagebutton("icon-tools", isize, () -> ui.showPrefs()).text("Settings").padTop(4f);
|
||||||
|
|
||||||
|
new imagebutton("icon-save", isize, ()-> save.show()).text("Save").padTop(4f);
|
||||||
|
|
||||||
|
new imagebutton("icon-load", isize, () -> load.show()).text("Load").padTop(4f);
|
||||||
|
|
||||||
|
new imagebutton("icon-quit", isize, () -> {
|
||||||
|
new ConfirmDialog("Confirm", "Are you sure you want to quit?", () -> {
|
||||||
|
hide();
|
||||||
|
GameState.set(State.menu);
|
||||||
|
}){{
|
||||||
|
for(Cell<?> cell : getButtonTable().getCells())
|
||||||
|
cell.pad(3).size(180, 44).units(Unit.dp);
|
||||||
|
}}.show();
|
||||||
|
}).text("Quit").padTop(4f);
|
||||||
|
|
||||||
|
build.end();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,7 @@ public class MenuFragment implements Fragment{
|
|||||||
|
|
||||||
new imagebutton("icon-play-2", isize, () -> ui.showLevels()).text("Play").padTop(4f);
|
new imagebutton("icon-play-2", isize, () -> ui.showLevels()).text("Play").padTop(4f);
|
||||||
|
|
||||||
new imagebutton("icon-tutorial", isize, ()->{
|
new imagebutton("icon-tutorial", isize, ()-> control.playMap(Map.tutorial)).text("Tutorial").padTop(4f);
|
||||||
control.playMap(Map.tutorial);
|
|
||||||
}).text("Tutorial").padTop(4f);
|
|
||||||
|
|
||||||
new imagebutton("icon-load", isize, () -> ui.showLoadGame()).text("Load").padTop(4f);
|
new imagebutton("icon-load", isize, () -> ui.showLoadGame()).text("Load").padTop(4f);
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ public class Generator{
|
|||||||
floor = Blocks.snow;
|
floor = Blocks.snow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(block == Blocks.sandblock){
|
||||||
|
floor = Blocks.sand;
|
||||||
|
}
|
||||||
|
|
||||||
if(floor == Blocks.grass && Mathf.chance(0.02) && block == Blocks.air){
|
if(floor == Blocks.grass && Mathf.chance(0.02) && block == Blocks.air){
|
||||||
block = Blocks.shrub;
|
block = Blocks.shrub;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,18 @@ package io.anuke.mindustry.world;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
|
||||||
public enum Map{
|
public enum Map{
|
||||||
delta("Starting map."),
|
maze("desc"),
|
||||||
pit("Eck."),
|
fortress("desc"),
|
||||||
canyon("the canyon"),
|
|
||||||
maze("it's okay."),
|
|
||||||
volcano("desc"),
|
|
||||||
fortress("desc", true),
|
|
||||||
sinkhole("desc"),
|
sinkhole("desc"),
|
||||||
volcanic("desc"),
|
caves("desc"),
|
||||||
rooms("desc"),
|
volcano("desc", true),
|
||||||
|
caldera("desc"),
|
||||||
|
scorch("desc", Color.valueOf("e5d8bb")),
|
||||||
desert("desc"),
|
desert("desc"),
|
||||||
grassland("desc"){{
|
islands("desc", Color.valueOf("e5d8bb")),
|
||||||
backgroundColor = Color.valueOf("5ab464");
|
grassland("desc", Color.valueOf("5ab464")),
|
||||||
}},
|
|
||||||
tundra("desc"),
|
tundra("desc"),
|
||||||
|
spiral("desc", Color.valueOf("f7feff")),
|
||||||
tutorial(false),
|
tutorial(false),
|
||||||
test1(false),
|
test1(false),
|
||||||
test2(false),
|
test2(false),
|
||||||
@@ -43,4 +41,9 @@ public enum Map{
|
|||||||
this.flipBase = flipBase;
|
this.flipBase = flipBase;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map(String description, Color background){
|
||||||
|
this(description);
|
||||||
|
backgroundColor = background;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class DistributionBlocks{
|
|||||||
|
|
||||||
conduit = new LiquidBlock("conduit"){{
|
conduit = new LiquidBlock("conduit"){{
|
||||||
fullDescription = "Basic liquid transport block. Works like a conveyor, but with liquids. "
|
fullDescription = "Basic liquid transport block. Works like a conveyor, but with liquids. "
|
||||||
+ "Best used with pumps or other conduits.";
|
+ "Best used with pumps or other conduits. Can be used as a bridge over liquids for enemies and players.";
|
||||||
health = 45;
|
health = 45;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public class DistributionBlocks{
|
|||||||
conveyor = new Conveyor("conveyor"){{
|
conveyor = new Conveyor("conveyor"){{
|
||||||
description = "Moves items.";
|
description = "Moves items.";
|
||||||
fullDescription = "Basic item transport block. Moves items forward and automatically deposits them into turrets or crafters. "
|
fullDescription = "Basic item transport block. Moves items forward and automatically deposits them into turrets or crafters. "
|
||||||
+ "Can be rotated.";
|
+ "Rotatable. Can be used as a bridge over liquids for enemies and players.";
|
||||||
}},
|
}},
|
||||||
|
|
||||||
steelconveyor = new Conveyor("steelconveyor"){{
|
steelconveyor = new Conveyor("steelconveyor"){{
|
||||||
|
|||||||