Time.delta cleanup / Basic mobile input

This commit is contained in:
Anuken
2020-07-19 12:21:21 -04:00
parent f9ed74c15a
commit a074010eb7
91 changed files with 414 additions and 247 deletions

View File

@@ -86,7 +86,7 @@ public class Saves{
}
if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){
time += Time.delta();
time += Time.delta;
if(time > Core.settings.getInt("saveinterval") * 60){
saving = true;

View File

@@ -345,7 +345,7 @@ public class Schematics implements Loadable{
boolean found = false;
for(int cx = x; cx <= x2; cx++){
for(int cy = y; cy <= y2; cy++){
Building linked = world.ent(cx, cy);
Building linked = world.build(cx, cy);
if(linked != null &&linked.block().isVisible() && !(linked.block() instanceof BuildBlock)){
int top = linked.block().size/2;
@@ -373,7 +373,7 @@ public class Schematics implements Loadable{
IntSet counted = new IntSet();
for(int cx = ox; cx <= ox2; cx++){
for(int cy = oy; cy <= oy2; cy++){
Building tile = world.ent(cx, cy);
Building tile = world.build(cx, cy);
if(tile != null && !counted.contains(tile.pos()) && !(tile.block() instanceof BuildBlock)
&& (tile.block().isVisible() || (tile.block() instanceof CoreBlock))){

View File

@@ -84,10 +84,10 @@ public class SectorInfo{
/** Update averages of various stats.
* Called every frame. */
public void update(){
internalTimeSpent += Time.delta();
internalTimeSpent += Time.delta;
//time spent exceeds turn duration!
if(internalTimeSpent >= turnDuration && internalTimeSpent - Time.delta() < turnDuration){
if(internalTimeSpent >= turnDuration && internalTimeSpent - Time.delta < turnDuration){
universe.displayTimeEnd();
}

View File

@@ -63,7 +63,7 @@ public class Universe{
/** Update planet rotations, global time and relevant state. */
public void update(){
secondCounter += Time.delta() / 60f;
secondCounter += Time.delta / 60f;
if(secondCounter >= 1){
seconds += (int)secondCounter;