Feature/test game sprint1
# Conflicts: # control/GameControl.java # main/Main.java # main/Window.java Sprint 1 finished
This commit is contained in:
+18
-14
@@ -14,12 +14,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)
|
||||
@@ -29,7 +34,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);
|
||||
@@ -40,21 +45,19 @@ public class Window extends JFrame {
|
||||
});
|
||||
|
||||
//Set window to fullscreen
|
||||
// setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
|
||||
// setUndecorated(true);
|
||||
|
||||
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] devices = graphicsEnvironment.getScreenDevices();
|
||||
if (!devices[0].isFullScreenSupported ())
|
||||
{
|
||||
throw new UnsupportedOperationException ("Fullscreen mode is unsupported.");
|
||||
}
|
||||
devices[0].setFullScreenWindow(this);
|
||||
//Create Events
|
||||
LedHandler led = null;
|
||||
|
||||
if(ON_RASP) //TODO REMOVE
|
||||
{
|
||||
led = new LedHandler();
|
||||
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] devices = graphicsEnvironment.getScreenDevices();
|
||||
if (!devices[0].isFullScreenSupported ())
|
||||
{
|
||||
throw new UnsupportedOperationException ("Fullscreen mode is unsupported.");
|
||||
}
|
||||
devices[0].setFullScreenWindow(this);
|
||||
led = new LedHandler();
|
||||
//dissapear cursor
|
||||
BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
|
||||
@@ -66,9 +69,10 @@ public class Window extends JFrame {
|
||||
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