Form1.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tetris
{
    public partial class Form1 : Form
    {
        Timer m_timer;      //定时器
        Canvas m_canvas;    //画布模型
        Graphics m_picturegra;  //画布
        Graphics m_nextpicgra;  //用于显示下一个砖块的画布
        float m_itemxlength;
        float m_itemylength;
        bool m_isrun;

        public Form1()
        {
            InitializeComponent();
            this.Text = "俄罗斯方块";
            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            pictureBox1.BorderStyle = BorderStyle.FixedSingle;
            pictureBox1.Focus();

            label1.Size = new Size(140, 80);
            label1.Location = new Point(440, 140);
            label1.Font = new Font("微软雅黑",8);
            label1.Text = "游戏说明:\n   通过方向键控制砖块。\n   向上键:变形\n   向左键:左移\n   向下键:下移\n   向右键:右移";

            label2.AutoSize = false;
            label2.Location = new Point(440, 280);
            label2.Size = new Size(140, 30);
            label2.Text = "当前分数:0分";

            Btn_NewGame.Location = new Point(440, 320);
            Btn_NewGame.Size = new Size(140, 20);

            Btn_Stop.Location = new Point(440, 350);
            Btn_Stop.Size = new Size(140, 20);

            Btn_Continue.Location = new Point(440, 380);
            Btn_Continue.Size = new Size(140, 20);

            Btn_Quit.Location = new Point(440, 410);
            Btn_Quit.Size = new Size(140, 20);

            m_picturegra = pictureBox1.CreateGraphics();
            m_canvas = new Canvas();
            m_itemxlength = pictureBox1.Width / m_canvas.m_columns;
            m_itemylength = pictureBox1.Height / m_canvas.m_rows;

            pictureBox2.Size = new Size((int)m_itemxlength * 5, (int)m_itemylength * 5);
            //pictureBox2.BorderStyle = BorderStyle.FixedSingle;
            m_nextpicgra = pictureBox2.CreateGraphics();
后面还有 149 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。