Block.cs
(开头部分) 21KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace 俄罗斯方块
{
class Block
{
public Square square1, square2, square3, square4;//包含关系
private const int squareSize = GameField.squareSize;
public enum BlockTypes
{ //一共有7种形状
underfined,
square,
line,
J,
L,
Z,
T,
S
};
public BlockTypes blockType;
private Color forecolor, backcolor;
public enum RotateDirections
{
North,
East,
South,
West
};
public RotateDirections myRotation = RotateDirections.North;
public Block(Point location,BlockTypes bType)
{
if (bType == BlockTypes.underfined) //随机生成一种形状
{
Random rand=new Random();
blockType = (BlockTypes)(GameField.rand.Next(7) + 1);
}
else
{
blockType = bType;
}
Size squareS = new Size(squareSize,squareSize);
int i = (int)blockType - 1; //设置颜色
forecolor=GameField.BlockForeColor[i];
backcolor=GameField.BlockBackColor[i];
square1 = new Square(squareS,forecolor,backcolor);
square2 = new Square(squareS, forecolor, backcolor);
square3 = new Square(squareS, forecolor, backcolor);
square4 = new Square(squareS, forecolor, backcolor);
后面还有 365 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。