diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 3ed9c66..ef3f49a 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -1,3 +1,4 @@ +import com.raylib.Jaylib; import logique.Maze; import logique.Population; @@ -10,7 +11,7 @@ import static com.raylib.Jaylib.RAYWHITE; public class Main { public static void main(String[] args) { - InitWindow(500, 500, "Labyrinthe"); + InitWindow(500, 600, "Labyrinthe"); SetTargetFPS(100); @@ -26,6 +27,21 @@ public class Main { BeginDrawing(); ClearBackground(RAYWHITE); + // Draw UI + DrawText("Generation: 1", 10, 510, 24, BLACK); + Jaylib.Rectangle r1 = new Jaylib.Rectangle(200, 510, 150, 25); + int btn = GuiButton(r1, "Next generation"); + GuiSetStyle(btn, TEXT_SIZE, 16); + + Jaylib.Rectangle r2 = new Jaylib.Rectangle(200, 550, 150, 25); + int btn2 = GuiButton(r2, "Replay"); + GuiSetStyle(btn2, TEXT_SIZE, 16); + + if (btn == 1) { + System.out.println("next gen?"); + } + + // Draw Maze for (int i = 0; i < Maze.MAZE[0].length; i++) { for (int j = 0; j < Maze.MAZE.length; j++) { if (Maze.MAZE[j][i] == 1) { @@ -40,8 +56,6 @@ public class Main { moves.removeFirst(); lastTime = System.currentTimeMillis(); } - - DrawFPS(20, 20); EndDrawing(); }