File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class BallGame extends Application {
36
36
private int mouseX , mouseY ;
37
37
private static Text scoreText = new Text (10 , 25 , "Score: 0" );
38
38
private static int score = 0 ;
39
- private static Text timeText = new Text (550 , 25 , "Time wasted: 0 " );
39
+ private static Text timeText = new Text (550 , 25 , "Time wasted: 0s " );
40
40
private static long elapsedTime ;
41
41
private static boolean startTimeSet = false ;
42
42
private static Text finalTimeText = new Text (680 , 50 , "12h 48m 14s" );
@@ -51,7 +51,7 @@ public void handle(long now) // in ns
51
51
if (previous == 0 )
52
52
previous = now ;
53
53
float elapsed = (now - previous )/1e9f ; // converted to s
54
- if (!pause ) {
54
+ if (!pause && startTimeSet ) {
55
55
moveEverything (elapsed );
56
56
String currentTime = formatTime ((now - elapsedTime )/1000000000 );
57
57
timeText .setText ("Time wasted: " + currentTime );
You can’t perform that action at this time.
0 commit comments