mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-19 20:27:44 +07:00
Updated pixel rounding, turrets and resources no longer "wobble"
This commit is contained in:
@ -11,6 +11,7 @@ import android.os.Bundle;
|
||||
import io.anuke.mindustry.io.Formatter;
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication {
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
@Override
|
||||
protected void onCreate (Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -79,7 +79,7 @@ project(":core") {
|
||||
apply plugin: "java"
|
||||
|
||||
dependencies {
|
||||
compile 'com.github.anuken:ucore:7d37e1f5d0'
|
||||
compile 'com.github.anuken:ucore:77506a62ac'
|
||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import io.anuke.mindustry.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.input.AndroidInput;
|
||||
import io.anuke.mindustry.input.PlaceMode;
|
||||
@ -70,6 +71,8 @@ public class Renderer extends RendererModule{
|
||||
}else{
|
||||
smoothCamera(World.core.worldx(), World.core.worldy(), 0.4f);
|
||||
}
|
||||
|
||||
limitCamera(4f, player.x, player.y);
|
||||
|
||||
float prex = camera.position.x, prey = camera.position.y;
|
||||
|
||||
@ -86,12 +89,10 @@ public class Renderer extends RendererModule{
|
||||
|
||||
float lastx = camera.position.x, lasty = camera.position.y;
|
||||
|
||||
if(android){
|
||||
camera.position.set((int) camera.position.x, (int) camera.position.y, 0);
|
||||
camera.position.set((int) camera.position.x, (int) camera.position.y, 0);
|
||||
|
||||
if(Gdx.graphics.getHeight() / Core.cameraScale % 2 == 1){
|
||||
camera.position.add(0, -0.5f, 0);
|
||||
}
|
||||
if(Gdx.graphics.getHeight() / Core.cameraScale % 2 == 1){
|
||||
camera.position.add(0, -0.5f, 0);
|
||||
}
|
||||
|
||||
drawDefault();
|
||||
@ -304,8 +305,13 @@ public class Renderer extends RendererModule{
|
||||
for(Entity entity : Entities.all()){
|
||||
if(entity instanceof DestructibleEntity && !(entity instanceof TileEntity)){
|
||||
DestructibleEntity dest = ((DestructibleEntity) entity);
|
||||
|
||||
drawHealth(dest.x, dest.y, dest.health, dest.maxhealth);
|
||||
|
||||
if(dest instanceof Player){
|
||||
drawHealth((int)dest.x, (int)dest.y, dest.health, dest.maxhealth);
|
||||
}else{
|
||||
drawHealth(dest.x, dest.y, dest.health, dest.maxhealth);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class Player extends DestructibleEntity{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Draw.rect("player", x, y, direction.angle()-90);
|
||||
Draw.rect("player", (int)x, (int)y, direction.angle()-90);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user