好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

弹珠小游戏课程设计实验报告.doc

22页
  • 卖家[上传人]:大米
  • 文档编号:508465045
  • 上传时间:2024-01-17
  • 文档格式:DOC
  • 文档大小:105.50KB
  • / 22 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 摘要:这个小程序是关于弹珠的小游戏,游戏比较简单,以小球的速度来区分游戏的难易该小程序是用左右键控制游戏的开始和挡板的方向,不让小球落到底端,当然,小球的速度越快,该游戏的难度也就越大此程序利用C#程序编写,在visual studio 2005的环境下进行调试运行的弹珠原理:碰撞基本都是参照"反射定理"的,就是出射角=入射角,但是做碰撞时需要角度碰撞的运动和球的方向有关,球的方向有好几种有8向的,也有4向的保证小球横向上在允许范围之内运动,当触发时就反方向运动,和当出了球拍的可击打范围就停止运行了对于该程序开发,必须达到以下要求:1、熟悉.NET开发环境,能够使用C#语言在.NET平台上独立设计、开发WINDOWS应用程序2、掌握C#语言的异常处理技术,能够使用.NET各种调试方法调试代码,掌握帮助的使用方法3、掌握常用控件以及控件的常用属性的使用方法4、界面要做到简洁易懂,具有人性化等特点5、程序没有在使用过程中不存在任何的问题6、可选功能应全面,可以实施速度的选择,游戏的是否继续,还有记录的保存目录摘要:2目录3一、题目说明4二、总体设计42.1.系统开发平台4三、详细说明43.1系统实施4四、遇到的问题和解决方法20五、课程设计总结22六、参考文献22附录〔源程序代码22一、 题目说明当今用简单的代码编写的小游戏越来越受人们的欢迎,所以对于小游戏的开发也成为了各大编程人士的最爱。

      我选择弹珠游戏这个课题,用代码控制游戏的等级,运用不同的函数来控制球的速度和方向,游戏简单而有趣二、总体设计2.1.系统开发平台系统采用Microsoft Visual Studio 2005三、详细说明在此弹球游戏中,对于球与挡板的位置,借助于x与y坐标的调整来实现统计,从而确定球落在板上后球的下一次方向同时借助于Visual Studio中的控件来控制小球的速度此项游戏的计分运用函数count++,打中一个砖块即可得到一分,看你最多能打多少砖块3.1系统实施1.主界面:打开弹珠游戏,开始运行程序,跳出一个Forms界面,用户在此时必须先选择符合自己能力的游戏等级,然后才可以进行游戏如图1所示 图1. 主界面功能菜单此界面的代码为:using System;using System.Drawing;using System.Collections;using SystemponentModel;using System.Windows.Forms;namespace BrickOut{publicclassSpeedDialog : System.Windows.Forms.Form {private System.Windows.Forms.GroupBox groupBox1;private System.Windows.Forms.Button button1; private SystemponentModel.Container components = null;privateButton button2;privatePictureBox pictureBox1;privateButton button3;privateButton button4;publicint Speed = 250;public SpeedDialog<> { InitializeComponent<>; }protectedoverridevoid Dispose< bool disposing > {if< disposing > {if { components.Dispose<>; } }base.Dispose< disposing >; } #region Windows Form Designer generated codeprivatevoid InitializeComponent<> { SystemponentModelponentResourceManager resources = new SystemponentModelponentResourceManager>;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.Windows.Forms.PictureBox<>;this.groupBox1.SuspendLayout<>; <>.BeginInit<>;this.SuspendLayout<>;this.groupBox1.BackColor = System.Drawing.Color.FromArgb<<<<<224>>>>, <<<<224>>>>, <<<<224>>>>>;this.groupBox1.Controls.Add;this.groupBox1.Controls.Add;this.groupBox1.Controls.Add;this.groupBox1.Controls.Add;this.groupBox1.Controls.Add;this.groupBox1.Location = new System.Drawing.Point<-2, 1>;this.groupBox1.Name = "groupBox1";this.groupBox1.Size = new System.Drawing.Size<320, 344>;this.groupBox1.TabIndex = 0;this.groupBox1.TabStop = false;this.groupBox1.Text = "选择难度";this.button4.BackColor = System.Drawing.Color.FromArgb<<<<<192>>>>, <<<<192>>>>, <<<<255>>>>>;this.button4.ForeColor = System.Drawing.Color.Red;this.button4.Location = new System.Drawing.Point<108, 106>;this.button4.Name = "button4";this.button4.Size = new System.Drawing.Size<99, 29>;this.button4.TabIndex = 5;this.button4.Text = "帮助";this.button4.UseVisualStyleBackColor = false;this.button4.Click += new System.EventHandler; this.button3.BackColor = System.Drawing.Color.Cyan;this.button3.Location = new System.Drawing.Point<108, 58>;this.button3.Name = "button3";this.button3.Size = new System.Drawing.Size<99, 29>;this.button3.TabIndex = 4;this.button3.Text = "等级选择";this.button3.UseVisualStyleBackColor = false;this.button3.Click += new System.EventHandler;this.button1.BackColor = System.Drawing.Color.FromArgb<<<<<255>>>>, <<<<128>>>>, <<<<128>>>>>;this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;this.button1.Location = new System.Drawing.Point<107, 11>;this.button1.Name = "button1";this.button1.Size = new System.Drawing.Size<98, 29>;this.button1.TabIndex = 10;this.button1.Text = "进入游戏";this.button1.UseVisualStyleBackColor = true;this.button1.Click += new System.EventHandler;this.button2.BackColor = System.Drawing.Color.FromArgb<<<<<192>>>>, <<<<192>>>>, <<<<0>>>>>;this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;this.button2.ForeColor = System.Drawing.Color.Blue;this.button2.Location = new System.Drawing.Point<110, 157>;this.button2.Name = "button2";this.button2.Size = new System.Drawing.Size<98, 29>;this.button2.TabIndex = 2;this.button2.Text = "退出游戏";this.button2.UseVisualStyleBackColor = false;this.button2.Click += new System.EventHandler;this.pictureBox1.BackgroundImage。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.