I have made a car game where my car eats coin.I want to add timer of about 100 seconds and if my car fail to eat all coins in 100 seconds the game must stop.How acn we do it guys?


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public void act() { int timer = 0 ; timer++; if (timer <= 10000 ) { if (Coins <= 100 ) { new Win() } else { new Lose() } } } |
1 2 3 4 | public void text() { showText( "Text " + variable, x, y); } |