add camera & terrain defaults to world objects.
parent
d713bd69d5
commit
65e51597fa
|
|
@ -10,9 +10,6 @@ import xyz.valnet.hadean.util.Assets;
|
|||
|
||||
public class Log extends WorldObject implements ITileThing, ISelectable, IHaulable {
|
||||
|
||||
private Camera camera;
|
||||
private Terrain terrain;
|
||||
|
||||
private boolean haul = false;
|
||||
|
||||
public Log(int x, int y) {
|
||||
|
|
@ -20,12 +17,6 @@ public class Log extends WorldObject implements ITileThing, ISelectable, IHaulab
|
|||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
camera = get(Camera.class);
|
||||
terrain = get(Terrain.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Drawing.setLayer(Layers.GROUND);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package xyz.valnet.hadean.gameobjects;
|
|||
|
||||
import xyz.valnet.engine.graphics.Drawing;
|
||||
import xyz.valnet.engine.math.Vector4f;
|
||||
import xyz.valnet.engine.scenegraph.GameObject;
|
||||
import xyz.valnet.hadean.Layers;
|
||||
import xyz.valnet.hadean.Tile;
|
||||
import xyz.valnet.hadean.util.Action;
|
||||
|
|
@ -10,20 +9,11 @@ import xyz.valnet.hadean.util.Assets;
|
|||
|
||||
public class Stockpile extends WorldObject implements ITileThing, ISelectable {
|
||||
|
||||
private Camera camera;
|
||||
private Terrain terrain;
|
||||
|
||||
public Stockpile(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
camera = get(Camera.class);
|
||||
terrain = get(Terrain.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Drawing.setLayer(Layers.GROUND);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import xyz.valnet.hadean.util.Action;
|
|||
import xyz.valnet.hadean.util.Assets;
|
||||
|
||||
public class Tree extends WorldObject implements ITileThing, ISelectable, IWorkable {
|
||||
private Camera camera;
|
||||
|
||||
private boolean chopFlag = false;
|
||||
|
||||
|
|
@ -19,10 +18,6 @@ public class Tree extends WorldObject implements ITileThing, ISelectable, IWorka
|
|||
this.y = y;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
camera = get(Camera.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Assets.flat.pushColor(new Vector4f(1 - getProgress(), 1 - getProgress(), 1 - getProgress(), 1.0f));
|
||||
|
|
|
|||
|
|
@ -7,4 +7,13 @@ public class WorldObject extends GameObject {
|
|||
protected float x;
|
||||
protected float y;
|
||||
|
||||
protected Camera camera;
|
||||
protected Terrain terrain;
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
camera = get(Camera.class);
|
||||
terrain = get(Terrain.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue