mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-31 11:11:38 +00:00
feat(Game.java): ajout fonction togglePause
This commit is contained in:
@@ -1,11 +1,27 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
Map m = Map.fromChars(new Character[][] {
|
||||
{'3', '#', '2'},
|
||||
{'#', ' ', 'S'},
|
||||
{'9', '#', 'F'},
|
||||
});
|
||||
|
||||
Thread t = new Thread(() -> {
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(Game.create().togglePause() ? "stop" : "fini");
|
||||
}
|
||||
});
|
||||
|
||||
t.start();
|
||||
Game.create()
|
||||
.init(3, m)
|
||||
.run();
|
||||
|
||||
Reference in New Issue
Block a user