TimeSpan timeElapsed = TimeSpan.Zero; // Amount of time the celebration has been active

        #endregion Fields

        #region Constructors

        public Celebration(Board board, string text, int row, int column)
        {
            this.board = board;
            this.text = text;
            position = new Rectangle(column * board.Blocks[0, 0].Renderer.Width, row * board.Blocks[0, 0].Renderer.Height, board.Blocks[0, 0].Renderer.Width, board.Blocks[0, 0].Renderer.Height);
            board.ParticleEmitters.Add(new ParticleEmitter(board.Screen, 50, new Rectangle(board.Blocks[row, column].Renderer.Rectangle.X + board.Blocks[0, 0].Renderer.Width / 2, board.Blocks[row, column].Renderer.Rectangle.Y + board.Blocks[0, 0].Renderer.Height / 2, 25, 25), new Vector2(-100f, -100f), new Vector2(100f, 100f), Vector2.Zero, Color.Black, Color.White, TimeSpan.FromSeconds(3)));
            texture = board.Screen.ContentManager.Load<Texture2D>("Button");
        }
        public GameplayScreen(ScreenManager screenManager)
            : base(screenManager)
        {
            TransitionDuration = TimeSpan.FromSeconds(1);

            board = new Board(this);
            hud = new HUD(this, board);
            menuButton = new Button(this, "Menu", Color.White, new Rectangle(45, 45, 75, 75), Color.Red);
            menuButton.Selected += menuButton_Selected;
        }
 public BoardRenderer(Board board)
 {
     this.board = board;
     Rectangle = new Rectangle(board.Screen.ScreenManager.Game.WorldViewport.Width / 2 - board.Columns * board.Blocks[0, 0].Renderer.Width / 2, board.Screen.ScreenManager.Game.WorldViewport.Height / 2 - board.Rows * board.Blocks[0, 0].Renderer.Height / 2, board.Columns * board.Blocks[0, 0].Renderer.Width, board.Rows * board.Blocks[0, 0].Renderer.Height);
 }
 public BoardController(Board board)
 {
     this.board = board;
 }
示例#5
0
 // Construct the block
 public Block(Board board, Screen screen, int row, int column)
 {
     Board = board;
     Renderer = new BlockRenderer(this, row, column);
     PopulatingDelay = TimeSpan.FromMilliseconds(random.Next(0, (int)PopulatingMaxDelay.TotalMilliseconds));
 }