public GamePage() { this.InitializeComponent(); // Create the game. var launchArguments = string.Empty; _game = MonoGame.Framework.XamlGame <MonsterGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel); }
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"; }
static void Main() { using (var game = new MonsterGame()) game.Run(); }
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; }
static void Main() { using (var game = new MonsterGame()) game.Run(); }