コード例 #1
0
ファイル: MainMenu.cs プロジェクト: cyecp/DeltaEngine.OpenTK
 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 UserInterfaceLandscape(BlocksContent content)
 {
     this.content = content;
     AddBackground();
     AddGrid();
     AddScoreWindow();
     AddScore();
 }
コード例 #3
0
 public Controller(Orientation displayMode, BlocksContent content)
 {
     this.content     = content;
     this.displayMode = displayMode;
     Add(new Grid(content));
     Add(new Soundbank(content));
     GameRunning = true;
 }
コード例 #4
0
 public UserInterfacePortrait(BlocksContent content)
 {
     this.content = content;
     AddBackground();
     AddGrid();
     AddScoreWindow();
     AddScore();
 }
コード例 #5
0
 public Block(Orientation displayMode, BlocksContent content, Vector2D topLeft)
 {
     this.content = content;
     CreateBricks();
     Left             = topLeft.X;
     Top              = topLeft.Y;
     this.displayMode = displayMode;
 }
コード例 #6
0
ファイル: Soundbank.cs プロジェクト: cyecp/DeltaEngine.OpenTK
 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");
 }
コード例 #7
0
ファイル: Grid.cs プロジェクト: cyecp/DeltaEngine.OpenTK
 public Grid(BlocksContent content)
 {
     this.content  = content;
     zoomBrickData = new ParticleEmitterData
     {
         LifeTime = 0.2f,
         Color    = new RangeGraph <Color>(Color.White, Color.TransparentWhite),
         MaximumNumberOfParticles = 10,
         SpawnInterval            = -1,
         StartVelocity            = new RangeGraph <Vector3D>(Vector2D.Zero, Vector2D.Zero),
         StartPosition            = new RangeGraph <Vector3D>(Vector2D.Zero, Vector2D.Zero),
     };
 }
コード例 #8
0
ファイル: MainMenu.cs プロジェクト: cyecp/DeltaEngine.OpenTK
 private void SwitchContent()
 {
     contentSwitched = !contentSwitched;
     BlocksContent   = contentSwitched
                         ? new JewelBlocksContent() : (BlocksContent) new FruitBlocksContent();
     Clear();
     if (howToPlay != null)
     {
         howToPlay.Clear();
     }
     howToPlay = null;
     menuScene = null;
     LoadAndSetup();
 }
コード例 #9
0
 public UserInterface(BlocksContent content)
 {
     userInterfaceLandscape = new UserInterfaceLandscape(content);
     userInterfacePortrait  = new UserInterfacePortrait(content);
     ShowUserInterfaceLandscape();
 }