Beispiel #1
0
        public GamePage()
        {
            this.InitializeComponent();

            // Create the game.
            var launchArguments = string.Empty;

            _game = MonoGame.Framework.XamlGame <MonsterGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
        }
Beispiel #2
0
        public MonsterGame()
        {
            Instance = this;

            _graphicsDeviceManager = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = ScreenWidth,
                PreferredBackBufferHeight = ScreenHeight
            };

            IsMouseVisible           = true;
            Window.AllowUserResizing = true;

            _graphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

            Content.RootDirectory = "Content";
        }
Beispiel #3
0
 static void Main()
 {
     using (var game = new MonsterGame())
         game.Run();
 }
Beispiel #4
0
    IEnumerator PlayOnce(AudioClip clip, bool stopMusic , MonsterGame.GameState.GameStatus nextState )
    {
        efxSource.clip = clip;
        efxSource.Play();

        bool wasPlayingMusic = musicSource.isPlaying;

        if (stopMusic)
            musicSource.Pause();

        yield return new WaitForSeconds (efxSource.clip.length);

        if ( nextState != GameState.GameStatus.Unknown )
            GameState.Instance.SetState(nextState);

        if ( stopMusic && wasPlayingMusic )
            musicSource.Play();

        yield return null;
    }
Beispiel #5
0
 static void Main()
 {
     using (var game = new MonsterGame())
         game.Run();
 }