弹珠小游戏课程设计实验报告.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《弹珠小游戏课程设计实验报告.docx》由会员分享,可在线阅读,更多相关《弹珠小游戏课程设计实验报告.docx(15页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、弹珠小游戏课程设计实验报告 摘要: 这个小程序是关于弹珠的小游戏,游戏比较简单,以小球的速度来区分游戏的难易。该小程序是用左右键控制游戏的开始和挡板的方向,不让小球落到底端,当然,小球的速度越快,该游戏的难度也就越大。此程序利用C#程序编写,在visual studio 2022的环境下进行调试运行的。弹珠原理:碰撞基本都是参照“反射定理”的,就是出射角=入射角,但是做碰撞时需要角度。碰撞的运动和球的方向有关,球的方向有好几种。有8向的,也有4向的。保证小球横向上在允许范围之内运动,当触发时就反方向运动,和当出了球拍的可击打范围就停止运行了。 对于该程序开发,必须达到以下要求: 1、熟悉.NE
2、T开发环境,能够使用C#语言在.NET平台上独立设计、开发WINDOWS应用程序。 2、掌握C#语言的异常处理技术,能够使用.NET各种调试方法调试代码,掌握帮助的使用方法。 3、掌握常用控件以及控件的常用属性的使用方法。 4、界面要做到简洁易懂,具有人性化等特点。 5、程序没有在使用过程中不存在任何的问题。 6、可选功能应全面,可以实施速度的选择,游戏的是否继续,还有记录的保存。 目录 摘要: (1) 目录 (1) 一、题目说明 (2) 二、总体设计 (2) 2.1系统开发平台 (2) 三、详细说明 (2) .1系统实施 (3) 四、遇到的问题和解决方法 (28) 五、课程设计总结 (30)
3、 六、参考文献 (30) 附录(源程序代码) (30) 一、题目说明 当今用简单的代码编写的小游戏越来越受人们的欢迎,所以对于小游戏的开发也成为了各大编程人士的最爱。我选择弹珠游戏这个课题,用代码控制游戏的等级,运用不同的函数来控制球的速度和方向,游戏简单而有趣。 二、总体设计 2.1系统开发平台 系统采用Microsoft Visual Studio 2022 三、详细说明 在此弹球游戏中,对于球与挡板的位置,借助于x与y坐标的调整来实现统计,从而确定球落 在板上后球的下一次方向。同时借助于Visual Studio中的控件来控制小球的速度。 此项游戏的计分运用函数count+,打中一个砖块
4、即可得到一分,看你最多能打多少砖块。 .1系统实施 1主界面:打开弹珠游戏,开始运行程序,跳出一个Forms界面,用户在此时必须先选择符合自己能力的游戏等级,然后才可以进行游戏。如图1所示。 图1. 主界面功能菜单 此界面的代码为: using System; using System.Drawing; using System.Collections; using ponentModel; using System.Windows.Forms; namespace BrickOut public class SpeedDialog : System.Windows.Forms.Form pr
5、ivate System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button button1; private ponentModel.Container components = null; private Button button2; private PictureBox pictureBox1; private Button button3; private Button button4; public int Speed = 250; public SpeedDialog() Initialize
6、Component(); protected override void Dispose( bool disposing ) if( disposing ) if(components != null) components.Dispose(); base.Dispose( disposing ); #region Windows Form Designer generated code private void InitializeComponent() ponentResourceManager resources = new ponentResourceManager(typeof(Sp
7、eedDialog); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button4 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Wind
8、ows.Forms.PictureBox(); this.groupBox1.SuspendLayout(); ( ponentModel.ISupportInitialize)(this.pictureBox1).BeginInit(); this.SuspendLayout(); this.groupBox1.BackColor = System.Drawing.Color.FromArgb(int)(byte)(224), (int)(byte)(224), (int)(byte)(224); this.groupBox1.Controls.Add(this.button4); this
9、.groupBox1.Controls.Add(this.button3); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Controls.Add(this.button2); this.groupBox1.Controls.Add(this.pictureBox1); this.groupBox1.Location = new System.Drawing.Point(-2, 1); = groupBox1; this.groupBox1.Size = new System.Drawing.Size(320, 344);
10、 this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = 选择难度; this.button4.BackColor = System.Drawing.Color.FromArgb(int)(byte)(192), (int)(byte)(192), (int)(byte)(255); this.button4.ForeColor = System.Drawing.Color.Red; this.button4.Location = new System.Drawing.Point(10
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 弹珠 小游戏 课程设计 实验 报告
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内