C#俄罗斯方块游戏

俄罗斯方块是一款非常经典的老游戏,相比现在的网络游戏和大型游戏而言,俄罗斯方块非常小。不要看似小,要实现俄罗斯方块的全部功能也不容易。

先说说涉及的知识点:继承(不同的方块继承于方块类)、多态(每种方块都可以旋转、初始化,但是每种方块的旋转都不一样,采用抽象方法定义)、简单工厂设计模式(由工厂随机创建方块)等。
(感谢周勇学员整理了所有资料。)
俄罗斯方块分成六个步骤:
1.俄罗斯方块之一——Square类
2.俄罗斯方块之二——Game类
3.俄罗斯方块之三——Block类
4.俄罗斯方块之四——方块子类
5.俄罗斯方块之五——完善Game类
6.俄罗斯方块之六——窗体设计

视频资源稍后上传

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 18
    评论
C#俄罗斯方块游戏using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Xml; using System.IO; using System.Security.Cryptography; using System.Text; using System.Runtime.Serialization.Formatters.Binary; namespace RussiaBlock { public class MainForm : System.Windows.Forms.Form { #region 变量 private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Timer timer1; private Block block; private Block nextBlock; private int nextShapeNO; private bool paused; private DateTime atStart; private DateTime atPause; private TimeSpan pauseTime; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.TextBox textBox1; private ControlForm sform; private Keys[] keys; private System.Windows.Forms.Label label4; private int level; private int startLevel; private bool trans; private int rowDelNum; private bool failed; private System.Windows.Forms.Label label5; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.MenuItem menuItem5; private System.Windows.Forms.MenuItem menuItem6; private AxWMPLib.AxWindowsMediaPlayer axMediaPlayer1; private System.Windows.Forms.MenuItem menuItem7; private System.ComponentModel.IContainer components; #endregion public MainForm() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if(component
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值