ImageVerifierCode 换一换
格式:DOC , 页数:42 ,大小:1.92MB ,
资源ID:2534396      下载积分:14 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/2534396.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(弹珠小游戏专业课程设计实验报告.doc)为本站上传会员【精***】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

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

1、 摘要: 这个小程序是关于弹珠小游戏,游戏比较简朴,以小球速度来区别游戏难易。该小程序是用左右键控制游戏开始和挡板方向,不让小球落究竟端,固然,小球速度越快,该游戏难度也就越大。此程序运用C#程序编写,在visual studio 环境下进行调试运营。弹珠原理:碰撞基本都是参照“反射定理”,就是出射角=入射角,但是做碰撞时需要角度。碰撞运动和球方向关于,球方向有好几种。有8向,也有4向。保证小球横向上在容许范畴之内运动,当触发时就反方向运动,和当出了球拍可击打范畴就停止运营了。 对于该程序开发,必要达到如下规定: 1、熟悉.NET开发环境,可以使用C#语言在.NET平台上独立设计、开发

2、WINDOWS应用程序。 2、掌握C#语言异常解决技术,可以使用.NET各种调试办法调试代码,掌握协助用法。 3、掌握惯用控件以及控件惯用属性用法。 4、界面要做到简洁易懂,具备人性化等特点。 5、程序没有在使用过程中不存在任何问题。 6、可选功能应全面,可以实行速度选取,游戏与否继续,尚有记录保存。 目 录 摘要: 2 目 录 3 一、 题目阐明 4 二、总体设计 4 2.1.系统开发平台 4 三、详细阐明 4 3.1系统实行 4 四、遇到问题和解决办法 20 五、课程设计总结 22 六、参照文献 22 附

3、录(源程序代码) 22 一、 题目阐明 当今用简朴代码编写小游戏越来越受人们欢迎,因此对于小游戏开发也成为了各大编程人士最爱。我选取弹珠游戏这个课题,用代码控制游戏级别,运用不同函数来控制球速度和方向,游戏简朴而有趣。 二、总体设计 2.1.系统开发平台 系统采用Microsoft Visual Studio 三、详细阐明 在此弹球游戏中,对于球与挡板位置,借助于x与y坐标调节来实现记录,从而拟定球落在板上后球下一次方向。同步借助于Visual Studio中控件来控制小球速度。 此项游戏计分运用函数count++,打中一种砖块即可得到一分

4、看你最多能打多少砖块。 3.1系统实行 1.主界面:打开弹珠游戏,开始运营程序,跳出一种Forms界面,顾客在此时必要先选取符合自己能力游戏级别,然后才可以进行游戏。如图1所示。 图1. 主界面功能菜单 此界面代码为: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace BrickOut { public class SpeedDialog

5、System.Windows.Forms.Form { private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button button1; private System.ComponentModel.Container components = null; private Button button2; private PictureBox pictureBox1; priv

6、ate 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();

7、 } } base.Dispose( disposing ); } #region Windows Form Designer generated code private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SpeedDialog)); th

8、is.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

9、); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); this.groupBox1.BackColor = System.Drawing.C

10、olor.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.b

11、utton2); this.groupBox1.Controls.Add(this.pictureBox1); 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;

12、 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;

13、 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

14、 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); this.button3.Name = "button3"; this.button3.Si

15、ze = new System.Drawing.Size(99,29); this.button3.TabIndex = 4; this.button3.Text = "级别选取"; this.button3.UseVisualStyleBackColor = false; this.button3.Click += new System.EventHandler(this.button3_Click); this.button1.BackColor = Syste

16、m.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); this.button1.Name = "button1";

17、 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.button1_Click); this.button2

18、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 Sys

19、tem.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.butto

20、n2.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.pic

21、tureBox1.Location = new System.Drawing.Point(0,0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(318,344); this.pictureBox1.TabIndex = 3; this.pictureBox1.TabStop = false; this.pictureBox1.Click

22、 += 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);

23、 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "SpeedDialog"; this.Text = "欢迎进入我弹珠游戏"; this.TransparencyKey = System.Drawing.Color.Transparent; this.Load += new System.EventHandler(this.SpeedDialog_Load);

24、 this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } #endregion private void SlowRadio_CheckedChanged(object sender,System.EventArgs e) {

25、 } 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) {

26、 } private void button2_Click(object sender,EventArgs e) { Application.Exit(); } private void button3_Click(object sender,EventArgs e) { Form2 SpeedDialog =new Form2(); SpeedDialog.ShowDialog(); t

27、his.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)

28、 { } 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) {

29、 } private void pictureBox1_Click(object sender,EventArgs e) { } } } 2.游戏协助:在游戏协助后,就会跳出一种协助界面。阅读协助后关闭协助,然后选取难度进行游戏。 图2 游戏协助 此界面代码为: using System; using System.Collections.Generic; using System.ComponentModel

30、 using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace BrickOut { public partial class Form3 :Form { public Form3() { InitializeComponent(); } private void Form3_Load(object sender,Event

31、Args e) { } } } 3.选取游戏难度:在玩家将游戏协助理解后来,接下来就会进行游戏难度选取,玩家依照对游戏操作纯熟限度不同选取相应游戏难度。 图3游戏难度选取界面 此界面代码为: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;

32、 namespace BrickOut { public partial class Form2 :Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender,EventArgs e) { this.Close(); } private void SlowRadio

33、CheckedChanged_1(object sender,EventArgs e) { } private void MediumRadio_CheckedChanged(object sender,EventArgs e) { } private void panel1_Paint(object sender,PaintEventArgs e) { } } } 4.开始游戏:在玩家选

34、取游戏难度后,单击拟定,然后单击“开始游戏”按钮,进入游戏。 图4游戏开始界面 5.游戏结束:游戏结束有两种成果,玩家将所有砖块都打完和玩家将三次机会都挥霍掉。 以上三个界面代码为: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.Inte

35、ropServices; using System.Threading; namespace BrickOut { public class Form1 :System.Windows.Forms.Form { private System.ComponentModel.IContainer components; private const int kNumberOfRows = 8; private const int kNumberOfTries = 3; private i

36、nt NumTotalBricks = 0; private int NumBalls = 0; private Ball TheBall = new Ball(); private Paddle ThePaddle = new Paddle(); private System.Windows.Forms.Timer timer1; private Row[] Rows = new Row[kNumberOfRows]; private Score TheScore = nul

37、l; private Thread oThread = null; [DllImport("winmm.dll")] public static extern long PlaySound(String lpszName,long hModule,long dwFlags); public Form1() { InitializeComponent(); for (int i = 0;i < kNumberOfRows;i++) {

38、 Rows[i] = new Row(i); } ThePaddle.Position.X = 5; ThePaddle.Position.Y = this.ClientRectangle.Bottom - ThePaddle.Height; TheBall.Position.Y = this.ClientRectangle.Bottom - 200; this.SetBounds(this.Left, this.Top,Rows[0].Ge

39、tBounds().Width,this.Height); TheScore = new Score(ClientRectangle.Right - 50,ClientRectangle.Bottom - 180); SpeedDialog dlg = new SpeedDialog(); if (dlg.ShowDialog() == DialogResult.OK) { timer1.Interval =

40、dlg.Speed; } } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } private string m_strCurrentSoundFile = "BallOut.wav";

41、 public void PlayASound() { if (m_strCurrentSoundFile.Length > 0) { } m_strCurrentSoundFile = ""; oThread.Abort(); } public void PlaySoundInThread(string wavefile) { m_strCurrent

42、SoundFile = wavefile; oThread = new Thread(new ThreadStart(PlayASound)); oThread.Start(); } #region Windows Form Designer generated code private void InitializeComponent() { ponents = new System.ComponentModel.Container(); Sys

43、tem.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.timer1 = new System.Windows.Forms.Timer(ponents); this.SuspendLayout(); this.timer1.Tick += new System.EventHan

44、dler(this.timer1_Tick); this.AutoScaleBaseSize = new System.Drawing.Size(6,14); this.ClientSize = new System.Drawing.Size(552,389); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Na

45、me = "Form1"; this.Text = "打砖块"; this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); this.Load += new System.EventHandler(this.Form1_Load);

46、 this.ResumeLayout(false); } #endregion [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; g.FillR

47、ectangle(Brushes.White,0,0,this.ClientRectangle.Width,this.ClientRectangle.Height); TheScore.Draw(g); ThePaddle.Draw(g); DrawRows(g); TheBall.Draw(g); } private void DrawRows(Graphics g) { for (int i = 0;i

48、 < kNumberOfRows;i++) { Rows[i].Draw(g); } } private void CheckForCollision() { if (TheBall.Position.X < 0) { TheBall.XStep *= -1; TheBall.Position.X += TheBall.XStep;

49、 PlaySoundInThread("WallHit.wav"); } if (TheBall.Position.Y < 0) { TheBall.YStep *= -1; TheBall.Position.Y += TheBall.YStep; PlaySoundInThread("WallHit.wav"); } if (TheBall.Position.X > this.ClientRectangle.Right - TheBall.Width ) { TheBall.XStep *= -1; TheBall.Position.X += TheBall.XStep; PlaySoundInThread("WallHit.wav"); } if (TheBall.Position.Y > this.Client

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服