• 大小: 857KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-11-28
  • 语言: C#
  • 标签:

资源简介

俄罗斯方块源程序,已经调试好可用,适合C#初学者使用,参考学习。

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Drawing;
using System.Text;

namespace Tetris_games
{
    class Block
    {
        protected Point[] structArr;
protected int _xPos;
protected int _yPos;
protected Color _blockColor;
protected Color disapperColor;
protected int rectPix;
public Block()
{
}
public Block(Point[] sa Color bColor Color dColor int pix)
{
_blockColor=bColor;
disapperColor=dColor;
rectPix=pix;
structArr=sa;
}
public Point this[int index]
{
get
{
return structArr[index];
}
}
public int Length
{
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 BlockColor
{
get
{
return _blockColor;
}
}
#endregion
//--------------------------------
public void DeasilRotate()//顺时针旋转
{
int temp;
for(int i=0;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{
temp=structArr[i].X;
structArr[i].X=-structArr[i].Y;
structArr[i].Y=temp;
}
}
private Rectangle PointToRect(Point p)//坐标点转化为画布坐标值
{
return new Rectangle((_xPos + p.X)*rectPix+1
(_yPos-p.Y)*rectPix+1
rectPix-2
rectPix-2);
}
public virtual void Paint(Graphics gp)//制定画板下绘制砖块
{
SolidBrush sb=new SolidBrush(_blockColor);
foreach(Point p in structArr)
{
lock(gp)
{
gp.FillRectangle(sbPointToRect(p));
}
}
}
public void erase(Graphics gp)//擦除矩形
{
SolidBrush sb=new SolidBrush(disapperColor);
foreach(Point p in structArr)
{
lock(gp)
{
gp.FillRectangle(sbPointToRect(p));
}
}
}


    }
}

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

     文件      27738  2015-02-02 21:24  Tetris_games\1.wav

     文件     181760  2015-04-25 11:38  Tetris_games\C#俄罗斯方块(附代码).doc

     文件      43521  2015-04-06 21:14  Tetris_games\C#陈广视频下载地址.doc

     文件      50738  2013-12-12 14:31  Tetris_games\gril.wav

     文件      61440  2015-04-19 12:32  Tetris_games\Tetris_games\bin\Debug\AxInterop.WMPLib.dll

     文件       1307  2015-04-20 23:26  Tetris_games\Tetris_games\bin\Debug\BlockSet.xml

     文件     339968  2015-04-19 12:32  Tetris_games\Tetris_games\bin\Debug\Interop.WMPLib.dll

     文件     315904  2015-04-25 15:01  Tetris_games\Tetris_games\bin\Debug\Tetris_games.exe

     文件      95744  2015-04-25 15:01  Tetris_games\Tetris_games\bin\Debug\Tetris_games.pdb

     文件      14328  2015-04-28 22:35  Tetris_games\Tetris_games\bin\Debug\Tetris_games.vshost.exe

     文件        490  2012-07-26 19:49  Tetris_games\Tetris_games\bin\Debug\Tetris_games.vshost.exe.manifest

     文件          0  2015-04-06 20:49  Tetris_games\Tetris_games\bin\Debug\网站.txt

     文件       1858  2015-04-09 22:17  Tetris_games\Tetris_games\Block.cs

     文件       1435  2015-04-09 22:31  Tetris_games\Tetris_games\BlockGroup.cs

     文件       1152  2015-04-09 12:49  Tetris_games\Tetris_games\BlockInfo.cs

     文件       1000  2015-04-19 12:31  Tetris_games\Tetris_games\BlockSet.xml

     文件       6398  2015-04-09 14:59  Tetris_games\Tetris_games\Config.cs

     文件      11027  2015-04-19 22:48  Tetris_games\Tetris_games\FrmConfig.cs

     文件      24349  2015-04-19 11:21  Tetris_games\Tetris_games\FrmConfig.Designer.cs

     文件       6014  2015-04-19 11:21  Tetris_games\Tetris_games\FrmConfig.resx

     文件       6092  2015-04-25 13:14  Tetris_games\Tetris_games\FrmTetris.cs

     文件      10251  2015-04-19 18:20  Tetris_games\Tetris_games\FrmTetris.Designer.cs

     文件     414578  2015-04-19 18:20  Tetris_games\Tetris_games\FrmTetris.resx

     文件       2892  2015-04-09 12:49  Tetris_games\Tetris_games\InfoArr.cs

     文件      61440  2015-04-19 12:32  Tetris_games\Tetris_games\obj\Debug\AxInterop.WMPLib.dll

     文件     339968  2015-04-19 12:32  Tetris_games\Tetris_games\obj\Debug\Interop.WMPLib.dll

     文件       1232  2015-04-28 22:35  Tetris_games\Tetris_games\obj\Debug\Tetris_games.csproj.FileListAbsolute.txt

     文件        913  2015-04-19 18:20  Tetris_games\Tetris_games\obj\Debug\Tetris_games.csproj.GenerateResource.Cache

     文件        544  2015-04-19 12:32  Tetris_games\Tetris_games\obj\Debug\Tetris_games.csproj.ResolveComReference.cache

     文件     315904  2015-04-25 15:01  Tetris_games\Tetris_games\obj\Debug\Tetris_games.exe

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

评论

共有 条评论