public UserInterfacePortrait(BlocksContent content) { this.content = content; AddBackground(); AddGrid(); AddScoreWindow(); AddScore(); }
public Block(BlocksContent content, Randomizer random, Point topLeft) { this.random = random; CreateBricks(content); Left = topLeft.X; Top = topLeft.Y; RenderLayer = (int)Blocks.RenderLayer.Grid; }
public Controller(Orientation displayMode, BlocksContent content) { this.content = content; this.displayMode = displayMode; Add(new Grid(content)); Add(new Soundbank(content)); GameRunning = true; }
public UserInterfaceLandscape(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 Controller(Orientation displayMode, BlocksContent content) { this.content = content; this.displayMode = displayMode; Add(new Grid(content)); Add(new Soundbank(content)); Start<InteractionHandler>(); }
public Soundbank(BlocksContent content) { BlockAffixed = content.Load<Sound>("BlockAffixed"); BlockCouldntMove = 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 MainMenu(BlocksContent content) { this.content = content; CreateMenuTheme(); CreateBackgroundElements(); AddStartButton(); AddHowToPlay(); AddQuitButton(); AddContentSwitcherButton(); }
public UserInterface(BlocksContent content, Renderer renderer) { this.renderer = renderer; this.content = content; AddBackground(); AddGrid(); AddScoreWindow(); AddText(); if (!ExceptionExtensions.IsReleaseMode) AddGridOutline(); }
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), }; }
public Game(Window window) { content = new FruitBlocksContent(); menu = new MainMenu(content); menu.InitGame += () => { //ncrunch: no coverage start menu.Hide(); StartGame(); }; //ncrunch: no coverage end menu.QuitGame += window.CloseAfterFrame; window.Title = "Fruit Blocks"; menu.SwitchContent += SwitchContent; }
public UserInterface(BlocksContent content) { userInterfaceLandscape = new UserInterfaceLandscape(content); userInterfacePortrait = new UserInterfacePortrait(content); ShowUserInterfaceLandscape(); }
//ncrunch: no coverage start public HowToPlaySubMenu(Scene parent, Theme menuTheme, BlocksContent content) { this.parent = parent; this.menuTheme = menuTheme; var backgroundImage = content.Load<Image>("Background"); var backgroundMaterial = new Material(ContentLoader.Load<Shader>(Shader.Position2DUV), backgroundImage, backgroundImage.PixelSize); SetViewportBackground(backgroundMaterial); var gameLogoImage = content.Load<Image>("GameLogo"); var gameLogoMaterial = new Material(ContentLoader.Load<Shader>(Shader.Position2DUV), gameLogoImage, gameLogoImage.PixelSize); Add(new Sprite(gameLogoMaterial, Rectangle.FromCenter(0.5f, 0.35f, 0.4f, 0.2f))); AddControlDescription(); AddBackButton(); }
private void TryInvokeSwitchContent() { contentSwitched = !contentSwitched; switchButton.Text = contentSwitched ? "Fruit Blocks" : "Jewel Blocks"; content = contentSwitched ? new JewelBlocksContent() : (BlocksContent)new FruitBlocksContent(); Remove(gameLogo); CreateBackgroundElements(); if (SwitchContent != null) SwitchContent(contentSwitched); }
private void CreateBricks(BlocksContent content) { int numberOfBricks = content.AreFiveBrickBlocksAllowed ? GetNumberOfBricks() : NormalNumberOfBricks; var image = content.Load<Image>("Block" + random.Get(1, 8)); Bricks = new List<Brick> { new Brick(image, Point.Zero) }; for (int i = 1; i < numberOfBricks; i++) AddBrick(Bricks[i - 1], image); ShiftToTopLeft(); }
public TestGrid(Renderer renderer, BlocksContent content, Randomizer random) : base(renderer, content, random) { }
public void SwitchContent(bool switched) { content = switched ? new JewelBlocksContent() : (BlocksContent)new FruitBlocksContent(); }
private void SwitchContent() { contentSwitched = !contentSwitched; BlocksContent = contentSwitched ? new JewelBlocksContent() : (BlocksContent)new FruitBlocksContent(); Clear(); if (howToPlay != null) howToPlay.Clear(); howToPlay = null; menuScene = null; LoadAndSetup(); }
/// <summary> /// Helps test Controller by allowing FallingBlock and UpcomingBlock to be assigned. /// Also exposes the Soundbank and whether the falling block is falling fast or not. /// </summary> public TestController(Grid grid, Soundbank soundbank, BlocksContent content) : base(grid, soundbank, content) { }
public Grid(Renderer renderer, BlocksContent content, Randomizer random) { this.renderer = renderer; this.content = content; Random = random; }