Beispiel #1
0
 public Game(Window window)
     : base(Rectangle.Zero)
 {
     Settings.Current.LimitFramerate = 60;
     window.ViewportPixelSize = Settings.Current.Resolution;
     mainMenu = new Menu();
     mainMenu.InitGame += StartGame;
     mainMenu.QuitGame += window.CloseAfterFrame;
     window.ViewportSizeChanged += size => { Settings.Current.Resolution = size; };
 }
Beispiel #2
0
 public Game(Window window)
 {
     highScores = new int[10];
     TryLoadingHighscores();
     SetUpBackground();
     mainMenu = new Menu();
     mainMenu.InitGame += StartGame;
     mainMenu.QuitGame += window.CloseAfterFrame;
     InteractionLogic = new InteractionLogic();
     mainMenu.UpdateHighscoreDisplay(highScores);
 }
Beispiel #3
0
 public Game(Window window)
 {
     screenSpace = new Camera2DScreenSpace(window);
     screenSpace.Zoom = 1 / window.ViewportPixelSize.AspectRatio;
     gridSize = 25;
     blockSize = 1.0f / gridSize;
     this.window = window;
     menu = new Menu();
     menu.InitGame += StartGame;
     menu.Quit += window.CloseAfterFrame;
     window.ViewportSizeChanged +=
         size => screenSpace.Zoom = (size.AspectRatio > 1) ? 1 / size.AspectRatio : size.AspectRatio;
 }
Beispiel #4
0
 public ColorOptionsMenu(Menu parentMenu)
 {
     this.parentMenu = parentMenu;
     SetViewportBackground("SnakeMainMenuBackground");
     AddBackgroundAndColorDisplay();
     AddGameElementSelection();
     AddColorSliders();
     AddDoneButton();
 }