许庭洲 发表于 2012-7-6 13:53
1 ,设计程序的思路就是在一个二维数组里进行的数字交换游戏(当然小游戏是这样的);
2 ,只要把数组的元素在屏 ...
在数组中我存放的是创建的色块对象而且是winform的
色块类是这样的- class Brick
- {
- #region 属性
- private Color brickColor; //颜色
- private int brickScore; //分值
- private int brickWidth; //宽
-
- private int brickHeight; //高
- private SolidBrush brickBrush;
- /// <summary>
- /// 方块颜色
- /// </summary>
- public Color BrickColor
- {
- get { return brickColor; }
- set { brickColor = value; }
- }
-
- /// <summary>
- /// 方块分数
- /// </summary>
- public int BrickScore
- {
- get { return brickScore; }
- set { brickScore = value; }
- }
-
- #endregion
- /// <summary>
- /// 初始化方块
- /// </summary>
- /// <param name="color">方块颜色</param>
- /// <param name="score">方块分值</param>
- public Brick( Color color,int score)
- {
- BrickColor = color;
- BrickScore = score;
- brickBrush = new SolidBrush(color);
- brickWidth = 30;
- brickHeight = 30;
- }
- }
复制代码 |