C# windows窗体应用程序设计
本系列最后一篇,以后不会再以博文的方式呈现。
前言
因为疫情的原因,再加上进入到大三,考证、学业繁忙。加上还要考研的目标,断更了很久。各位看我文章入坑的小伙伴,先说一声抱歉。我想做很多系列,列了很多规划,但这一切都被改变得太快。(本来打算大二上期复习考证等一些列计划全推到本学期,再加上本学期各种专业认知实习)所以后面有些系列更新很慢甚至几乎不会再更新了。在我规划好了时间后,我决定每周末来给大家更新,周末我是专门留着搞其他事情的,其他时间就专心学业和考试。我争取做到每周一更。觉得需要取关的可以取关,我理解。更新强度达不到之前的样子,不能实现之前的规划蓝图。总之,感谢大家的支持。
以下是本篇文章正文内容
一、俄罗斯方块的实现
俄罗斯方块是一款比较经典的游戏,即使没玩过是有听说过的,现在一些节目魔改了俄罗斯方块的玩法,给大家带来了更多的乐趣。现在,动动你的小脑袋,一起来写一个简易的俄罗斯方块游戏吧。
二、步骤
1.部分函数代码
主函数代码如下:
namespace Tetris
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
this.label4 = new System.Windows.Forms.Label();
this.btnStop = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button();
this.lblScore = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.pbNextBlock = new System.Windows.Forms.PictureBox();
this.pbMain = new System.Windows.Forms.PictureBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.musicPlayer = new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(this.pbNextBlock)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbMa