• 大小: 165KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: C#
  • 标签: C#  Puyo  

资源简介

C#编写的PuyoPuyo游戏程序,同色4个方块消去,可以自行设置界面大小,方块个数,方块颜色等,可以学习参考

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace PuyoPuyo
{
    class Block
    {
        protected Point[] structArr;//存放砖块组成信息的坐标数组
        protected int _xPos;//方块中心点所在的x坐标
        protected int _yPos;
        protected Color _blockColor1;//砖块颜色
        protected Color _blockColor2;
        protected Color disapperColor;//擦除砖块时所用的颜色(黑色)
        protected int rectPix;//每单元格像素
        public Block()//默认构造函数,声明此构造函数是为了子类能创建
        {

        }
        public Block(Point[] sa Color bColor1Color bColor2Color dColor int pix)
        {//重载构造函数,给成员变量赋值
            _blockColor1 = bColor1;
            _blockColor2 = bColor2;
            disapperColor = dColor;
            rectPix = pix;
            structArr = sa;
        }
        public Point this[int index]//索引器,根据索引访问砖块里的小方块坐标
        {
            get
            {
                return structArr[index];
            }
        }
        public int Length//属性,表示structArr的长度,配合索引器的使用
        {
            get
            {
                return structArr.Length;
            }
        }
        #region 成员变量相应的属性
        public int XPos
        {
            get
            {
                return _xPos;
            }
            set
            {
                _xPos = value;
            }
        }
        public int YPos
        {
            get
            {
                return _yPos;
            }
            set
            {
                _yPos = value;
            }
        }
        public Color BlockColor1
        {
            get
            {
                return _blockColor1;
            }
        }
        public Color BlockColor2
        {
            get
            {
                return _blockColor2;
            }
        }
        #endregion
        public void DeasilRotate()
        {
            int temp;// x1=yy1=-x
            for (int i = 0; i < structArr.Length; i++)
            {
                temp = structArr[i].X;
                structArr[i].X = structArr[i].Y;
                structArr[i].Y = -temp;
            }
        }
        public void ContraRotate()
        {
            int temp;
            for (int i = 0; i < structArr.Length; i++)
            {
                temp = structArr[i].X;
                structArr[i].X = -structArr[i].Y;
                structArr[i].Y = temp;
            }
        }
        private Rectangle PointToRect(Point p)//Rectangle 矩阵,Point二维平面,把一个坐标点转化为画布的坐标值
        {
            return new Rectangle((_xPos + p.X) * rectPix + 1//左上角坐标x
                                 (_yPos - p.Y) * rectPix + 1
                                 rectPix - 2//方块长度
                                 rectPix - 2); //方块高度
        }
        public virtual void Paint(Graphics gp) //virtual虚方法,指定画板下绘制砖块
        {
            SolidBrush sb1 = new SolidBrush(_blockCol

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        886  2011-01-24 16:09  Puyo\WindowsFormsApplication1\PuyoPuyo.sln

    ..A..H.     47616  2011-02-01 12:02  Puyo\WindowsFormsApplication1\PuyoPuyo.suo

     文件      43008  2011-02-01 11:55  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件      99840  2011-02-01 11:55  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      11600  2011-02-01 12:01  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件      27136  2011-01-24 17:55  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.exe

     文件      48640  2011-01-24 17:55  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\WindowsFormsApplication1.pdb

     文件       3922  2011-02-01 10:54  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\Block.cs

     文件       1519  2011-02-01 11:19  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\BlockGroup.cs

     文件       1427  2011-01-24 17:10  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\BlockInfo.cs

     文件        803  2011-02-01 10:56  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\BlockSet.xml

     文件      10542  2011-01-24 17:46  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\Config.cs

     文件      11168  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\FrmConfig.cs

     文件      22987  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\FrmConfig.Designer.cs

     文件       6017  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\FrmConfig.resx

     文件       4134  2011-02-01 11:40  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\frmPuyoPuyo.cs

     文件       5574  2011-02-01 10:58  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\frmPuyoPuyo.Designer.cs

     文件       5817  2011-02-01 10:58  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\frmPuyoPuyo.resx

     文件       2874  2011-01-24 19:10  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\InfoArr.cs

     文件       7473  2011-01-31 23:25  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6350  2011-02-01 11:55  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1626  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       4586  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       2086  2011-02-01 12:01  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\PuyoPuyo.csproj.FileListAbsolute.txt

     文件        180  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\PuyoPuyo.FrmConfig.resources

     文件        180  2011-02-01 11:18  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\PuyoPuyo.frmPuyoPuyo.resources

     文件        180  2011-02-01 01:23  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\PuyoPuyo.Properties.Resources.resources

     文件       8031  2011-01-31 23:26  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       4608  2011-01-24 16:12  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       2363  2011-01-24 15:32  Puyo\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

............此处省略37个文件信息

评论

共有 条评论