Commit 230e2705 authored by nargessalehi98's avatar nargessalehi98

Add update main.

parent ceb1f536
import javax.swing.*;
import java.awt.*;
import java.io.IOException;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
new LoginFrame(); //new LoginFrame();
//new MainFrame(); //new MainFrame();
//new SettingFrame(); //new SettingFrame();
//new OnlineModeFrame(); //new OnlineModeFrame();
...@@ -10,5 +14,35 @@ public class Main { ...@@ -10,5 +14,35 @@ public class Main {
// jFrame.setBounds(500,500,700,400); // jFrame.setBounds(500,500,700,400);
// jFrame.add(new Map()); // jFrame.add(new Map());
// jFrame.setVisible(true); // jFrame.setVisible(true);
// Initialize the global thread-pool
ThreadPool.init();
// Show the game menu ...
// After the player clicks 'PLAY' ...
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
GameFrame frame = null;
try {
frame = new GameFrame("JTankTrouble");
} catch (AWTException | IOException e) {
e.printStackTrace();
}
frame.setLocationRelativeTo(null); // put frame at center of screen
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.initBufferStrategy();
// Create and execute the game-loop
GameLoop game = new GameLoop(frame);
game.init();
ThreadPool.execute(game);
// and the game starts ...
}
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment