欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

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

    • 资源ID:25682757       资源大小:14.54KB        全文页数:15页
    • 资源格式: DOCX        下载积分:30金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要30金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

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

    弹珠小游戏课程设计实验报告 摘要: 这个小程序是关于弹珠的小游戏,游戏比较简单,以小球的速度来区分游戏的难易。该小程序是用左右键控制游戏的开始和挡板的方向,不让小球落到底端,当然,小球的速度越快,该游戏的难度也就越大。此程序利用C#程序编写,在visual studio 2022的环境下进行调试运行的。弹珠原理:碰撞基本都是参照“反射定理”的,就是出射角=入射角,但是做碰撞时需要角度。碰撞的运动和球的方向有关,球的方向有好几种。有8向的,也有4向的。保证小球横向上在允许范围之内运动,当触发时就反方向运动,和当出了球拍的可击打范围就停止运行了。 对于该程序开发,必须达到以下要求: 1、熟悉.NET开发环境,能够使用C#语言在.NET平台上独立设计、开发WINDOWS应用程序。 2、掌握C#语言的异常处理技术,能够使用.NET各种调试方法调试代码,掌握帮助的使用方法。 3、掌握常用控件以及控件的常用属性的使用方法。 4、界面要做到简洁易懂,具有人性化等特点。 5、程序没有在使用过程中不存在任何的问题。 6、可选功能应全面,可以实施速度的选择,游戏的是否继续,还有记录的保存。 目录 摘要: (1) 目录 (1) 一、题目说明 (2) 二、总体设计 (2) 2.1系统开发平台 (2) 三、详细说明 (2) .1系统实施 (3) 四、遇到的问题和解决方法 (28) 五、课程设计总结 (30) 六、参考文献 (30) 附录(源程序代码) (30) 一、题目说明 当今用简单的代码编写的小游戏越来越受人们的欢迎,所以对于小游戏的开发也成为了各大编程人士的最爱。我选择弹珠游戏这个课题,用代码控制游戏的等级,运用不同的函数来控制球的速度和方向,游戏简单而有趣。 二、总体设计 2.1系统开发平台 系统采用Microsoft Visual Studio 2022 三、详细说明 在此弹球游戏中,对于球与挡板的位置,借助于x与y坐标的调整来实现统计,从而确定球落 在板上后球的下一次方向。同时借助于Visual Studio中的控件来控制小球的速度。 此项游戏的计分运用函数count+,打中一个砖块即可得到一分,看你最多能打多少砖块。 .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 private 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() InitializeComponent(); 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(SpeedDialog); 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(); ( 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.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); 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(108, 106); = "button4" this.button4.Size = new System.Drawing.Size(99, 29); this.button4.TabIndex = 5; this.button4.Text = "帮助" eVisualStyleBackColor = false; this.button4.Click += new System.EventHandler(this.button4_Click); this.button3.BackColor = System.Drawing.Color.Cyan; this.button3.Location = new System.Drawing.Point(108, 58); = "button3" this.button3.Size = new System.Drawing.Size(99, 29); this.button3.TabIndex = 4; this.button3.Text = "等级选择" eVisualStyleBackColor = false; this.button3.Click += new System.EventHandler(this.button3_Click); this.button1.BackColor = System.Drawing.Color.FromArgb(int)(byte)(255), (int)(byte)(128), (int)(byte)(128); this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; this.button1.Location = new System.Drawing.Point(107, 11); = "button1" this.button1.Size = new System.Drawing.Size(98, 29); this.button1.TabIndex = 10; this.button1.Text = "进入游戏" eVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); this.button2.BackColor = System.Drawing.Color.FromArgb(int)(byte)(192), (int)(byte)(192), (int)(byte)(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); = "button2" this.button2.Size = new System.Drawing.Size(98, 29); this.button2.TabIndex = 2; this.button2.Text = "退出游戏" eVisualStyleBackColor = false; this.button2.Click += new System.EventHandler(this.button2_Click); this.pictureBox1.BackgroundImage = (System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage"); this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.pictureBox1.Location = new System.Drawing.Point(0, 0); = "pictureBox1" this.pictureBox1.Size = new System.Drawing.Size(318, 344); this.pictureBox1.TabIndex = 3; this.pictureBox1.TabStop = false; this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(316, 349); this.Controls.Add(this.groupBox1); this.Icon = (System.Drawing.Icon)(resources.GetObject("$this.Icon"); = "SpeedDialog" this.Text = "欢迎进入我的弹珠游戏" this.TransparencyKey = System.Drawing.Color.Transparent; this.Load += new System.EventHandler(this.SpeedDialog_Load); this.groupBox1.ResumeLayout(false); ( ponentModel.ISupportInitialize)(this.pictureBox1).EndInit(); this.ResumeLayout(false); #endregion private void SlowRadio_CheckedChanged(object sender, System.EventArgs e) private void button1_Click(object sender, System.EventArgs e) private void MediumRadio_CheckedChanged(object sender, EventArgs e) private void FastRadio_CheckedChanged(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) Application.Exit(); private void button3_Click(object sender, EventArgs e) Form2 SpeedDialog =new Form2(); SpeedDialog.ShowDialog(); this.Speed = SpeedDialog.Speed; private void button4_Click(object sender, EventArgs e) Form3 SpeedDialog = new Form3(); SpeedDialog.ShowDialog(); private void SlowRadio_CheckedChanged_1(object sender, EventArgs e) private void MediumRadio_CheckedChanged_1(object sender, EventArgs e) private void FastRadio_CheckedChanged_1(object sender, EventArgs e) private void SpeedDialog_Load(object sender, EventArgs e) private void pictureBox1_Click(object sender, EventArgs e) 2.游戏帮助:在游戏帮助后,就会跳出一个帮助的界面。阅读帮助后关闭帮助,然后选择难度进行游戏。 图2 游戏帮助 此界面的代码为: using System; using System.Collections.Generic; using ponentModel;

    注意事项

    本文(弹珠小游戏课程设计实验报告.docx)为本站会员(h****)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开