Project-wide refactoring, link crash fixes
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="60"
|
android:versionCode="61"
|
||||||
android:versionName="3.3b11" >
|
android:versionName="3.3b12" >
|
||||||
|
|
||||||
|
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import android.Manifest;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
@@ -49,13 +48,6 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
return NumberFormat.getIntegerInstance().format(number);
|
return NumberFormat.getIntegerInstance().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openLink(String link){
|
|
||||||
Uri marketUri = Uri.parse(link);
|
|
||||||
Intent intent = new Intent( Intent.ACTION_VIEW, marketUri );
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDialog(TextField field, int length){
|
public void addDialog(TextField field, int length){
|
||||||
TextFieldDialogListener.add(field, 0, length);
|
TextFieldDialogListener.add(field, 0, length);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ allprojects {
|
|||||||
appName = "Mindustry"
|
appName = "Mindustry"
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
aiVersion = '1.8.1'
|
aiVersion = '1.8.1'
|
||||||
uCoreVersion = 'e78aec7';
|
uCoreVersion = '298c4a4';
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -42,7 +42,7 @@ project(":desktop") {
|
|||||||
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||||
compile "com.github.MinnDevelopment:Java-DiscordRPC:dbd4aac"
|
compile 'com.github.MinnDevelopment:java-discord-rpc:v1.3.2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ import io.anuke.ucore.core.Inputs.Axis;
|
|||||||
import io.anuke.ucore.core.Inputs.DeviceType;
|
import io.anuke.ucore.core.Inputs.DeviceType;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.graphics.Atlas;
|
import io.anuke.ucore.graphics.Lines;
|
||||||
|
import io.anuke.ucore.util.Atlas;
|
||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Input;
|
import io.anuke.ucore.util.Input;
|
||||||
@@ -97,7 +98,7 @@ public class Control extends Module{
|
|||||||
block.postInit();
|
block.postInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.setCircleVertices(14);
|
Lines.setCircleVertices(14);
|
||||||
|
|
||||||
Gdx.input.setCatchBackKey(true);
|
Gdx.input.setCatchBackKey(true);
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class NetServer extends Module{
|
|||||||
|
|
||||||
if(Vars.world.getMap().custom){
|
if(Vars.world.getMap().custom){
|
||||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
NetworkIO.writeMap(Vars.world.getMap(), stream);
|
NetworkIO.writeMap(Vars.world.getMap().pixmap, stream);
|
||||||
CustomMapPacket data = new CustomMapPacket();
|
CustomMapPacket data = new CustomMapPacket();
|
||||||
data.stream = new ByteArrayInputStream(stream.toByteArray());
|
data.stream = new ByteArrayInputStream(stream.toByteArray());
|
||||||
Net.sendStream(id, data);
|
Net.sendStream(id, data);
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ import io.anuke.ucore.entities.DestructibleEntity;
|
|||||||
import io.anuke.ucore.entities.EffectEntity;
|
import io.anuke.ucore.entities.EffectEntity;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.function.Callable;
|
import io.anuke.ucore.function.Callable;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.graphics.Surface;
|
import io.anuke.ucore.graphics.Surface;
|
||||||
import io.anuke.ucore.modules.RendererModule;
|
import io.anuke.ucore.modules.RendererModule;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
@@ -317,14 +319,14 @@ public class Renderer extends RendererModule{
|
|||||||
int y = control.core.y + Vars.control.tutorial.getPlacePoint().y;
|
int y = control.core.y + Vars.control.tutorial.getPlacePoint().y;
|
||||||
int rot = Vars.control.tutorial.getPlaceRotation();
|
int rot = Vars.control.tutorial.getPlaceRotation();
|
||||||
|
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.YELLOW);
|
Draw.color(Color.YELLOW);
|
||||||
Draw.square(x * tilesize, y * tilesize, tilesize / 2f + Mathf.sin(Timers.time(), 4f, 1f));
|
Lines.square(x * tilesize, y * tilesize, tilesize / 2f + Mathf.sin(Timers.time(), 4f, 1f));
|
||||||
|
|
||||||
Draw.color(Color.ORANGE);
|
Draw.color(Color.ORANGE);
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
if(rot != -1){
|
if(rot != -1){
|
||||||
Draw.lineAngle(x * tilesize, y * tilesize, rot * 90, 6);
|
Lines.lineAngle(x * tilesize, y * tilesize, rot * 90, 6);
|
||||||
}
|
}
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
@@ -333,8 +335,8 @@ public class Renderer extends RendererModule{
|
|||||||
if(Vars.ui.configfrag.isShown()){
|
if(Vars.ui.configfrag.isShown()){
|
||||||
Tile tile = ui.configfrag.getSelectedTile();
|
Tile tile = ui.configfrag.getSelectedTile();
|
||||||
Draw.color(Colors.get("accent"));
|
Draw.color(Colors.get("accent"));
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.square(tile.worldx() + tile.block().getPlaceOffset().x, tile.worldy() + tile.block().getPlaceOffset().y,
|
Lines.square(tile.worldx() + tile.block().getPlaceOffset().x, tile.worldy() + tile.block().getPlaceOffset().y,
|
||||||
tile.block().width * Vars.tilesize / 2f + 1f);
|
tile.block().width * Vars.tilesize / 2f + 1f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
@@ -356,10 +358,10 @@ public class Renderer extends RendererModule{
|
|||||||
|
|
||||||
input.placeMode.draw(control.input.getBlockX(), control.input.getBlockY(), control.input.getBlockEndX(), control.input.getBlockEndY());
|
input.placeMode.draw(control.input.getBlockX(), control.input.getBlockY(), control.input.getBlockEndX(), control.input.getBlockEndY());
|
||||||
|
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.SCARLET);
|
Draw.color(Color.SCARLET);
|
||||||
for(SpawnPoint spawn : control.getSpawnPoints()){
|
for(SpawnPoint spawn : control.getSpawnPoints()){
|
||||||
Draw.dashCircle(spawn.start.worldx(), spawn.start.worldy(), enemyspawnspace);
|
Lines.dashCircle(spawn.start.worldx(), spawn.start.worldy(), enemyspawnspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(input.breakMode == PlaceMode.holdDelete)
|
if(input.breakMode == PlaceMode.holdDelete)
|
||||||
@@ -430,15 +432,15 @@ public class Renderer extends RendererModule{
|
|||||||
x -= 0.5f;
|
x -= 0.5f;
|
||||||
y += 0.5f;
|
y += 0.5f;
|
||||||
|
|
||||||
Draw.thickness(3f);
|
Lines.stroke(3f);
|
||||||
Draw.color(Color.SLATE);
|
Draw.color(Color.SLATE);
|
||||||
Draw.line(x - len + 1, y, x + len + 1.5f, y);
|
Lines.line(x - len + 1, y, x + len + 1.5f, y);
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.BLACK);
|
Draw.color(Color.BLACK);
|
||||||
Draw.line(x - len + 1, y, x + len + 0.5f, y);
|
Lines.line(x - len + 1, y, x + len + 0.5f, y);
|
||||||
Draw.color(color);
|
Draw.color(color);
|
||||||
if(w >= 1)
|
if(w >= 1)
|
||||||
Draw.line(x - len + 1, y, x - len + w, y);
|
Lines.line(x - len + 1, y, x - len + w, y);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.mindustry.ui.fragments.*;
|
|||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.function.Consumer;
|
import io.anuke.ucore.function.Consumer;
|
||||||
import io.anuke.ucore.function.Listenable;
|
import io.anuke.ucore.function.Listenable;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.modules.SceneModule;
|
import io.anuke.ucore.modules.SceneModule;
|
||||||
import io.anuke.ucore.scene.Skin;
|
import io.anuke.ucore.scene.Skin;
|
||||||
import io.anuke.ucore.scene.builders.build;
|
import io.anuke.ucore.scene.builders.build;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class Bullet extends BulletEntity{
|
public class Bullet extends BulletEntity{
|
||||||
BulletType type;
|
public boolean absorbed = false;
|
||||||
|
|
||||||
public Bullet(BulletType type, Entity owner, float x, float y, float angle){
|
public Bullet(BulletType type, Entity owner, float x, float y, float angle){
|
||||||
super(type, owner, angle);
|
super(type, owner, angle);
|
||||||
@@ -18,6 +18,11 @@ public class Bullet extends BulletEntity{
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void absorb(){
|
||||||
|
absorbed = true;
|
||||||
|
remove();
|
||||||
|
}
|
||||||
|
|
||||||
public void draw(){
|
public void draw(){
|
||||||
type.draw(this);
|
type.draw(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import io.anuke.mindustry.entities.effect.DamageArea;
|
|||||||
import io.anuke.mindustry.entities.effect.EMP;
|
import io.anuke.mindustry.entities.effect.EMP;
|
||||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.BaseBulletType;
|
import io.anuke.ucore.entities.BaseBulletType;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -45,8 +46,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
sniper = new BulletType(3f, 25){
|
sniper = new BulletType(3f, 25){
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.color(Color.LIGHT_GRAY);
|
Draw.color(Color.LIGHT_GRAY);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), 3f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), 3f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
float rad = 6f + Mathf.sin(Timers.time(), 5f, 2f);
|
float rad = 6f + Mathf.sin(Timers.time(), 5f, 2f);
|
||||||
|
|
||||||
Draw.color(Color.SKY);
|
Draw.color(Color.SKY);
|
||||||
Draw.circle(b.x, b.y, 4f);
|
Lines.circle(b.x, b.y, 4f);
|
||||||
Draw.rect("circle", b.x, b.y, rad, rad);
|
Draw.rect("circle", b.x, b.y, rad, rad);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
@@ -138,10 +139,10 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
Draw.color(Color.GRAY);
|
Draw.color(Color.GRAY);
|
||||||
Draw.thick(3f);
|
Lines.stroke(3f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
||||||
Draw.thick(1.5f);
|
Lines.stroke(1.5f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), 5f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), 5f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,8 +169,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.ifract());
|
Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.ifract());
|
||||||
Draw.thick(2f - b.ifract());
|
Lines.stroke(2f - b.ifract());
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -324,8 +325,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.color(Color.WHITE, lightOrange, b.fract()/2f + 0.25f);
|
Draw.color(Color.WHITE, lightOrange, b.fract()/2f + 0.25f);
|
||||||
Draw.thick(1.5f);
|
Lines.stroke(1.5f);
|
||||||
Draw.lineAngle(b.x, b.y, b.angle(), 3f);
|
Lines.lineAngle(b.x, b.y, b.angle(), 3f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -338,8 +339,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
float size = 3f - b.ifract()*1f;
|
float size = 3f - b.ifract()*1f;
|
||||||
|
|
||||||
Draw.color(Color.PURPLE, Color.WHITE, 0.8f);
|
Draw.color(Color.PURPLE, Color.WHITE, 0.8f);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.circle(b.x, b.y, size);
|
Lines.circle(b.x, b.y, size);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -350,13 +351,13 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(lightOrange, Color.WHITE, 0.4f);
|
Draw.color(lightOrange, Color.WHITE, 0.4f);
|
||||||
Draw.polygon(b.x, b.y, 3, 1.6f, b.angle());
|
Lines.poly(b.x, b.y, 3, 1.6f, b.angle());
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.WHITE, lightOrange, b.ifract()/2f);
|
Draw.color(Color.WHITE, lightOrange, b.ifract()/2f);
|
||||||
Draw.alpha(b.ifract());
|
Draw.alpha(b.ifract());
|
||||||
Draw.spikes(b.x, b.y, 1.5f, 2f, 6);
|
Lines.spikes(b.x, b.y, 1.5f, 2f, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,8 +384,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.color(lightGray);
|
Draw.color(lightGray);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,8 +408,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
Draw.color(Color.WHITE, Color.ORANGE, b.ifract());
|
Draw.color(Color.WHITE, Color.ORANGE, b.ifract());
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*5f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*5f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,8 +436,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
Draw.color(Color.WHITE, Color.ORANGE, b.ifract());
|
Draw.color(Color.WHITE, Color.ORANGE, b.ifract());
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*4f);
|
Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*4f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -456,18 +457,18 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
Draw.color(beam);
|
Draw.color(beam);
|
||||||
Draw.rect("circle", b.x, b.y, 6f*f, 6f*f);
|
Draw.rect("circle", b.x, b.y, 6f*f, 6f*f);
|
||||||
Draw.thick(3f * f);
|
Lines.stroke(3f * f);
|
||||||
Draw.lineAngle(b.x, b.y, b.angle(), length);
|
Lines.lineAngle(b.x, b.y, b.angle(), length);
|
||||||
|
|
||||||
Draw.thick(2f * f);
|
Lines.stroke(2f * f);
|
||||||
Draw.lineAngle(b.x, b.y, b.angle(), length + 6f);
|
Lines.lineAngle(b.x, b.y, b.angle(), length + 6f);
|
||||||
Draw.thick(1f * f);
|
Lines.stroke(1f * f);
|
||||||
Draw.lineAngle(b.x, b.y, b.angle(), length + 12f);
|
Lines.lineAngle(b.x, b.y, b.angle(), length + 12f);
|
||||||
|
|
||||||
Draw.color(beamLight);
|
Draw.color(beamLight);
|
||||||
Draw.thick(1.5f * f);
|
Lines.stroke(1.5f * f);
|
||||||
Draw.rect("circle", b.x, b.y, 3f*f, 3f*f);
|
Draw.rect("circle", b.x, b.y, 3f*f, 3f*f);
|
||||||
Draw.lineAngle(b.x, b.y, b.angle(), length);
|
Lines.lineAngle(b.x, b.y, b.angle(), length);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import io.anuke.mindustry.world.Tile;
|
|||||||
import io.anuke.mindustry.world.blocks.Blocks;
|
import io.anuke.mindustry.world.blocks.Blocks;
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.entities.SolidEntity;
|
import io.anuke.ucore.entities.SolidEntity;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.entities.TimedEntity;
|
import io.anuke.ucore.entities.TimedEntity;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -83,8 +84,8 @@ public class EMP extends TimedEntity{
|
|||||||
drawLine(x + Angles.x(), y + Angles.y());
|
drawLine(x + Angles.x(), y + Angles.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.thick(fract()*2f);
|
Lines.stroke(fract()*2f);
|
||||||
Draw.polygon(x, y, 34, radius * Vars.tilesize);
|
Lines.poly(x, y, 34, radius * Vars.tilesize);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
@@ -111,7 +112,7 @@ public class EMP extends TimedEntity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawLaser(float x, float y, float x2, float y2){
|
private void drawLaser(float x, float y, float x2, float y2){
|
||||||
Draw.thick(fract() * 2f);
|
Lines.stroke(fract() * 2f);
|
||||||
Draw.line(x, y, x2, y2);
|
Lines.line(x, y, x2, y2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
|
import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.BulletEntity;
|
import io.anuke.ucore.entities.BulletEntity;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
|
|||||||
@@ -8,12 +8,13 @@ import com.badlogic.gdx.utils.ObjectSet;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.Entity;
|
import io.anuke.ucore.entities.Entity;
|
||||||
import io.anuke.ucore.entities.SolidEntity;
|
import io.anuke.ucore.entities.SolidEntity;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Tmp;
|
import io.anuke.ucore.util.Tmp;
|
||||||
|
|
||||||
@@ -95,8 +96,8 @@ public class TeslaOrb extends Entity{
|
|||||||
Draw.color(Color.WHITE);
|
Draw.color(Color.WHITE);
|
||||||
Draw.alpha(1f-life/lifetime);
|
Draw.alpha(1f-life/lifetime);
|
||||||
|
|
||||||
Draw.thick(3f - life/lifetime*2f);
|
Lines.stroke(3f - life/lifetime*2f);
|
||||||
Draw.line(x1, y1, x2, y2);
|
Lines.line(x1, y1, x2, y2);
|
||||||
|
|
||||||
float rad = 7f - life/lifetime*5f;
|
float rad = 7f - life/lifetime*5f;
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ public class TeslaOrb extends Entity{
|
|||||||
|
|
||||||
//Draw.color(Color.WHITE);
|
//Draw.color(Color.WHITE);
|
||||||
|
|
||||||
//Draw.thick(2f - life/lifetime*2f);
|
//Draw.stroke(2f - life/lifetime*2f);
|
||||||
//Draw.line(x1, y1, x2, y2);
|
//Draw.line(x1, y1, x2, y2);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import io.anuke.mindustry.graphics.Shaders;
|
|||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.Blocks;
|
import io.anuke.mindustry.world.blocks.Blocks;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.graphics.Shaders;
|
import io.anuke.mindustry.graphics.Shaders;
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Shapes;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
|
|
||||||
public class HealerType extends EnemyType {
|
public class HealerType extends EnemyType {
|
||||||
@@ -75,7 +77,7 @@ public class HealerType extends EnemyType {
|
|||||||
if(target.health < target.maxhealth){
|
if(target.health < target.maxhealth){
|
||||||
Draw.color(Hue.rgb(138, 244, 138, (MathUtils.sin(Timers.time()) + 1f) / 13f));
|
Draw.color(Hue.rgb(138, 244, 138, (MathUtils.sin(Timers.time()) + 1f) / 13f));
|
||||||
Draw.alpha(0.9f);
|
Draw.alpha(0.9f);
|
||||||
Draw.laser("laser", "laserend", enemy.x + Angles.x(), enemy.y + Angles.y(), target.x - Angles.x()/1.5f, target.y - Angles.y()/1.5f);
|
Shapes.laser("laser", "laserend", enemy.x + Angles.x(), enemy.y + Angles.y(), target.x - Angles.x()/1.5f, target.y - Angles.y()/1.5f);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
Graphics.shader(Shaders.outline);
|
Graphics.shader(Shaders.outline);
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
import io.anuke.mindustry.entities.enemies.EnemyType;
|
import io.anuke.mindustry.entities.enemies.EnemyType;
|
||||||
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class TargetType extends EnemyType {
|
public class TargetType extends EnemyType {
|
||||||
@@ -42,7 +43,7 @@ public class TargetType extends EnemyType {
|
|||||||
Draw.color(Color.YELLOW);
|
Draw.color(Color.YELLOW);
|
||||||
|
|
||||||
if(Vars.control.getTutorial().showTarget()){
|
if(Vars.control.getTutorial().showTarget()){
|
||||||
Draw.spikes(enemy.x, enemy.y, 11f + Mathf.sin(Timers.time(), 7f, 1f), 4f, 8, Timers.time());
|
Lines.spikes(enemy.x, enemy.y, 11f + Mathf.sin(Timers.time(), 7f, 1f), 4f, 8, Timers.time());
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ import io.anuke.mindustry.world.Tile;
|
|||||||
import io.anuke.mindustry.world.blocks.Blocks;
|
import io.anuke.mindustry.world.blocks.Blocks;
|
||||||
import io.anuke.mindustry.world.blocks.types.StaticBlock;
|
import io.anuke.mindustry.world.blocks.types.StaticBlock;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.graphics.CacheBatch;
|
import io.anuke.ucore.graphics.CacheBatch;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -195,7 +196,7 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
if(Vars.debug && Vars.debugChunks){
|
if(Vars.debug && Vars.debugChunks){
|
||||||
Draw.color(Color.YELLOW);
|
Draw.color(Color.YELLOW);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
for(int x = -crangex; x <= crangex; x++){
|
for(int x = -crangex; x <= crangex; x++){
|
||||||
for(int y = -crangey; y <= crangey; y++){
|
for(int y = -crangey; y <= crangey; y++){
|
||||||
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x;
|
||||||
@@ -203,7 +204,7 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
if(!Mathf.inBounds(worldx, worldy, cache))
|
if(!Mathf.inBounds(worldx, worldy, cache))
|
||||||
continue;
|
continue;
|
||||||
Draw.linerect(worldx * chunksize * tilesize, worldy * chunksize * tilesize, chunksize * tilesize, chunksize * tilesize);
|
Lines.rect(worldx * chunksize * tilesize, worldy * chunksize * tilesize, chunksize * tilesize, chunksize * tilesize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
@@ -215,9 +216,9 @@ public class BlockRenderer{
|
|||||||
for(SpawnPoint point : control.getSpawnPoints()){
|
for(SpawnPoint point : control.getSpawnPoints()){
|
||||||
if(point.pathTiles != null){
|
if(point.pathTiles != null){
|
||||||
for(int i = 1; i < point.pathTiles.length; i ++){
|
for(int i = 1; i < point.pathTiles.length; i ++){
|
||||||
Draw.line(point.pathTiles[i-1].worldx(), point.pathTiles[i-1].worldy(),
|
Lines.line(point.pathTiles[i-1].worldx(), point.pathTiles[i-1].worldy(),
|
||||||
point.pathTiles[i].worldx(), point.pathTiles[i].worldy());
|
point.pathTiles[i].worldx(), point.pathTiles[i].worldy());
|
||||||
Draw.circle(point.pathTiles[i-1].worldx(), point.pathTiles[i-1].worldy(), 6f);
|
Lines.circle(point.pathTiles[i-1].worldx(), point.pathTiles[i-1].worldy(), 6f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package io.anuke.mindustry.graphics;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.Colors;
|
import com.badlogic.gdx.graphics.Colors;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
|
import io.anuke.ucore.graphics.Shapes;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -60,82 +62,82 @@ public class Fx{
|
|||||||
|
|
||||||
chainshot = new Effect(9f, e -> {
|
chainshot = new Effect(9f, e -> {
|
||||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||||
Draw.thick(e.fract()*4f);
|
Lines.stroke(e.fract()*4f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*7f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*7f);
|
||||||
Draw.thick(e.fract()*2f);
|
Lines.stroke(e.fract()*2f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
mortarshot = new Effect(10f, e -> {
|
mortarshot = new Effect(10f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
||||||
Draw.thick(e.fract()*6f);
|
Lines.stroke(e.fract()*6f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
||||||
Draw.thick(e.fract()*5f);
|
Lines.stroke(e.fract()*5f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
||||||
Draw.thick(e.fract()*1f);
|
Lines.stroke(e.fract()*1f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
railshot = new Effect(9f, e -> {
|
railshot = new Effect(9f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
||||||
Draw.thick(e.fract()*5f);
|
Lines.stroke(e.fract()*5f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*8f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*8f);
|
||||||
Draw.thick(e.fract()*4f);
|
Lines.stroke(e.fract()*4f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
||||||
Draw.thick(e.fract()*1f);
|
Lines.stroke(e.fract()*1f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
titanshot = new Effect(12f, e -> {
|
titanshot = new Effect(12f, e -> {
|
||||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||||
Draw.thick(e.fract()*7f);
|
Lines.stroke(e.fract()*7f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
||||||
Draw.thick(e.fract()*4f);
|
Lines.stroke(e.fract()*4f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
||||||
Draw.thick(e.fract()*2f);
|
Lines.stroke(e.fract()*2f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*18f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
largeCannonShot = new Effect(11f, e -> {
|
largeCannonShot = new Effect(11f, e -> {
|
||||||
Draw.color(Color.WHITE, whiteYellow, e.ifract());
|
Draw.color(Color.WHITE, whiteYellow, e.ifract());
|
||||||
Draw.thick(e.fract()*6f);
|
Lines.stroke(e.fract()*6f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
||||||
Draw.thick(e.fract()*3f);
|
Lines.stroke(e.fract()*3f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
||||||
Draw.thick(e.fract()*1f);
|
Lines.stroke(e.fract()*1f);
|
||||||
Draw.lineAngle(e.x, e.y, e.rotation, e.fract()*18f);
|
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
shockwave = new Effect(10f, 80f, e -> {
|
shockwave = new Effect(10f, 80f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||||
Draw.thick(e.fract()*2f + 0.2f);
|
Lines.stroke(e.fract()*2f + 0.2f);
|
||||||
Draw.circle(e.x, e.y, e.ifract()*28f);
|
Lines.circle(e.x, e.y, e.ifract()*28f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
nuclearShockwave = new Effect(10f, 200f, e -> {
|
nuclearShockwave = new Effect(10f, 200f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||||
Draw.thick(e.fract()*3f + 0.2f);
|
Lines.stroke(e.fract()*3f + 0.2f);
|
||||||
Draw.polygon(e.x, e.y, 40, e.ifract()*140f);
|
Lines.poly(e.x, e.y, 40, e.ifract()*140f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
shockwaveSmall = new Effect(10f, e -> {
|
shockwaveSmall = new Effect(10f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||||
Draw.thick(e.fract()*2f + 0.1f);
|
Lines.stroke(e.fract()*2f + 0.1f);
|
||||||
Draw.circle(e.x, e.y, e.ifract()*15f);
|
Lines.circle(e.x, e.y, e.ifract()*15f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
empshockwave = new Effect(7f, e -> {
|
empshockwave = new Effect(7f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||||
Draw.thick(e.fract()*2f);
|
Lines.stroke(e.fract()*2f);
|
||||||
Draw.circle(e.x, e.y, e.ifract()*40f);
|
Lines.circle(e.x, e.y, e.ifract()*40f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -143,7 +145,7 @@ public class Fx{
|
|||||||
Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{
|
Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{
|
||||||
float len = 1f+e.fract()*6f;
|
float len = 1f+e.fract()*6f;
|
||||||
Draw.color(Color.SKY);
|
Draw.color(Color.SKY);
|
||||||
Draw.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@@ -183,7 +185,7 @@ public class Fx{
|
|||||||
float len = 1f+e.fract()*5f;
|
float len = 1f+e.fract()*5f;
|
||||||
Draw.color(Color.WHITE, Color.CORAL, e.ifract());
|
Draw.color(Color.WHITE, Color.CORAL, e.ifract());
|
||||||
Draw.alpha(e.ifract()/1.3f);
|
Draw.alpha(e.ifract()/1.3f);
|
||||||
Draw.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@@ -218,191 +220,191 @@ public class Fx{
|
|||||||
lavabubble = new Effect(45f, e -> {
|
lavabubble = new Effect(45f, e -> {
|
||||||
Draw.color(Color.ORANGE);
|
Draw.color(Color.ORANGE);
|
||||||
float scl = 0.35f;
|
float scl = 0.35f;
|
||||||
Draw.thick(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl));
|
Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl));
|
||||||
Draw.circle(e.x, e.y, e.ifract()*4f);
|
Lines.circle(e.x, e.y, e.ifract()*4f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
oilbubble = new Effect(64f, e -> {
|
oilbubble = new Effect(64f, e -> {
|
||||||
Draw.color(Color.DARK_GRAY);
|
Draw.color(Color.DARK_GRAY);
|
||||||
float scl = 0.25f;
|
float scl = 0.25f;
|
||||||
Draw.thick(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl));
|
Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl));
|
||||||
Draw.circle(e.x, e.y, e.ifract()*3f);
|
Lines.circle(e.x, e.y, e.ifract()*3f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
shellexplosion = new Effect(9, e -> {
|
shellexplosion = new Effect(9, e -> {
|
||||||
Draw.thickness(2f - e.ifract()*1.7f);
|
Lines.stroke(2f - e.ifract()*1.7f);
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||||
Draw.circle(e.x, e.y, 3f + e.ifract() * 9f);
|
Lines.circle(e.x, e.y, 3f + e.ifract() * 9f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
blastexplosion = new Effect(16, e -> {
|
blastexplosion = new Effect(16, e -> {
|
||||||
Draw.thickness(1.2f - e.ifract());
|
Lines.stroke(1.2f - e.ifract());
|
||||||
Draw.color(Color.WHITE, Color.SCARLET, e.ifract());
|
Draw.color(Color.WHITE, Color.SCARLET, e.ifract());
|
||||||
Draw.circle(e.x, e.y, 1.5f + e.ifract() * 9f);
|
Lines.circle(e.x, e.y, 1.5f + e.ifract() * 9f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
place = new Effect(16, e -> {
|
place = new Effect(16, e -> {
|
||||||
Draw.thickness(3f - e.ifract() * 2f);
|
Lines.stroke(3f - e.ifract() * 2f);
|
||||||
Draw.square(e.x, e.y, Vars.tilesize / 2f + e.ifract() * 3f);
|
Lines.square(e.x, e.y, Vars.tilesize / 2f + e.ifract() * 3f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
dooropen = new Effect(10, e -> {
|
dooropen = new Effect(10, e -> {
|
||||||
Draw.thickness(e.fract() * 1.6f);
|
Lines.stroke(e.fract() * 1.6f);
|
||||||
Draw.square(e.x, e.y, Vars.tilesize / 2f + e.ifract() * 2f);
|
Lines.square(e.x, e.y, Vars.tilesize / 2f + e.ifract() * 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
doorclose= new Effect(10, e -> {
|
doorclose= new Effect(10, e -> {
|
||||||
Draw.thickness(e.fract() * 1.6f);
|
Lines.stroke(e.fract() * 1.6f);
|
||||||
Draw.square(e.x, e.y, Vars.tilesize / 2f + e.fract() * 2f);
|
Lines.square(e.x, e.y, Vars.tilesize / 2f + e.fract() * 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
dooropenlarge = new Effect(10, e -> {
|
dooropenlarge = new Effect(10, e -> {
|
||||||
Draw.thickness(e.fract() * 1.6f);
|
Lines.stroke(e.fract() * 1.6f);
|
||||||
Draw.square(e.x, e.y, Vars.tilesize + e.ifract() * 2f);
|
Lines.square(e.x, e.y, Vars.tilesize + e.ifract() * 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
doorcloselarge = new Effect(10, e -> {
|
doorcloselarge = new Effect(10, e -> {
|
||||||
Draw.thickness(e.fract() * 1.6f);
|
Lines.stroke(e.fract() * 1.6f);
|
||||||
Draw.square(e.x, e.y, Vars.tilesize + e.fract() * 2f);
|
Lines.square(e.x, e.y, Vars.tilesize + e.fract() * 2f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
purify = new Effect(10, e -> {
|
purify = new Effect(10, e -> {
|
||||||
Draw.color(Color.ROYAL, Color.GRAY, e.ifract());
|
Draw.color(Color.ROYAL, Color.GRAY, e.ifract());
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
purifyoil = new Effect(10, e -> {
|
purifyoil = new Effect(10, e -> {
|
||||||
Draw.color(Color.BLACK, Color.GRAY, e.ifract());
|
Draw.color(Color.BLACK, Color.GRAY, e.ifract());
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
purifystone = new Effect(10, e -> {
|
purifystone = new Effect(10, e -> {
|
||||||
Draw.color(Color.ORANGE, Color.GRAY, e.ifract());
|
Draw.color(Color.ORANGE, Color.GRAY, e.ifract());
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
generate = new Effect(11, e -> {
|
generate = new Effect(11, e -> {
|
||||||
Draw.color(Color.ORANGE, Color.YELLOW, e.ifract());
|
Draw.color(Color.ORANGE, Color.YELLOW, e.ifract());
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 8);
|
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
spark = new Effect(10, e -> {
|
spark = new Effect(10, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.WHITE, Color.GRAY, e.ifract());
|
Draw.color(Color.WHITE, Color.GRAY, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 8);
|
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
sparkbig = new Effect(11, e -> {
|
sparkbig = new Effect(11, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(lightRed, Color.GRAY, e.ifract());
|
Draw.color(lightRed, Color.GRAY, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2.3f, 8);
|
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2.3f, 8);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
smelt = new Effect(10, e -> {
|
smelt = new Effect(10, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.YELLOW, Color.RED, e.ifract());
|
Draw.color(Color.YELLOW, Color.RED, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 1f, 8);
|
Lines.spikes(e.x, e.y, e.ifract() * 5f, 1f, 8);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
breakBlock = new Effect(12, e -> {
|
breakBlock = new Effect(12, e -> {
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(Color.WHITE, Colors.get("break"), e.ifract());
|
Draw.color(Color.WHITE, Colors.get("break"), e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90);
|
Lines.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
hit = new Effect(10, e -> {
|
hit = new Effect(10, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 3f, 2, 8);
|
Lines.spikes(e.x, e.y, e.ifract() * 3f, 2, 8);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
laserhit = new Effect(10, e -> {
|
laserhit = new Effect(10, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 2f, 2, 6);
|
Lines.spikes(e.x, e.y, e.ifract() * 2f, 2, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
shieldhit = new Effect(9, e -> {
|
shieldhit = new Effect(9, e -> {
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 6);
|
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 6);
|
||||||
Draw.thickness(4f*e.fract());
|
Lines.stroke(4f*e.fract());
|
||||||
Draw.circle(e.x, e.y, e.ifract()*14f);
|
Lines.circle(e.x, e.y, e.ifract()*14f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
laserShoot = new Effect(8, e -> {
|
laserShoot = new Effect(8, e -> {
|
||||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f);
|
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
spreadShoot = new Effect(12, e -> {
|
spreadShoot = new Effect(12, e -> {
|
||||||
Draw.color(Color.WHITE, Color.PURPLE, e.ifract());
|
Draw.color(Color.WHITE, Color.PURPLE, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f);
|
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
clusterShoot = new Effect(12, e -> {
|
clusterShoot = new Effect(12, e -> {
|
||||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f);
|
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
vulcanShoot = new Effect(8, e -> {
|
vulcanShoot = new Effect(8, e -> {
|
||||||
Draw.color(lighterOrange, lightOrange, e.ifract());
|
Draw.color(lighterOrange, lightOrange, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f);
|
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
shockShoot = new Effect(8, e -> {
|
shockShoot = new Effect(8, e -> {
|
||||||
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f);
|
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
beamShoot = new Effect(8, e -> {
|
beamShoot = new Effect(8, e -> {
|
||||||
Draw.color(beamLight, beam, e.ifract());
|
Draw.color(beamLight, beam, e.ifract());
|
||||||
Draw.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f);
|
Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f);
|
||||||
Draw.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f);
|
Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
beamhit = new Effect(8, e -> {
|
beamhit = new Effect(8, e -> {
|
||||||
Draw.color(beamLight, beam, e.ifract());
|
Draw.color(beamLight, beam, e.ifract());
|
||||||
Draw.thick(e.fract()*3f+0.5f);
|
Lines.stroke(e.fract()*3f+0.5f);
|
||||||
Draw.circle(e.x, e.y, e.ifract()*8f);
|
Lines.circle(e.x, e.y, e.ifract()*8f);
|
||||||
Draw.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45);
|
Lines.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
titanExplosion = new Effect(11, 48f, e -> {
|
titanExplosion = new Effect(11, 48f, e -> {
|
||||||
Draw.thickness(2f*e.fract()+0.5f);
|
Lines.stroke(2f*e.fract()+0.5f);
|
||||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
|
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
|
||||||
Draw.circle(e.x, e.y, 5f + e.powfract() * 8f);
|
Lines.circle(e.x, e.y, 5f + e.powfract() * 8f);
|
||||||
|
|
||||||
Draw.color(e.ifract() < 0.5f ? whiteOrange : Color.DARK_GRAY);
|
Draw.color(e.ifract() < 0.5f ? whiteOrange : Color.DARK_GRAY);
|
||||||
float rad = e.fract()*10f + 5f;
|
float rad = e.fract()*10f + 5f;
|
||||||
@@ -414,9 +416,9 @@ public class Fx{
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
explosion = new Effect(11, e -> {
|
explosion = new Effect(11, e -> {
|
||||||
Draw.thickness(2f*e.fract()+0.5f);
|
Lines.stroke(2f*e.fract()+0.5f);
|
||||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
|
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
|
||||||
Draw.circle(e.x, e.y, 5f + e.powfract() * 6f);
|
Lines.circle(e.x, e.y, 5f + e.powfract() * 6f);
|
||||||
|
|
||||||
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
||||||
float rad = e.fract()*10f + 5f;
|
float rad = e.fract()*10f + 5f;
|
||||||
@@ -436,9 +438,9 @@ public class Fx{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.thickness(2f*e.fract()+0.4f);
|
Lines.stroke(2f*e.fract()+0.4f);
|
||||||
Draw.color(Color.WHITE, Color.ORANGE, e.powfract());
|
Draw.color(Color.WHITE, Color.ORANGE, e.powfract());
|
||||||
Draw.circle(e.x, e.y, 2f + e.powfract() * 9f);
|
Lines.circle(e.x, e.y, 2f + e.powfract() * 9f);
|
||||||
|
|
||||||
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
||||||
float rad = e.fract()*10f + 2f;
|
float rad = e.fract()*10f + 2f;
|
||||||
@@ -451,17 +453,17 @@ public class Fx{
|
|||||||
|
|
||||||
clusterbomb = new Effect(10f, e -> {
|
clusterbomb = new Effect(10f, e -> {
|
||||||
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
Draw.color(Color.WHITE, lightOrange, e.ifract());
|
||||||
Draw.thick(e.fract()*1.5f);
|
Lines.stroke(e.fract()*1.5f);
|
||||||
Draw.polygon(e.x, e.y, 4, e.fract()*8f);
|
Lines.poly(e.x, e.y, 4, e.fract()*8f);
|
||||||
Draw.circle(e.x, e.y, e.ifract()*14f);
|
Lines.circle(e.x, e.y, e.ifract()*14f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
coreexplosion = new Effect(13, e -> {
|
coreexplosion = new Effect(13, e -> {
|
||||||
Draw.thickness(3f-e.ifract()*2f);
|
Lines.stroke(3f-e.ifract()*2f);
|
||||||
Draw.color(Color.ORANGE, Color.WHITE, e.ifract());
|
Draw.color(Color.ORANGE, Color.WHITE, e.ifract());
|
||||||
Draw.spikes(e.x, e.y, 5f + e.ifract() * 40f, 6, 6);
|
Lines.spikes(e.x, e.y, 5f + e.ifract() * 40f, 6, 6);
|
||||||
Draw.circle(e.x, e.y, 4f + e.ifract() * 40f);
|
Lines.circle(e.x, e.y, 4f + e.ifract() * 40f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -494,9 +496,9 @@ public class Fx{
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
spawn = new Effect(23, e -> {
|
spawn = new Effect(23, e -> {
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.ifract());
|
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.ifract());
|
||||||
Draw.circle(e.x, e.y, 7f - e.ifract() * 6f);
|
Lines.circle(e.x, e.y, 7f - e.ifract() * 6f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.ui.fragments.ToolFragment;
|
import io.anuke.mindustry.ui.fragments.ToolFragment;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.scene.utils.Cursors;
|
import io.anuke.ucore.scene.utils.Cursors;
|
||||||
import io.anuke.ucore.util.Bundles;
|
import io.anuke.ucore.util.Bundles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@@ -36,17 +37,17 @@ public enum PlaceMode{
|
|||||||
float si = MathUtils.sin(Timers.time() / 6f) + 1.5f;
|
float si = MathUtils.sin(Timers.time() / 6f) + 1.5f;
|
||||||
|
|
||||||
Draw.color(valid ? Colors.get("place") : Colors.get("placeInvalid"));
|
Draw.color(valid ? Colors.get("place") : Colors.get("placeInvalid"));
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.linecrect(x + offset.x, y + offset.y, tilesize * control.getInput().recipe.result.width + si,
|
Lines.crect(x + offset.x, y + offset.y, tilesize * control.getInput().recipe.result.width + si,
|
||||||
tilesize * control.getInput().recipe.result.height + si);
|
tilesize * control.getInput().recipe.result.height + si);
|
||||||
|
|
||||||
control.getInput().recipe.result.drawPlace(tilex, tiley, control.getInput().rotation, valid);
|
control.getInput().recipe.result.drawPlace(tilex, tiley, control.getInput().rotation, valid);
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
|
|
||||||
if(control.getInput().recipe.result.rotate){
|
if(control.getInput().recipe.result.rotate){
|
||||||
Draw.color(Colors.get("placeRotate"));
|
Draw.color(Colors.get("placeRotate"));
|
||||||
Tmp.v1.set(7, 0).rotate(control.getInput().rotation * 90);
|
Tmp.v1.set(7, 0).rotate(control.getInput().rotation * 90);
|
||||||
Draw.line(x, y, x + Tmp.v1.x, y + Tmp.v1.y);
|
Lines.line(x, y, x + Tmp.v1.x, y + Tmp.v1.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(valid)
|
if(valid)
|
||||||
@@ -96,7 +97,7 @@ public enum PlaceMode{
|
|||||||
|
|
||||||
if(android && control.getInput().breaktime > 0){
|
if(android && control.getInput().breaktime > 0){
|
||||||
Draw.color(Colors.get("breakStart"), Colors.get("break"), fract);
|
Draw.color(Colors.get("breakStart"), Colors.get("break"), fract);
|
||||||
Draw.polygon(tile.worldx() + offset.x, tile.worldy() + offset.y, 25, 4 + (1f - fract) * 26);
|
Lines.poly(tile.worldx() + offset.x, tile.worldy() + offset.y, 25, 4 + (1f - fract) * 26);
|
||||||
}
|
}
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
@@ -149,7 +150,7 @@ public enum PlaceMode{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Draw.color(Colors.get("break"));
|
Draw.color(Colors.get("break"));
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
for(int cx = tilex; cx <= endx; cx ++){
|
for(int cx = tilex; cx <= endx; cx ++){
|
||||||
for(int cy = tiley; cy <= endy; cy ++){
|
for(int cy = tiley; cy <= endy; cy ++){
|
||||||
Tile tile = Vars.world.tile(cx, cy);
|
Tile tile = Vars.world.tile(cx, cy);
|
||||||
@@ -157,15 +158,15 @@ public enum PlaceMode{
|
|||||||
tile = tile.getLinked();
|
tile = tile.getLinked();
|
||||||
if(tile != null && control.getInput().validBreak(tile.x, tile.y)){
|
if(tile != null && control.getInput().validBreak(tile.x, tile.y)){
|
||||||
Vector2 offset = tile.block().getPlaceOffset();
|
Vector2 offset = tile.block().getPlaceOffset();
|
||||||
Draw.linecrect(tile.worldx() + offset.x, tile.worldy() + offset.y,
|
Lines.crect(tile.worldx() + offset.x, tile.worldy() + offset.y,
|
||||||
tile.block().width * t, tile.block().height * t);
|
tile.block().width * t, tile.block().height * t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(control.getInput().cursorNear() ? Colors.get("break") : Colors.get("breakInvalid"));
|
Draw.color(control.getInput().cursorNear() ? Colors.get("break") : Colors.get("breakInvalid"));
|
||||||
Draw.linerect(x, y, x2 - x, y2 - y);
|
Lines.rect(x, y, x2 - x, y2 - y);
|
||||||
Draw.alpha(0.3f);
|
Draw.alpha(0.3f);
|
||||||
Draw.crect("blank", x, y, x2 - x, y2 - y);
|
Draw.crect("blank", x, y, x2 - x, y2 - y);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
@@ -276,9 +277,9 @@ public enum PlaceMode{
|
|||||||
if(tilex == endx && tiley == endy){
|
if(tilex == endx && tiley == endy){
|
||||||
cursor.draw(tilex, tiley, endx, endy);
|
cursor.draw(tilex, tiley, endx, endy);
|
||||||
}else{
|
}else{
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(control.getInput().cursorNear() ? Colors.get("place") : Colors.get("placeInvalid"));
|
Draw.color(control.getInput().cursorNear() ? Colors.get("place") : Colors.get("placeInvalid"));
|
||||||
Draw.linerect(x, y, x2 - x, y2 - y);
|
Lines.rect(x, y, x2 - x, y2 - y);
|
||||||
Draw.alpha(0.3f);
|
Draw.alpha(0.3f);
|
||||||
Draw.crect("blank", x, y, x2 - x, y2 - y);
|
Draw.crect("blank", x, y, x2 - x, y2 - y);
|
||||||
|
|
||||||
@@ -292,7 +293,7 @@ public enum PlaceMode{
|
|||||||
|
|
||||||
if(!control.getInput().validPlace(px, py, control.getInput().recipe.result)
|
if(!control.getInput().validPlace(px, py, control.getInput().recipe.result)
|
||||||
|| !control.hasItems(control.getInput().recipe.requirements, amount)){
|
|| !control.hasItems(control.getInput().recipe.requirements, amount)){
|
||||||
Draw.linecrect(px * t + offset.x, py * t + offset.y, t*block.width, t*block.height);
|
Lines.crect(px * t + offset.x, py * t + offset.y, t*block.width, t*block.height);
|
||||||
}
|
}
|
||||||
amount ++;
|
amount ++;
|
||||||
}
|
}
|
||||||
@@ -302,7 +303,7 @@ public enum PlaceMode{
|
|||||||
float cx = tx * t, cy = ty * t;
|
float cx = tx * t, cy = ty * t;
|
||||||
Draw.color(Colors.get("placeRotate"));
|
Draw.color(Colors.get("placeRotate"));
|
||||||
Tmp.v1.set(7, 0).rotate(rotation * 90);
|
Tmp.v1.set(7, 0).rotate(rotation * 90);
|
||||||
Draw.line(cx, cy, cx + Tmp.v1.x, cy + Tmp.v1.y);
|
Lines.line(cx, cy, cx + Tmp.v1.x, cy + Tmp.v1.y);
|
||||||
}
|
}
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import java.util.Locale;
|
|||||||
public abstract class PlatformFunction{
|
public abstract class PlatformFunction{
|
||||||
public String format(Date date){return "invalid";}
|
public String format(Date date){return "invalid";}
|
||||||
public String format(int number){return "invalid";}
|
public String format(int number){return "invalid";}
|
||||||
public void openLink(String link){}
|
|
||||||
public void showError(String text){}
|
public void showError(String text){}
|
||||||
public void addDialog(TextField field){
|
public void addDialog(TextField field){
|
||||||
addDialog(field, 16);
|
addDialog(field, 16);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import io.anuke.mindustry.world.Map;
|
|||||||
import io.anuke.mindustry.world.blocks.Blocks;
|
import io.anuke.mindustry.world.blocks.Blocks;
|
||||||
import io.anuke.mindustry.world.blocks.SpecialBlocks;
|
import io.anuke.mindustry.world.blocks.SpecialBlocks;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Pixmaps;
|
import io.anuke.ucore.graphics.Pixmaps;
|
||||||
import io.anuke.ucore.scene.builders.build;
|
import io.anuke.ucore.scene.builders.build;
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.ui.GridImage;
|
import io.anuke.mindustry.ui.GridImage;
|
||||||
import io.anuke.mindustry.world.ColorMapper;
|
import io.anuke.mindustry.world.ColorMapper;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.core.Inputs;
|
import io.anuke.ucore.core.Inputs;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.graphics.Pixmaps;
|
import io.anuke.ucore.graphics.Pixmaps;
|
||||||
import io.anuke.ucore.scene.Element;
|
import io.anuke.ucore.scene.Element;
|
||||||
import io.anuke.ucore.scene.event.InputEvent;
|
import io.anuke.ucore.scene.event.InputEvent;
|
||||||
@@ -235,12 +236,12 @@ public class MapView extends Element implements GestureListener{
|
|||||||
Vector2 v2 = unproject(lastx, lasty).add(x, y);
|
Vector2 v2 = unproject(lastx, lasty).add(x, y);
|
||||||
|
|
||||||
Draw.color(Tmp.c1.set(ColorMapper.getColor(editor.getDrawBlock())));
|
Draw.color(Tmp.c1.set(ColorMapper.getColor(editor.getDrawBlock())));
|
||||||
Draw.thick(Unit.dp.scl(3f * zoom));
|
Lines.stroke(Unit.dp.scl(3f * zoom));
|
||||||
Draw.line(sx, sy, v2.x, v2.y);
|
Lines.line(sx, sy, v2.x, v2.y);
|
||||||
|
|
||||||
Draw.polygon(sx, sy, 40, editor.getBrushSize() * zoom * 3);
|
Lines.poly(sx, sy, 40, editor.getBrushSize() * zoom * 3);
|
||||||
|
|
||||||
Draw.polygon(v2.x, v2.y, 40, editor.getBrushSize() * zoom * 3);
|
Lines.poly(v2.x, v2.y, 40, editor.getBrushSize() * zoom * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
batch.flush();
|
batch.flush();
|
||||||
@@ -248,8 +249,8 @@ public class MapView extends Element implements GestureListener{
|
|||||||
if(pop) ScissorStack.popScissors();
|
if(pop) ScissorStack.popScissors();
|
||||||
|
|
||||||
Draw.color(Colors.get("accent"));
|
Draw.color(Colors.get("accent"));
|
||||||
Draw.thick(Unit.dp.scl(3f));
|
Lines.stroke(Unit.dp.scl(3f));
|
||||||
Draw.linerect(x + width/2 - size/2, y + height/2 - size/2, size, size);
|
Lines.rect(x + width/2 - size/2, y + height/2 - size/2, size, size);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package io.anuke.mindustry.mapeditor;
|
package io.anuke.mindustry.mapeditor;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Pixmap;
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.ucore.core.Draw;
|
|
||||||
import io.anuke.ucore.graphics.Pixmaps;
|
|
||||||
|
|
||||||
public class OperationStack{
|
public class OperationStack{
|
||||||
private final static int maxSize = 10;
|
private final static int maxSize = 10;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import io.anuke.ucore.function.Consumer;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Net{
|
public class Net{
|
||||||
public static final int version = 11;
|
public static final int version = 12;
|
||||||
|
|
||||||
private static boolean server;
|
private static boolean server;
|
||||||
private static boolean active;
|
private static boolean active;
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ import java.nio.ByteBuffer;
|
|||||||
|
|
||||||
public class NetworkIO {
|
public class NetworkIO {
|
||||||
|
|
||||||
public static void writeMap(Map map, OutputStream os){
|
public static void writeMap(Pixmap map, OutputStream os){
|
||||||
try(DataOutputStream stream = new DataOutputStream(os)){
|
try(DataOutputStream stream = new DataOutputStream(os)){
|
||||||
Pixmap pix = map.pixmap;
|
ByteBuffer buffer = map.getPixels();
|
||||||
ByteBuffer buffer = pix.getPixels();
|
|
||||||
UCore.log("Buffer position: " + buffer.position());
|
UCore.log("Buffer position: " + buffer.position());
|
||||||
stream.writeShort(map.getWidth());
|
stream.writeShort(map.getWidth());
|
||||||
stream.writeShort(map.getHeight());
|
stream.writeShort(map.getHeight());
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import com.badlogic.gdx.graphics.Texture;
|
|||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.scene.ui.Image;
|
import io.anuke.ucore.scene.ui.Image;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
@@ -36,8 +37,8 @@ public class BorderImage extends Image{
|
|||||||
float scaleY = getScaleY();
|
float scaleY = getScaleY();
|
||||||
|
|
||||||
Draw.color(Colors.get("accent"));
|
Draw.color(Colors.get("accent"));
|
||||||
Draw.thick(Unit.dp.scl(thickness));
|
Lines.stroke(Unit.dp.scl(thickness));
|
||||||
Draw.linerect(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
|
Lines.rect(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package io.anuke.mindustry.ui;
|
|||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
|
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.scene.Element;
|
import io.anuke.ucore.scene.Element;
|
||||||
|
|
||||||
public class GridImage extends Element{
|
public class GridImage extends Element{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import com.badlogic.gdx.Gdx;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.ucore.scene.ui.Dialog;
|
import io.anuke.ucore.scene.ui.Dialog;
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ public class DiscordDialog extends Dialog {
|
|||||||
content().row();
|
content().row();
|
||||||
content().add("[orange]"+ Vars.discordURL);
|
content().add("[orange]"+ Vars.discordURL);
|
||||||
buttons().defaults().size(200f, 50);
|
buttons().defaults().size(200f, 50);
|
||||||
buttons().addButton("$text.openlink", () -> Mindustry.platforms.openLink(Vars.discordURL));
|
buttons().addButton("$text.openlink", () -> Gdx.net.openURI(Vars.discordURL));
|
||||||
buttons().addButton("$text.back", this::hide);
|
buttons().addButton("$text.back", this::hide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
|||||||
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.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class BackgroundFragment implements Fragment {
|
public class BackgroundFragment implements Fragment {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import io.anuke.mindustry.core.GameState.State;
|
|||||||
import io.anuke.mindustry.input.InputHandler;
|
import io.anuke.mindustry.input.InputHandler;
|
||||||
import io.anuke.mindustry.resource.*;
|
import io.anuke.mindustry.resource.*;
|
||||||
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
import io.anuke.ucore.scene.actions.Actions;
|
import io.anuke.ucore.scene.actions.Actions;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.entities.Player;
|
|||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.net.Packets.KickReason;
|
import io.anuke.mindustry.net.Packets.KickReason;
|
||||||
import io.anuke.mindustry.ui.BorderImage;
|
import io.anuke.mindustry.ui.BorderImage;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Inputs;
|
import io.anuke.ucore.core.Inputs;
|
||||||
import io.anuke.ucore.scene.builders.label;
|
import io.anuke.ucore.scene.builders.label;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types;
|
|||||||
|
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.function.Predicate;
|
import io.anuke.ucore.function.Predicate;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import com.badlogic.gdx.math.MathUtils;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.function.Predicate;
|
import io.anuke.ucore.function.Predicate;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class LiquidBlock extends Block implements LiquidAcceptor{
|
public class LiquidBlock extends Block implements LiquidAcceptor{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.Wall;
|
import io.anuke.mindustry.world.blocks.types.Wall;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import io.anuke.mindustry.entities.enemies.Enemy;
|
|||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Tmp;
|
import io.anuke.ucore.util.Tmp;
|
||||||
@@ -54,14 +55,14 @@ public class LaserTurret extends PowerTurret{
|
|||||||
|
|
||||||
Draw.color(Tmp.c1.set(beamColor).mul(1f + lighten, 1f + lighten, 1f + lighten, 1f));
|
Draw.color(Tmp.c1.set(beamColor).mul(1f + lighten, 1f + lighten, 1f + lighten, 1f));
|
||||||
Draw.alpha(0.3f);
|
Draw.alpha(0.3f);
|
||||||
Draw.thickness(4f);
|
Lines.stroke(4f);
|
||||||
Draw.line(x, y, x2, y2);
|
Lines.line(x, y, x2, y2);
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.rect("circle", x2, y2, 7f, 7f);
|
Draw.rect("circle", x2, y2, 7f, 7f);
|
||||||
Draw.alpha(1f);
|
Draw.alpha(1f);
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.line(x, y, x2, y2);
|
Lines.line(x, y, x2, y2);
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.rect("circle", x2, y2, 5f, 5f);
|
Draw.rect("circle", x2, y2, 5f, 5f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ public class PowerTurret extends Turret implements PowerAcceptor{
|
|||||||
Vector2 offset = getPlaceOffset();
|
Vector2 offset = getPlaceOffset();
|
||||||
|
|
||||||
Draw.color(Color.GREEN);
|
Draw.color(Color.GREEN);
|
||||||
Draw.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range);
|
Lines.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
drawPowerBar(tile);
|
drawPowerBar(tile);
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
@@ -70,7 +71,7 @@ public class RepairTurret extends PowerTurret{
|
|||||||
@Override
|
@Override
|
||||||
public void drawSelect(Tile tile){
|
public void drawSelect(Tile tile){
|
||||||
Draw.color(Color.GREEN);
|
Draw.color(Color.GREEN);
|
||||||
Draw.dashCircle(tile.worldx(), tile.worldy(), range);
|
Lines.dashCircle(tile.worldx(), tile.worldy(), range);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
drawPowerBar(tile);
|
drawPowerBar(tile);
|
||||||
@@ -89,14 +90,14 @@ public class RepairTurret extends PowerTurret{
|
|||||||
|
|
||||||
Draw.color(Hue.rgb(138, 244, 138, (MathUtils.sin(Timers.time()) + 1f) / 14f));
|
Draw.color(Hue.rgb(138, 244, 138, (MathUtils.sin(Timers.time()) + 1f) / 14f));
|
||||||
Draw.alpha(0.3f);
|
Draw.alpha(0.3f);
|
||||||
Draw.thickness(4f);
|
Lines.stroke(4f);
|
||||||
Draw.line(x, y, x2, y2);
|
Lines.line(x, y, x2, y2);
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.rect("circle", x2, y2, 7f, 7f);
|
Draw.rect("circle", x2, y2, 7f, 7f);
|
||||||
Draw.alpha(1f);
|
Draw.alpha(1f);
|
||||||
Draw.thickness(2f);
|
Lines.stroke(2f);
|
||||||
Draw.line(x, y, x2, y2);
|
Lines.line(x, y, x2, y2);
|
||||||
Draw.thickness(1f);
|
Lines.stroke(1f);
|
||||||
Draw.rect("circle", x2, y2, 5f, 5f);
|
Draw.rect("circle", x2, y2, 5f, 5f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
@@ -103,7 +104,7 @@ public class Turret extends Block{
|
|||||||
Vector2 offset = getPlaceOffset();
|
Vector2 offset = getPlaceOffset();
|
||||||
|
|
||||||
Draw.color(Color.GREEN);
|
Draw.color(Color.GREEN);
|
||||||
Draw.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range);
|
Lines.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
TurretEntity entity = tile.entity();
|
TurretEntity entity = tile.entity();
|
||||||
@@ -118,8 +119,8 @@ public class Turret extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color(Color.PURPLE);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.dashCircle(x*Vars.tilesize, y*Vars.tilesize, range);
|
Lines.dashCircle(x*Vars.tilesize, y*Vars.tilesize, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -198,15 +199,15 @@ public class Turret extends Block{
|
|||||||
predictY = entity.target.y + entity.target.velocity.y * hittime;
|
predictY = entity.target.y + entity.target.velocity.y * hittime;
|
||||||
|
|
||||||
Draw.color(Color.GREEN);
|
Draw.color(Color.GREEN);
|
||||||
Draw.line(tile.worldx(), tile.worldy(), entity.target.x, entity.target.y);
|
Lines.line(tile.worldx(), tile.worldy(), entity.target.x, entity.target.y);
|
||||||
|
|
||||||
Draw.color(Color.RED);
|
Draw.color(Color.RED);
|
||||||
Draw.line(tile.worldx(), tile.worldy(), entity.target.x + entity.target.velocity.x * hittime,
|
Lines.line(tile.worldx(), tile.worldy(), entity.target.x + entity.target.velocity.x * hittime,
|
||||||
entity.target.y + entity.target.velocity.y * hittime);
|
entity.target.y + entity.target.velocity.y * hittime);
|
||||||
|
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color(Color.PURPLE);
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
Draw.lineAngle(tile.worldx(), tile.worldy(), angle, 7f);
|
Lines.lineAngle(tile.worldx(), tile.worldy(), angle, 7f);
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Bits;
|
import io.anuke.ucore.util.Bits;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|
||||||
public class LiquidItemJunction extends LiquidBlock{
|
public class LiquidItemJunction extends LiquidBlock{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.distribution;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
|
||||||
public class LiquidJunction extends Conduit{
|
public class LiquidJunction extends Conduit{
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.distribution;
|
|||||||
|
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
|
||||||
public class LiquidRouter extends Conduit{
|
public class LiquidRouter extends Conduit{
|
||||||
protected final int timerDump = timers++;
|
protected final int timerDump = timers++;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.Generator;
|
import io.anuke.mindustry.world.blocks.types.production.Generator;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class PowerBooster extends Generator{
|
public class PowerBooster extends Generator{
|
||||||
@@ -28,15 +29,15 @@ public class PowerBooster extends Generator{
|
|||||||
super.drawSelect(tile);
|
super.drawSelect(tile);
|
||||||
|
|
||||||
Draw.color(Color.YELLOW);
|
Draw.color(Color.YELLOW);
|
||||||
Draw.dashCircle(tile.worldx(), tile.worldy(), powerRange * Vars.tilesize);
|
Lines.dashCircle(tile.worldx(), tile.worldy(), powerRange * Vars.tilesize);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color(Color.PURPLE);
|
||||||
Draw.thick(1f);
|
Lines.stroke(1f);
|
||||||
Draw.dashCircle(x * Vars.tilesize, y * Vars.tilesize, powerRange * Vars.tilesize);
|
Lines.dashCircle(x * Vars.tilesize, y * Vars.tilesize, powerRange * Vars.tilesize);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.scene.style.TextureRegionDrawable;
|
import io.anuke.ucore.scene.style.TextureRegionDrawable;
|
||||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||||
import io.anuke.ucore.scene.ui.ImageButton;
|
import io.anuke.ucore.scene.ui.ImageButton;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ import io.anuke.mindustry.world.Layer;
|
|||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
import io.anuke.mindustry.world.blocks.types.PowerAcceptor;
|
||||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
|
import io.anuke.ucore.graphics.Shapes;
|
||||||
import io.anuke.ucore.util.*;
|
import io.anuke.ucore.util.*;
|
||||||
|
|
||||||
public class Generator extends PowerBlock{
|
public class Generator extends PowerBlock{
|
||||||
@@ -59,15 +61,15 @@ public class Generator extends PowerBlock{
|
|||||||
int rotation = tile.getRotation();
|
int rotation = tile.getRotation();
|
||||||
if(hasLasers){
|
if(hasLasers){
|
||||||
Draw.color(Color.YELLOW);
|
Draw.color(Color.YELLOW);
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
|
|
||||||
for(int i = 0; i < laserDirections; i++){
|
for(int i = 0; i < laserDirections; i++){
|
||||||
int dir = Mathf.mod(i + rotation - laserDirections / 2, 4);
|
int dir = Mathf.mod(i + rotation - laserDirections / 2, 4);
|
||||||
float lx = Geometry.getD4Points()[dir].x, ly = Geometry.getD4Points()[dir].y;
|
float lx = Geometry.d4[dir].x, ly = Geometry.d4[dir].y;
|
||||||
float dx = lx * laserRange * Vars.tilesize;
|
float dx = lx * laserRange * Vars.tilesize;
|
||||||
float dy = ly * laserRange * Vars.tilesize;
|
float dy = ly * laserRange * Vars.tilesize;
|
||||||
|
|
||||||
Draw.dashLine(
|
Lines.dashLine(
|
||||||
tile.worldx() + lx * Vars.tilesize / 2,
|
tile.worldx() + lx * Vars.tilesize / 2,
|
||||||
tile.worldy() + ly * Vars.tilesize / 2,
|
tile.worldy() + ly * Vars.tilesize / 2,
|
||||||
tile.worldx() + dx - lx * Vars.tilesize,
|
tile.worldx() + dx - lx * Vars.tilesize,
|
||||||
@@ -83,14 +85,14 @@ public class Generator extends PowerBlock{
|
|||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
if(hasLasers){
|
if(hasLasers){
|
||||||
Draw.color(Color.PURPLE);
|
Draw.color(Color.PURPLE);
|
||||||
Draw.thick(2f);
|
Lines.stroke(2f);
|
||||||
|
|
||||||
for(int i = 0; i < laserDirections; i++){
|
for(int i = 0; i < laserDirections; i++){
|
||||||
int dir = Mathf.mod(i + rotation - laserDirections / 2, 4);
|
int dir = Mathf.mod(i + rotation - laserDirections / 2, 4);
|
||||||
float lx = Geometry.getD4Points()[dir].x, ly = Geometry.getD4Points()[dir].y;
|
float lx = Geometry.d4[dir].x, ly = Geometry.d4[dir].y;
|
||||||
float dx = lx * laserRange * Vars.tilesize;
|
float dx = lx * laserRange * Vars.tilesize;
|
||||||
float dy = ly * laserRange * Vars.tilesize;
|
float dy = ly * laserRange * Vars.tilesize;
|
||||||
Draw.dashLine(
|
Lines.dashLine(
|
||||||
x * Vars.tilesize + lx * Vars.tilesize / 2,
|
x * Vars.tilesize + lx * Vars.tilesize / 2,
|
||||||
y * Vars.tilesize + ly * Vars.tilesize / 2,
|
y * Vars.tilesize + ly * Vars.tilesize / 2,
|
||||||
x * Vars.tilesize + dx - lx * Vars.tilesize,
|
x * Vars.tilesize + dx - lx * Vars.tilesize,
|
||||||
@@ -193,13 +195,13 @@ public class Generator extends PowerBlock{
|
|||||||
int relative = tile.relativeTo(target.x, target.y);
|
int relative = tile.relativeTo(target.x, target.y);
|
||||||
|
|
||||||
if(relative == -1){
|
if(relative == -1){
|
||||||
Draw.laser("laser", "laserend", tile.worldx() + Angles.x(), tile.worldy() + Angles.y(),
|
Shapes.laser("laser", "laserend", tile.worldx() + Angles.x(), tile.worldy() + Angles.y(),
|
||||||
target.worldx() - Tmp.v1.x + Mathf.range(r),
|
target.worldx() - Tmp.v1.x + Mathf.range(r),
|
||||||
target.worldy() - Tmp.v1.y + Mathf.range(r), 0.7f);
|
target.worldy() - Tmp.v1.y + Mathf.range(r), 0.7f);
|
||||||
}else{
|
}else{
|
||||||
Draw.rect("laserfull",
|
Draw.rect("laserfull",
|
||||||
tile.worldx() + Geometry.getD4Points()[relative].x * width * Vars.tilesize / 2f,
|
tile.worldx() + Geometry.d4[relative].x * width * Vars.tilesize / 2f,
|
||||||
tile.worldy() + Geometry.getD4Points()[relative].y * width * Vars.tilesize / 2f);
|
tile.worldy() + Geometry.d4[relative].y * width * Vars.tilesize / 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
@@ -223,7 +225,7 @@ public class Generator extends PowerBlock{
|
|||||||
|
|
||||||
protected Tile laserTarget(Tile tile, int rotation){
|
protected Tile laserTarget(Tile tile, int rotation){
|
||||||
rotation = Mathf.mod(rotation, 4);
|
rotation = Mathf.mod(rotation, 4);
|
||||||
GridPoint2 point = Geometry.getD4Points()[rotation];
|
GridPoint2 point = Geometry.d4[rotation];
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||||||
import io.anuke.mindustry.graphics.Fx;
|
import io.anuke.mindustry.graphics.Fx;
|
||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidAcceptor;
|
import io.anuke.mindustry.world.blocks.types.LiquidAcceptor;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.util.Tmp;
|
import io.anuke.ucore.util.Tmp;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.Layer;
|
import io.anuke.mindustry.world.Layer;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.graphics.Fx;
|
|||||||
import io.anuke.mindustry.resource.Item;
|
import io.anuke.mindustry.resource.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.resource.UpgradeRecipes;
|
|||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.function.Listenable;
|
import io.anuke.ucore.function.Listenable;
|
||||||
import io.anuke.ucore.scene.style.TextureRegionDrawable;
|
import io.anuke.ucore.scene.style.TextureRegionDrawable;
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ import io.anuke.mindustry.net.Net;
|
|||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@@ -72,16 +70,6 @@ public class DesktopLauncher {
|
|||||||
return NumberFormat.getIntegerInstance().format(number);
|
return NumberFormat.getIntegerInstance().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openLink(String link){
|
|
||||||
try{
|
|
||||||
Desktop.getDesktop().browse(URI.create(link));
|
|
||||||
}catch(IOException e){
|
|
||||||
e.printStackTrace();
|
|
||||||
Vars.ui.showError("Error opening link.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String text){
|
public void showError(String text){
|
||||||
JOptionPane.showMessageDialog(null, text);
|
JOptionPane.showMessageDialog(null, text);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import com.google.gwt.dom.client.Style;
|
|||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
import com.google.gwt.i18n.client.NumberFormat;
|
||||||
import com.google.gwt.i18n.shared.DateTimeFormat;
|
import com.google.gwt.i18n.shared.DateTimeFormat;
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
import com.google.gwt.user.client.ui.*;
|
import com.google.gwt.user.client.ui.*;
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.io.PlatformFunction;
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
@@ -108,11 +107,6 @@ public class HtmlLauncher extends GwtApplication {
|
|||||||
return NumberFormat.getDecimalFormat().format(number);
|
return NumberFormat.getDecimalFormat().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openLink(String link){
|
|
||||||
Window.open(link, "_blank", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canJoinGame(){
|
public boolean canJoinGame(){
|
||||||
String ref = Document.get().getReferrer();
|
String ref = Document.get().getReferrer();
|
||||||
|
|||||||
Reference in New Issue
Block a user