FrmMain.cs

(开头部分) 4KB

这里只显示每个文件的开头 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 Tetris
{
    public partial class FrmMain : Form
    {
        private Game game;

        public FrmMain()
        {
            InitializeComponent();
        }
        /// <summary>
        /// Start按钮点击事件:开始游戏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, EventArgs e)
        {
            game = new Game();
            picBoxGame.Height = Game.blockImageHeight * Game.blocksHeight + 3;
            picBoxGame.Width = Game.blockImageWidth * Game.blocksWidth + 3;
            //重绘游戏区域
            picBoxGame.Invalidate(); 
            timerGame.Enabled = true;
            btnStart.Enabled = false;
        }
        /// <summary>
        /// Pause按钮点击事件:暂停游戏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPause_Click(object sender, EventArgs e)
        {
            if (btnPause.Text == "Pause")
            {
                timerGame.Enabled = false;
                btnPause.Text = "Continue";
            }
            else
            {
                timerGame.Enabled = true;
                btnPause.Text = "Pause";
            }
        }
        /// <summary>
        /// End按钮点击事件:结束游戏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEnd_Click(object sender, EventArgs e)
        {
后面还有 102 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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