Esempio n. 1
0
        public GameOverMenu(DrawWrapper Drawing, int Score)
        {
            drawing = Drawing;
            Restart = false;
            Quit = false;
            selectedButton = Buttons.None;
            score = "Score: " + Score.ToString();

            restartButton = new Rectangle((int)drawing.GUISize.X / 2 - 400, (int)drawing.GUISize.Y / 2 + 100, 200, 100);
            scoreButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 + 100, 200, 100);
            quitButton = new Rectangle((int)drawing.GUISize.X / 2 + 200, (int)drawing.GUISize.Y / 2 + 100, 200, 100);
        }
Esempio n. 2
0
        public PauseMenu(DrawWrapper Drawing)
        {
            drawing = Drawing;
            Resume = false;
            Options = false;
            Quit = false;
            selectedButton = Buttons.None;

            resumeButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 200, 200, 100);
            optionsButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 50, 200, 100);
            quitButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 + 100, 200, 100);
        }
Esempio n. 3
0
        public MainMenu(DrawWrapper Drawing)
        {
            drawing = Drawing;
            ExitGame = false;
            Start = false;
            Options = false;
            selectedButton = Buttons.None;

            startButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 200, 200, 100);
            optionsButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 50, 200, 100);
            exitButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 + 100, 200, 100);
        }
Esempio n. 4
0
        public OptionsMenu(DrawWrapper Drawing, GraphicsDeviceManager Graphics, AudioWrapper Audio, InputHelper Input)
        {
            drawing = Drawing;
            audio = Audio;
            graphics = Graphics;
            input = Input;
            Quit = false;
            selectedButton = MenuButton.None;

            soundColor = audio.AudioIsEnabled ? Color.DarkGreen : Color.DarkRed;
            musicColor = audio.MusicIsEnabled ? Color.DarkGreen : Color.DarkRed;
            controllerColor = input.ControllerInUse ? Color.DarkGreen : Color.DarkRed;
            fullscreenColor = graphics.IsFullScreen ? Color.DarkGreen : Color.DarkRed;

            soundButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 300, 200, 100);
            musicButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 150, 200, 100);
            //controllerButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 - 50, 200, 100);
            fullscreenButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2, 200, 100);
            quitButton = new Rectangle((int)drawing.GUISize.X / 2 - 100, (int)drawing.GUISize.Y / 2 + 150, 200, 100);
        }
Esempio n. 5
0
        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            drawWrapper = new DrawWrapper(spriteBatch, GraphicsDevice, assetManager);
            audioWrapper = new AudioWrapper(assetManager);

            world = new World();
            mainMenu = new MainMenu(drawWrapper);

            Graphics.PreferMultiSampling = true;
            Graphics.SynchronizeWithVerticalRetrace = true;
            Graphics.PreferredBackBufferWidth = 24 * 20 * 2;
            Graphics.PreferredBackBufferHeight = 24 * 15 * 2;

            Graphics.ApplyChanges();

            IsFixedTimeStep = true;

            TargetElapsedTime = TimeSpan.FromMilliseconds(1000f / 60f);

            IsMouseVisible = true;

            base.Initialize();
        }