Пример #1
0
 private void LoadAndSetup()
 {
     menuScene = BlocksContent.Load <Scene>("MainMenu");
     foreach (var control in menuScene.Controls)
     {
         if (!control.GetType().IsSubclassOf(typeof(Button)))
         {
             continue;
         }
         var button = control as Button;
         if (button.Name == "StartGame")
         {
             button.Clicked += InvokeGameStart;
         }
         if (button.Name == "HowToPlay")
         {
             button.Clicked += ShowHowToPlaySubMenu;
         }
         if (button.Name == "QuitGame")
         {
             button.Clicked += TryInvokeQuit;
         }
         if (button.Name == "ContentSwitcher")
         {
             button.Clicked += SwitchContent;
         }
     }
 }
Пример #2
0
 public Soundbank(BlocksContent content)
 {
     BlockAffixed        = content.Load <Sound>("BlockAffixed");
     BlockCouldNotMove   = content.Load <Sound>("BlockCantMove");
     BlockMoved          = content.Load <Sound>("BlockMoved");
     GameLost            = content.Load <Sound>("GameLost");
     RowRemoved          = content.Load <Sound>("RowRemoved");
     MultipleRowsRemoved = content.Load <Sound>("MultipleRowsRemoved");
 }