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; } } }
public UserInterfaceLandscape(BlocksContent content) { this.content = content; AddBackground(); AddGrid(); AddScoreWindow(); AddScore(); }
public Controller(Orientation displayMode, BlocksContent content) { this.content = content; this.displayMode = displayMode; Add(new Grid(content)); Add(new Soundbank(content)); GameRunning = true; }
public UserInterfacePortrait(BlocksContent content) { this.content = content; AddBackground(); AddGrid(); AddScoreWindow(); AddScore(); }
public Block(Orientation displayMode, BlocksContent content, Vector2D topLeft) { this.content = content; CreateBricks(); Left = topLeft.X; Top = topLeft.Y; this.displayMode = displayMode; }
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"); }
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), }; }
private void SwitchContent() { contentSwitched = !contentSwitched; BlocksContent = contentSwitched ? new JewelBlocksContent() : (BlocksContent) new FruitBlocksContent(); Clear(); if (howToPlay != null) { howToPlay.Clear(); } howToPlay = null; menuScene = null; LoadAndSetup(); }
public UserInterface(BlocksContent content) { userInterfaceLandscape = new UserInterfaceLandscape(content); userInterfacePortrait = new UserInterfacePortrait(content); ShowUserInterfaceLandscape(); }