Form1.cs
(开头部分) 49KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Rassion
{
public partial class mainform : Form
{
public Keys left = Keys.Left;////这几个为游戏的键位设置,因为是在Form2中设置,这里定义成public访问属性
public Keys right = Keys.Right;
public Keys down = Keys.Down;
public Keys change = Keys.Space;
public Keys start_puase = Keys.F2;
public Keys setkeys = Keys.F3;
public int grade = 1;///游戏极别,这个级别是控制timer的tick周期的快慢
public Keys newgame = Keys.F4;
private const int x1 = 20;//黑色游戏区域的起始x坐标,以下类推
private const int x2 = 260;
private const int y1 = 20;
private const int y2 = 440;
private const int rows = 21;//行数
private const int cols = 12;//列数
private struct unitrect //每一个方块单元由一个矩形和一个标记位组成,标记位用于记录此单元是否被填充
{
public bool flag;////flag为true时,表明此区域已经被填充了
public Rectangle rect;
};
private unitrect[,] urect;//二维数组,用于表示所有的矩形方框
private struct moder //方块模型,每一个模型都是由四个小方块组成
{
public int x1;
public int x2;
public int x3;
public int x4;
public int y1;
public int y2;
public int y3;
public int y4;
};
private moder[] mymoder;//方块模型
private int currentIndex;//记录当前下落的方块模型的索引
private bool rebuild;
private enum tt_flag { DOWN, LEFT, RIGHT };//任何方块模型在移动时,只能要向左、向右、向下三种操作,定义枚举类型
private int currentcols; //当前方块下落所在的列
private int currentrows; //当前方块下落所在的行
private Random rand;
private bool sync = false;//用于控制当方块左右移动时与时间tick同步的问题,设计思想是,当方块正在判断能否下落时,锁定左右移动操作。
private int nextIndex; //记录下一次将要出现的方块模型的索引
System.Drawing.Drawing2D.LinearGradientBrush wbrush; // 白色画刷
SolidBrush bbrush; //黑色
SolidBrush gbrush; //背景色
private int totalscore = 0; //总得分
private int totaltime = 0; //总耗时
后面还有 828 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。