DropBlocks.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tetris
{
/// <summary>
/// 下落组件的基类
/// </summary>
class DropBlocks
{
/// <summary>
/// 坐标
/// </summary>
public Point[] Map;
/// <summary>
/// 组建左上角坐标
/// </summary>
public Point Location { get; set; }
/// <summary>
/// 处理画下一个块
/// </summary>
public bool keyW = false;
/// <summary>
/// 集合
/// </summary>
public List<Block> Blocks
{
get
{
List<Block> bs = new List<Block>();
foreach (var map in Map)
{
Point realPoint = new Point(map.X + Location.X, map.Y + Location.Y);
Block block = new Block(new Rectangle(300 + realPoint.Y * 100, realPoint.X * 100, 100, 100), realPoint);
Block nextblock = new Block(new Rectangle(1500 + map.Y * 100, 500 + map.X * 100, 100, 100), map);
block.IsEmpty = false;
nextblock.IsEmpty = false;
bs.Add(block);
bs.Add(nextblock);
}
return bs;
}
}
public void Draw(Graphics g)
{
foreach (var block in Blocks)
{
block.Draw(g);
}
后面还有 62 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。