Esempio n. 1
0
        public void Load()
        {
            theme     = MainPage.P1.GetTheme();
            audioPack = MainPage.P1.GetAudioPack();

            currentGamemode = MainPage.P1.GetGamemode();


            spriteBatch = new SpriteBatch(GraphicsDevice);


            themeRenderer = new RenderTarget2D(GraphicsDevice, 1920, 1080);
            boardRenderer = new RenderTarget2D(GraphicsDevice, 440, 880);
            nextRenderer  = new RenderTarget2D(GraphicsDevice, 264, 880);
            holdRenderer  = new RenderTarget2D(GraphicsDevice, 264, 264);
            pauseRenderer = new RenderTarget2D(GraphicsDevice, 1920, 1080);


            IBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/I");
            JBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/J");
            LBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/L");
            OBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/O");
            SBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/S");
            TBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/T");
            ZBlockTex      = Content.Load <Texture2D>($@"Themes/{theme}/Z");
            GhostTex       = Content.Load <Texture2D>($@"Themes/{theme}/Ghost");
            BackgroundTex  = Content.Load <Texture2D>($@"Themes/{theme}/BCG");
            OverlayTex     = Content.Load <Texture2D>($@"Themes/{theme}/Overlay");
            GridTex        = Content.Load <Texture2D>($@"Themes/{theme}/Grid");
            GameOverScreen = Content.Load <Texture2D>($@"Themes/GAMEOVER");
            WinScreen      = Content.Load <Texture2D>($@"Themes/WIN");


            BGM          = Content.Load <Song>($"Audio/{audioPack}/BGM");
            RotateSFX    = Content.Load <SoundEffect>($"Audio/{audioPack}/rotate");
            HarddropSFX  = Content.Load <SoundEffect>($"Audio/{audioPack}/harddrop");
            LineclearSFX = Content.Load <SoundEffect>($"Audio/{audioPack}/lineclear");
            TetrisSFX    = Content.Load <SoundEffect>($"Audio/{audioPack}/tetris");

            neuro = Content.Load <SpriteFont>("Fonts/font");

            MediaPlayer.IsRepeating  = true;
            MediaPlayer.Volume       = (float)MainPage.musicVolume;
            SoundEffect.MasterVolume = (float)MainPage.sfxVolume;
            MediaPlayer.Play(BGM);

            GameTotal = 0;
        }
Esempio n. 2
0
        private void ModeSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            FlipView flipView = (FlipView)sender;
            int      position = flipView.SelectedIndex + 1;

            switch (position)
            {
            case 1:
                selectedMode = new EndlessGM();
                break;

            case 2:
                selectedMode = new MarathonGM();
                break;

            case 3:
                selectedMode = new SprintGM();
                break;
            }
            MainPage.P1.SetGamemode(selectedMode);
        }