2020-02-28 21:47:09 +01:00
|
|
|
package dev.lh;
|
|
|
|
|
|
|
|
import dev.lh.ui.GameWindow;
|
|
|
|
|
2020-03-11 22:27:30 +01:00
|
|
|
/**
|
|
|
|
* Project: <strong>Snake</strong><br>
|
|
|
|
* File: <strong>Main.java</strong><br>
|
|
|
|
* Created: <strong>11 Mar 2020</strong><br>
|
|
|
|
*
|
|
|
|
* @author Leon Hofmeister
|
|
|
|
* @since Snake 1.0
|
|
|
|
*/
|
2020-02-28 21:47:09 +01:00
|
|
|
public class Main {
|
|
|
|
|
|
|
|
private static GameWindow game;
|
2020-03-11 22:27:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param args the program arguments
|
|
|
|
* @since Snake 1.0
|
|
|
|
*/
|
2020-02-28 21:47:09 +01:00
|
|
|
public static void main(String[] args) {
|
2020-03-11 22:27:30 +01:00
|
|
|
// if wanted, the StartScreen can be added here
|
2020-02-28 21:47:09 +01:00
|
|
|
startGame();
|
|
|
|
}
|
|
|
|
|
2020-03-11 22:27:30 +01:00
|
|
|
/**
|
|
|
|
* Starts a new game of Snake.
|
|
|
|
*
|
|
|
|
* @since Snake 1.0
|
|
|
|
*/
|
2020-02-28 21:47:09 +01:00
|
|
|
public static void startGame() {
|
|
|
|
game = new GameWindow("Snake");
|
|
|
|
game.setVisible(true);
|
|
|
|
}
|
|
|
|
|
2020-03-11 22:27:30 +01:00
|
|
|
/**
|
|
|
|
* @return the currently used game
|
|
|
|
* @since Snake 1.0
|
|
|
|
*/
|
|
|
|
public static GameWindow getGame() { return game; }
|
2020-02-28 21:47:09 +01:00
|
|
|
}
|