示例#1
0
 public static void AddBrick(Brick b)
 {
     Bricks.Add(b);
     Objects.Add(b);
     b.AddToPanel(RootPanel);
 }
示例#2
0
        private void btnNewGame_Click(object sender, EventArgs e)
        {
            ((Storyboard)Resources["StoryboardNewGame"]).Begin();

            Random r = new Random(DateTime.Now.Second);

            mBall.X = (this.Width - mBall.Width) / 2;

            mBall.Y = mPlayer.Y + mBall.Height;
            mBall.YVel = 9;

            Brick temp;
            Game.AddBrick(temp = new Brick()
            {
                Colour = Block.ColourValue.Blue,
                BlockWidth = 4,
                X = 100,
                Y = 50,
            });

            Game.AddBrick(temp = new Brick()
            {
                Colour = Block.ColourValue.Green,
                BlockWidth = 4,
                X = 200,
                Y = 50,
            });

            Game.AddBrick(temp = new Brick()
            {
                Colour = Block.ColourValue.Grey,
                BlockWidth = 4,
                X = 300,
                Y = 50,
            });
        }