-
大小: 857KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-11-28
- 語(yǔ)言: C#
- 標(biāo)簽:
資源簡(jiǎn)介
俄羅斯方塊源程序,已經(jīng)調(diào)試好可用,適合C#初學(xué)者使用,參考學(xué)習(xí)。

代碼片段和文件信息
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?成員變量相應(yīng)的屬性
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()//順時(shí)針旋轉(zhuǎn)
{
int?temp;
for(int?i=0;i {
temp=structArr[i].X;
structArr[i].X=structArr[i].Y;
structArr[i].Y=-temp;
}
}
public?void?ContraRotate()//逆時(shí)針旋轉(zhuǎn)
{
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)//坐標(biāo)點(diǎn)轉(zhuǎn)化為畫布坐標(biāo)值
{
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));
}
}
}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????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.xm
?????文件?????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\網(wǎng)站.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.xm
?????文件???????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個(gè)文件信息
評(píng)論
共有 條評(píng)論