First bug free game?
This commit is contained in:
+23
-5
@@ -1,5 +1,7 @@
|
||||
package main;
|
||||
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
@@ -8,12 +10,17 @@ import javax.swing.JFrame;
|
||||
import model.GameModel;
|
||||
import view.GameView;
|
||||
import control.GameControl;
|
||||
import control.GameStateManager;
|
||||
import control.LedHandler;
|
||||
import control.button.ButtonHandler;
|
||||
import control.joystick.JoystickHandler;
|
||||
|
||||
public class Window extends JFrame {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -9222956702898533696L;
|
||||
public static boolean ON_RASP;
|
||||
|
||||
public Window(boolean ON_RASP)
|
||||
@@ -23,7 +30,7 @@ public class Window extends JFrame {
|
||||
setSize(1280, 1024);
|
||||
|
||||
Window.ON_RASP = ON_RASP;
|
||||
System.out.println(ON_RASP);
|
||||
// System.out.println(ON_RASP);
|
||||
|
||||
//Set window close listener
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
@@ -35,7 +42,7 @@ public class Window extends JFrame {
|
||||
|
||||
//Set window to fullscreen
|
||||
// setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
|
||||
setUndecorated(true);
|
||||
// setUndecorated(true);
|
||||
|
||||
//Create Events
|
||||
LedHandler led = null;
|
||||
@@ -43,15 +50,26 @@ public class Window extends JFrame {
|
||||
if(ON_RASP) //TODO REMOVE
|
||||
{
|
||||
led = new LedHandler();
|
||||
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] devices = graphicsEnvironment.getScreenDevices();
|
||||
for(GraphicsDevice divice : devices){
|
||||
System.out.println(divice);
|
||||
}
|
||||
if (!devices[0].isFullScreenSupported ())
|
||||
{
|
||||
throw new UnsupportedOperationException ("Fullscreen mode is unsupported.");
|
||||
}
|
||||
devices[0].setFullScreenWindow(this);
|
||||
}
|
||||
|
||||
ButtonHandler bth = new ButtonHandler(led);
|
||||
JoystickHandler jsh = new JoystickHandler();
|
||||
|
||||
//Create Instances
|
||||
GameView view = new GameView(led);
|
||||
GameModel model = new GameModel(view);
|
||||
GameControl control = new GameControl(model, view);
|
||||
GameStateManager gsm = new GameStateManager();
|
||||
GameView view = new GameView(led,gsm);
|
||||
GameModel model = new GameModel(view,gsm);
|
||||
GameControl control = new GameControl(model, view,gsm);
|
||||
setContentPane(view);
|
||||
|
||||
//Create EventListeners
|
||||
|
||||
Reference in New Issue
Block a user