diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/util/Interval.java')
-rwxr-xr-x | src/com/fourisland/fourpuzzle/util/Interval.java | 10 |
1 files changed, 5 insertions, 5 deletions
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 | } |