示例#1
0
 public Game(int w, int h, TemplateArray info, int pix, Color bgColor, Graphics palette, Graphics next, int lv, Color gridC, bool show)
 {
     Width           = w;                        //初始化寬度
     Height          = h;                        //初始化高度
     CoorArray       = new Color[Width, Height]; //初始化所有遊戲方格
     backGroundColor = bgColor;                  //背景顏色
     mainPalette     = palette;                  //主畫布
     nextPalette     = next;
     pixSize         = pix;
     Level           = lv;
     gridColor       = gridC;
     showGrid        = show;
     brickFactory    = new BrickFactory(info, backGroundColor, pixSize);
 }
示例#2
0
        public FromMain()
        {
            InitializeComponent();

            TemplateArray brickTemplate = new TemplateArray();

            brickTemplate.add("0000001000011100000000000", Color.FromArgb(-128));
            brickTemplate.add("0000000000111100000000000", Color.FromArgb(-65536));
            brickTemplate.add("0000000110011000000000000", Color.FromArgb(-16711936));
            brickTemplate.add("0000000100011100000000000", Color.FromArgb(-4144960));
            brickTemplate.add("0000000100011000100000000", Color.FromArgb(-16776961));
            brickTemplate.add("0000000000011100100000000", Color.FromArgb(-65281));
            brickTemplate.add("0000000000011000110000000", Color.FromArgb(-8323073));

            game = new Game(15, 25, brickTemplate, 20, Color.Black,
                            mainPalette.CreateGraphics(),
                            nextPalette.CreateGraphics(),
                            9, Color.Blue, false);

            game.Start();
        }
示例#3
0
 private int rectPix;               //單位矩陣像素寬度
 //初始化磚塊產生工廠基本設定
 public BrickFactory(TemplateArray info, Color bgColor, int pix)
 {
     brickArrray     = info;
     rectPix         = pix;
     backGroundColor = bgColor;
 }