feat(Game.java): ajout fonction togglePause

This commit is contained in:
2025-11-01 10:23:51 +01:00
parent 974fa21c3d
commit 2488aec5a2
2 changed files with 40 additions and 9 deletions

View File

@@ -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();