summary refs log tree commit diff stats
path: root/src/com/fourisland
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java4
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/util/Interval.java10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java b/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java index 6e87dd0..272c4f0 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java
@@ -94,12 +94,12 @@ public class TitleScreenGameState implements GameState {
94 { 94 {
95 choices.moveUp(); 95 choices.moveUp();
96 96
97 pt.setTimer(2); 97 pt.setTimer(1);
98 } else if (Game.getKey().getKeyCode() == KeyEvent.VK_DOWN) 98 } else if (Game.getKey().getKeyCode() == KeyEvent.VK_DOWN)
99 { 99 {
100 choices.moveDown(); 100 choices.moveDown();
101 101
102 pt.setTimer(2); 102 pt.setTimer(1);
103 } 103 }
104 } 104 }
105 } 105 }
diff --git a/src/com/fourisland/fourpuzzle/util/Interval.java b/src/com/fourisland/fourpuzzle/util/Interval.java index 21a7a74..27d9e6a 100755 --- a/src/com/fourisland/fourpuzzle/util/Interval.java +++ b/src/com/fourisland/fourpuzzle/util/Interval.java
@@ -21,20 +21,20 @@ public class Interval {
21 21
22 public static Interval createTickInterval(int ticks) 22 public static Interval createTickInterval(int ticks)
23 { 23 {
24 return new Interval(Game.FPS*ticks); 24 return createMillisInterval(Game.FPS*ticks);
25 } 25 }
26 26
27 public static Interval createMillisInterval(int millis) 27 public static Interval createMillisInterval(int millis)
28 { 28 {
29 return new Interval(millis); 29 return new Interval(millis*1000000);
30 } 30 }
31 31
32 private long last = System.currentTimeMillis(); 32 private long last = System.nanoTime();
33 public boolean isElapsed() 33 public boolean isElapsed()
34 { 34 {
35 if (last+wait < System.currentTimeMillis()) 35 if (last+wait < System.nanoTime())
36 { 36 {
37 last = System.currentTimeMillis(); 37 last = System.nanoTime();
38 38
39 return true; 39 return true;
40 } 40 }