minor polish
parent
c881329591
commit
8c3a18a2e8
|
|
@ -1,17 +1,14 @@
|
|||
package xyz.valnet.hadean.gameobjects;
|
||||
|
||||
import xyz.valnet.engine.Game;
|
||||
import xyz.valnet.engine.graphics.Drawing;
|
||||
import xyz.valnet.engine.math.Vector4f;
|
||||
import xyz.valnet.engine.scenegraph.GameObject;
|
||||
import xyz.valnet.hadean.HadeanGame;
|
||||
import xyz.valnet.hadean.util.Assets;
|
||||
import xyz.valnet.hadean.util.Layers;
|
||||
import xyz.valnet.hadean.util.detail.PercentDetail;
|
||||
|
||||
public class Clock extends GameObject {
|
||||
|
||||
private float time = 7;
|
||||
private float time = 12;
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
|
@ -27,9 +24,12 @@ public class Clock extends GameObject {
|
|||
public String toString() {
|
||||
int hour = (int) Math.floor(time);
|
||||
int minutes = (int) Math.floor((time % 1) * 60);
|
||||
String hs = hour < 10 ? " " + hour : "" + hour;
|
||||
|
||||
String hs = "";
|
||||
if(hour % 12 == 0) hs = "12";
|
||||
else hs = (hour % 12) < 10 ? " " + (hour % 12) : "" + (hour % 12);
|
||||
String ms = minutes < 10 ? "0" + minutes : "" + minutes;
|
||||
return "" + hs + ":" + ms;
|
||||
return "" + hs + ":" + ms + (hour < 12 ? " AM" : " PM");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,8 +52,8 @@ public class Clock extends GameObject {
|
|||
}
|
||||
|
||||
public float getSunlight() {
|
||||
float k = 2;
|
||||
float w = 1;
|
||||
float k = 1;
|
||||
float w = 0;
|
||||
float u = (k * (float) Math.sin((Math.PI*(time - 7))/(12))) + w;
|
||||
double kp = Math.atan(k);
|
||||
float m0 = (float)((Math.atan(k + w)) / kp);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import xyz.valnet.engine.math.Vector4f;
|
|||
import xyz.valnet.hadean.gameobjects.Job;
|
||||
import xyz.valnet.hadean.gameobjects.JobBoard;
|
||||
import xyz.valnet.hadean.gameobjects.Tile;
|
||||
import xyz.valnet.hadean.gameobjects.worldobjects.items.Log;
|
||||
import xyz.valnet.hadean.interfaces.ISelectable;
|
||||
import xyz.valnet.hadean.interfaces.ITileThing;
|
||||
import xyz.valnet.hadean.interfaces.IWorkable;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,11 @@
|
|||
package xyz.valnet.hadean.gameobjects.worldobjects;
|
||||
package xyz.valnet.hadean.gameobjects.worldobjects.items;
|
||||
|
||||
import xyz.valnet.hadean.gameobjects.worldobjects.items.Item;
|
||||
import xyz.valnet.hadean.util.Assets;
|
||||
import xyz.valnet.hadean.util.Layers;
|
||||
import xyz.valnet.hadean.util.detail.Detail;
|
||||
|
||||
public class Log extends Item {
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
super.start();
|
||||
}
|
||||
|
||||
public Log(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
|
@ -5,11 +5,11 @@ import xyz.valnet.hadean.util.detail.PercentDetail;
|
|||
|
||||
public class Needs {
|
||||
|
||||
private float energy = 0.5f + (float)Math.random() * 0.5f;
|
||||
private float energy = 0.7f + (float)Math.random() * 0.3f;
|
||||
private float recreation = 0.5f + (float)Math.random() * 0.5f;
|
||||
|
||||
private float restRatio = 6;
|
||||
private float decay = 0.00001f;
|
||||
private float restRatio = 3;
|
||||
private float decay = 0.000004f;
|
||||
|
||||
public void update(float dTime) {
|
||||
energy = Math.max(energy - decay, 0);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class GameScene extends SceneGraph {
|
|||
objects.add(new JobBoard());
|
||||
objects.add(new Clock());
|
||||
|
||||
for(int i = 0; i < 1; i ++) {
|
||||
for(int i = 0; i < 5; i ++) {
|
||||
objects.add(new Pawn());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue