This commit is contained in:
Anuken 2020-02-29 19:37:14 -05:00
parent 26c328ae34
commit 4b36a6d5bd
7 changed files with 21 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.graphics.gl.*;
import arc.math.*;
import arc.math.geom.*;
import arc.scene.ui.layout.*;
import arc.util.*;
import mindustry.content.*;
@ -33,7 +32,6 @@ public class Renderer implements ApplicationListener{
private float camerascale = targetscale;
private float landscale = 0f, landTime;
private float minZoomScl = Scl.scl(0.01f);
private Rect rect = new Rect(), rect2 = new Rect();
private float shakeIntensity, shaketime;
public Renderer(){
@ -169,6 +167,8 @@ public class Renderer implements ApplicationListener{
Draw.proj(camera.projection());
drawBackground();
blocks.floor.drawFloor();
Groups.drawFloor();
@ -183,7 +183,9 @@ public class Renderer implements ApplicationListener{
blocks.floor.endDraw();
blocks.drawBlocks(Layer.block);
blocks.drawFog();
if(state.rules.drawFog){
blocks.drawFog();
}
blocks.drawDestroyed();
@ -240,6 +242,10 @@ public class Renderer implements ApplicationListener{
Draw.flush();
}
private void drawBackground(){
}
private void drawLanding(){
if(landTime > 0 && player.closestCore() != null){
float fract = landTime / Fx.coreLand.lifetime;

View File

@ -376,8 +376,8 @@ public class World{
}
}
Tile tile = world.rawTile(x, y);
if(tile.block().solid && tile.block().fillsTile && !tile.block().synthetic()){
Tile tile = world.tile(x, y);
if(tile != null && tile.block().solid && tile.block().fillsTile && !tile.block().synthetic()){
dark = Math.max(dark, tile.rotation());
}

View File

@ -93,7 +93,7 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
}
public void lookAt(float angle){
rotation = Angles.moveToward(rotation, angle, type.rotateSpeed);
rotation = Angles.moveToward(rotation, angle, type.rotateSpeed * Time.delta());
}
public void lookAt(Position pos){

View File

@ -68,7 +68,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
axisY = this.y + Angles.trnsy(rotation, axisXOffset, weapon.y);
mount.targetRotation = Angles.angle(axisX, axisY, mount.aimX, mount.aimY) - rotation();
mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed);
mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed * Time.delta());
}else{
mount.rotation = this.rotation;
mount.targetRotation = angleTo(mount.aimX, mount.aimY);

View File

@ -74,6 +74,9 @@ public class Rules{
public boolean tutorial = false;
/** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */
public boolean canGameOver = true;
/** Whether to draw shadows of blocks at map edges and static blocks.
* Do not change unless you know exactly what you are doing.*/
public boolean drawFog = true;
/** Starting items put in cores */
public Array<ItemStack> loadout = Array.with(ItemStack.with(Items.copper, 100));
/** Blocks that cannot be placed. */

View File

@ -82,15 +82,15 @@ public class Build{
return false;
}
Tile tile = world.tile(x, y);
if(tile == null) return false;
//ca check
if(world.getDarkness(x, y) >= 3){
return false;
}
Tile tile = world.tile(x, y);
if(tile == null) return false;
if(type.isMultiblock()){
if(type.canReplace(tile.block()) && tile.block().size == type.size && type.canPlaceOn(tile) && tile.interactable(team)){
return true;

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=7287b37c2a36408da69c156014e96850acd0a4f0
archash=66e5566de0832e721ea552ccd31f0febfb6233d7