New tutorial section on tunnels, fixed tutorial bugs
This commit is contained in:
@@ -15,6 +15,7 @@ import io.anuke.mindustry.entities.effect.Shield;
|
||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.game.Tutorial;
|
||||
import io.anuke.mindustry.graphics.Fx;
|
||||
import io.anuke.mindustry.input.AndroidInput;
|
||||
import io.anuke.mindustry.input.DesktopInput;
|
||||
@@ -46,7 +47,7 @@ import java.util.Arrays;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Control extends Module{
|
||||
Tutorial tutorial = new Tutorial();
|
||||
io.anuke.mindustry.game.Tutorial tutorial = new io.anuke.mindustry.game.Tutorial();
|
||||
boolean hiscore = false;
|
||||
|
||||
final Array<Weapon> weapons = new Array<>();
|
||||
|
||||
@@ -16,13 +16,13 @@ public class TargetType extends EnemyType {
|
||||
super("targetenemy");
|
||||
|
||||
speed = 0f;
|
||||
health = 25;
|
||||
health = 40;
|
||||
shootsound = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move(Enemy enemy){
|
||||
super.move(enemy);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package io.anuke.mindustry.core;
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
@@ -72,7 +73,7 @@ public class Tutorial{
|
||||
//info.setText(stage.text);
|
||||
|
||||
if(stage.showBlock){
|
||||
Tile tile = world.tile(control.core.x + stage.blockPlaceX, control.core.y + stage.blockPlaceY);
|
||||
Tile tile = world.tile(control.getCore().x + stage.blockPlaceX, control.getCore().y + stage.blockPlaceY);
|
||||
|
||||
if(tile.block() == stage.targetBlock && (tile.getRotation() == stage.blockRotation || stage.blockRotation == -1)){
|
||||
move(true);
|
||||
@@ -156,8 +157,8 @@ public class Tutorial{
|
||||
world.tile(corex, corey - 3).setBlock(Blocks.air);
|
||||
world.tile(corex, corey - 3).setFloor(Blocks.stone);
|
||||
|
||||
world.tile(corex + 1, corey - 7).setFloor(Blocks.iron);
|
||||
world.tile(corex - 1, corey - 7).setFloor(Blocks.coal);
|
||||
world.tile(corex + 1, corey - 8).setFloor(Blocks.iron);
|
||||
world.tile(corex - 1, corey - 8).setFloor(Blocks.coal);
|
||||
|
||||
int r = 10;
|
||||
|
||||
@@ -290,12 +291,12 @@ public class Tutorial{
|
||||
|
||||
void onSwitch(){
|
||||
for(int flip : new int[]{1, -1}){
|
||||
world.tile(control.core.x + flip, control.core.y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.core.x + flip*2, control.core.y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.core.x + flip*2, control.core.y - 3).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.core.x + flip*2, control.core.y - 3).setBlock(DistributionBlocks.conveyor, 1);
|
||||
world.tile(control.core.x + flip*2, control.core.y - 4).setFloor(Blocks.stone);
|
||||
world.tile(control.core.x + flip*2, control.core.y - 4).setBlock(ProductionBlocks.stonedrill);
|
||||
world.tile(control.getCore().x + flip, control.getCore().y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.getCore().x + flip*2, control.getCore().y - 2).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.getCore().x + flip*2, control.getCore().y - 3).setBlock(DistributionBlocks.conveyor, 2 * flip);
|
||||
world.tile(control.getCore().x + flip*2, control.getCore().y - 3).setBlock(DistributionBlocks.conveyor, 1);
|
||||
world.tile(control.getCore().x + flip*2, control.getCore().y - 4).setFloor(Blocks.stone);
|
||||
world.tile(control.getCore().x + flip*2, control.getCore().y - 4).setBlock(ProductionBlocks.stonedrill);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -344,7 +345,7 @@ public class Tutorial{
|
||||
|
||||
void onSwitch(){
|
||||
for(int i = 0; i < 4; i ++){
|
||||
world.tile(control.core.x + 2, control.core.y - 2 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||
world.tile(control.getCore().x + 2, control.getCore().y - 2 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||
}
|
||||
|
||||
control.getInput().recipe = null;
|
||||
@@ -454,7 +455,7 @@ public class Tutorial{
|
||||
|
||||
void onSwitch(){
|
||||
Vars.ui.<ImageButton>find("sectionbuttondistribution").fireClick();
|
||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
||||
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||
}
|
||||
},
|
||||
conduitUse2{
|
||||
@@ -470,7 +471,7 @@ public class Tutorial{
|
||||
}
|
||||
|
||||
void onSwitch(){
|
||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
||||
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||
}
|
||||
},
|
||||
conduitUse3{
|
||||
@@ -486,7 +487,7 @@ public class Tutorial{
|
||||
}
|
||||
|
||||
void onSwitch(){
|
||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
||||
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||
}
|
||||
},
|
||||
generator{
|
||||
@@ -501,7 +502,7 @@ public class Tutorial{
|
||||
}
|
||||
|
||||
void onSwitch(){
|
||||
world.tile(blockPlaceX + control.core.x, blockPlaceY + control.core.y).setBlock(Blocks.air);
|
||||
world.tile(blockPlaceX + control.getCore().x, blockPlaceY + control.getCore().y).setBlock(Blocks.air);
|
||||
Vars.ui.<ImageButton>find("sectionbuttonpower").fireClick();
|
||||
Vars.control.addItem(Item.steel, 60);
|
||||
Vars.control.addItem(Item.iron, 60);
|
||||
@@ -567,7 +568,7 @@ public class Tutorial{
|
||||
canPlace = true;
|
||||
canBack = false;
|
||||
blockPlaceX = 0;
|
||||
blockPlaceY = -6;
|
||||
blockPlaceY = -7;
|
||||
targetBlock = ProductionBlocks.smelter;
|
||||
}
|
||||
|
||||
@@ -584,14 +585,24 @@ public class Tutorial{
|
||||
}
|
||||
|
||||
void onSwitch(){
|
||||
for(int i = 0; i < 4; i ++){
|
||||
world.tile(control.core.x, control.core.y - 5 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||
for(int i = 0; i < 5; i ++){
|
||||
world.tile(control.getCore().x, control.getCore().y - 6 + i).setBlock(DistributionBlocks.conveyor, 1);
|
||||
}
|
||||
world.tile(control.core.x+1, control.core.y - 7).setBlock(ProductionBlocks.irondrill);
|
||||
world.tile(control.core.x-1, control.core.y - 7).setBlock(ProductionBlocks.coaldrill);
|
||||
|
||||
world.tile(control.getCore().x, control.getCore().y - 6 + 1).setBlock(DistributionBlocks.tunnel, 3);
|
||||
world.tile(control.getCore().x, control.getCore().y - 6 + 2).setBlock(DefenseBlocks.stonewall, 0);
|
||||
world.tile(control.getCore().x, control.getCore().y - 6 + 3).setBlock(DistributionBlocks.tunnel, 1);
|
||||
|
||||
world.tile(control.getCore().x+1, control.getCore().y - 8).setBlock(ProductionBlocks.irondrill);
|
||||
world.tile(control.getCore().x-1, control.getCore().y - 8).setBlock(ProductionBlocks.coaldrill);
|
||||
|
||||
world.tile(control.core.x+1, control.core.y - 6).setBlock(DistributionBlocks.conveyor, 2);
|
||||
world.tile(control.core.x-1, control.core.y - 6).setBlock(DistributionBlocks.conveyor, 0);
|
||||
world.tile(control.getCore().x+1, control.getCore().y - 7).setBlock(DistributionBlocks.conveyor, 2);
|
||||
world.tile(control.getCore().x-1, control.getCore().y - 7).setBlock(DistributionBlocks.conveyor, 0);
|
||||
}
|
||||
},
|
||||
tunnelExplain{
|
||||
{
|
||||
canBack = false;
|
||||
}
|
||||
},
|
||||
end{
|
||||
@@ -4,8 +4,8 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.Tutorial;
|
||||
import io.anuke.mindustry.core.Tutorial.Stage;
|
||||
import io.anuke.mindustry.game.Tutorial;
|
||||
import io.anuke.mindustry.game.Tutorial.Stage;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import io.anuke.ucore.UCore;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.function.Listenable;
|
||||
import io.anuke.ucore.scene.ui.Button;
|
||||
@@ -9,22 +8,37 @@ import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class MenuButton extends Button{
|
||||
private static boolean hasInvalid = false;
|
||||
private String text;
|
||||
private boolean added = false;
|
||||
|
||||
public MenuButton(String text, PressGroup group, Listenable clicked){
|
||||
super("menu");
|
||||
String style = "title";
|
||||
float scale = 4f;
|
||||
this.text = text;
|
||||
BitmapFont font = Core.skin.getFont("title");
|
||||
for(char c : Bundles.get(text.substring(1)).toCharArray()){
|
||||
if(!font.getData().hasGlyph(c)){
|
||||
UCore.log("No glyph found: " + c);
|
||||
style = "default";
|
||||
scale = Unit.dp.scl(1f);
|
||||
hasInvalid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
add(text, style, scale);
|
||||
clicked(clicked);
|
||||
group.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layout() {
|
||||
super.layout();
|
||||
if(added)
|
||||
return;
|
||||
added = true;
|
||||
String style = "title";
|
||||
float scale = 4f;
|
||||
BitmapFont font = Core.skin.getFont("title");
|
||||
if(hasInvalid){
|
||||
style = "default";
|
||||
scale = Unit.dp.scl(1f);
|
||||
}
|
||||
add(text, style, scale);
|
||||
}
|
||||
}
|
||||
|
||||
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
12
core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class LanguageDialog extends FloatingDialog{
|
||||
private Locale[] locales = {Locale.ENGLISH, Locale.FRENCH, new Locale("es", "LA"), new Locale("pt", "BR")};
|
||||
|
||||
public LanguageDialog(){
|
||||
super("$text.language");
|
||||
addCloseButton();
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
void addSettings(){
|
||||
sound.volumePrefs();
|
||||
|
||||
//game.sliderPref("difficulty", 1, 0, Difficulty.values().length-1, i -> Difficulty.values()[i].toString());
|
||||
game.screenshakePref();
|
||||
game.checkPref("smoothcam", true);
|
||||
game.checkPref("effects", true);
|
||||
|
||||
Reference in New Issue
Block a user