📄 lbhform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Threading ;
namespace 自娱自乐
{
/// <summary>
/// LBHForm 的摘要说明。
/// </summary>
public class LBHForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel ShootRange;
private System.Windows.Forms.Button ButBegin;
private System.Windows.Forms.Button ButEnd;
private System.Windows.Forms.Timer GameTime;
private System.Windows.Forms.PictureBox Target;
private System.Windows.Forms.Label SuccessTitle;
private System.Windows.Forms.Label SuccessShow;
private System.Windows.Forms.Label BulletNumTitle;
private System.Windows.Forms.Label BulletNumShow;
private System.Windows.Forms.Label DirectionNumShow;
private System.Windows.Forms.Label DirectionNumTitle;
private System.Windows.Forms.Label PowerNumShow;
private System.Windows.Forms.Label CurrentSuccessTitle;
private System.Windows.Forms.Label CurrentSuccessShow;
private System.Windows.Forms.Label LevSuccessShow;
private System.Windows.Forms.Label LevSuccessTitle;
private System.Windows.Forms.Label PowerNumTitle;
private System.ComponentModel.IContainer components;
//定义全局变量
//级别,子弹数,成绩,过关分数,纵向方向,风力,风向
private int Lev,BulletNum,Success,PassNum,TopDirection,PowerNum,DirectionNum;
public LBHForm()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LBHForm));
this.ShootRange = new System.Windows.Forms.Panel();
this.Target = new System.Windows.Forms.PictureBox();
this.ButBegin = new System.Windows.Forms.Button();
this.ButEnd = new System.Windows.Forms.Button();
this.GameTime = new System.Windows.Forms.Timer(this.components);
this.SuccessTitle = new System.Windows.Forms.Label();
this.SuccessShow = new System.Windows.Forms.Label();
this.BulletNumShow = new System.Windows.Forms.Label();
this.BulletNumTitle = new System.Windows.Forms.Label();
this.DirectionNumShow = new System.Windows.Forms.Label();
this.DirectionNumTitle = new System.Windows.Forms.Label();
this.PowerNumShow = new System.Windows.Forms.Label();
this.PowerNumTitle = new System.Windows.Forms.Label();
this.LevSuccessShow = new System.Windows.Forms.Label();
this.LevSuccessTitle = new System.Windows.Forms.Label();
this.CurrentSuccessShow = new System.Windows.Forms.Label();
this.CurrentSuccessTitle = new System.Windows.Forms.Label();
this.ShootRange.SuspendLayout();
this.SuspendLayout();
//
// ShootRange
//
this.ShootRange.BackColor = System.Drawing.Color.Black;
this.ShootRange.Controls.AddRange(new System.Windows.Forms.Control[] {
this.Target});
this.ShootRange.Enabled = false;
this.ShootRange.Name = "ShootRange";
this.ShootRange.Size = new System.Drawing.Size(693, 250);
this.ShootRange.TabIndex = 0;
this.ShootRange.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ShootRange_MouseDown);
//
// Target
//
this.Target.BackColor = System.Drawing.Color.Transparent;
this.Target.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("Target.BackgroundImage")));
this.Target.Enabled = false;
this.Target.Name = "Target";
this.Target.Size = new System.Drawing.Size(100, 100);
this.Target.TabIndex = 0;
this.Target.TabStop = false;
this.Target.Visible = false;
this.Target.Paint += new System.Windows.Forms.PaintEventHandler(this.Target_Paint);
this.Target.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Target_MouseDown);
//
// ButBegin
//
this.ButBegin.BackColor = System.Drawing.Color.Transparent;
this.ButBegin.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.ButBegin.ForeColor = System.Drawing.Color.Lime;
this.ButBegin.Location = new System.Drawing.Point(20, 270);
this.ButBegin.Name = "ButBegin";
this.ButBegin.Size = new System.Drawing.Size(100, 30);
this.ButBegin.TabIndex = 1;
this.ButBegin.Text = "开 始";
this.ButBegin.Click += new System.EventHandler(this.ButBegin_Click);
//
// ButEnd
//
this.ButEnd.BackColor = System.Drawing.Color.Transparent;
this.ButEnd.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.ButEnd.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.ButEnd.ForeColor = System.Drawing.Color.Lime;
this.ButEnd.Location = new System.Drawing.Point(20, 320);
this.ButEnd.Name = "ButEnd";
this.ButEnd.Size = new System.Drawing.Size(100, 30);
this.ButEnd.TabIndex = 2;
this.ButEnd.Text = "退 出";
this.ButEnd.Click += new System.EventHandler(this.ButEnd_Click);
//
// GameTime
//
this.GameTime.Interval = 10;
this.GameTime.Tick += new System.EventHandler(this.GameTime_Tick);
//
// SuccessTitle
//
this.SuccessTitle.BackColor = System.Drawing.Color.Transparent;
this.SuccessTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.SuccessTitle.ForeColor = System.Drawing.Color.Lime;
this.SuccessTitle.Location = new System.Drawing.Point(150, 270);
this.SuccessTitle.Name = "SuccessTitle";
this.SuccessTitle.Size = new System.Drawing.Size(80, 20);
this.SuccessTitle.TabIndex = 3;
this.SuccessTitle.Text = "总成绩:";
this.SuccessTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// SuccessShow
//
this.SuccessShow.BackColor = System.Drawing.Color.Transparent;
this.SuccessShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.SuccessShow.ForeColor = System.Drawing.Color.Lime;
this.SuccessShow.Location = new System.Drawing.Point(240, 270);
this.SuccessShow.Name = "SuccessShow";
this.SuccessShow.Size = new System.Drawing.Size(60, 20);
this.SuccessShow.TabIndex = 4;
this.SuccessShow.Text = "0";
this.SuccessShow.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// BulletNumShow
//
this.BulletNumShow.BackColor = System.Drawing.Color.Transparent;
this.BulletNumShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.BulletNumShow.ForeColor = System.Drawing.Color.Lime;
this.BulletNumShow.Location = new System.Drawing.Point(240, 320);
this.BulletNumShow.Name = "BulletNumShow";
this.BulletNumShow.Size = new System.Drawing.Size(60, 20);
this.BulletNumShow.TabIndex = 6;
this.BulletNumShow.Text = "0";
this.BulletNumShow.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// BulletNumTitle
//
this.BulletNumTitle.BackColor = System.Drawing.Color.Transparent;
this.BulletNumTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.BulletNumTitle.ForeColor = System.Drawing.Color.Lime;
this.BulletNumTitle.Location = new System.Drawing.Point(150, 320);
this.BulletNumTitle.Name = "BulletNumTitle";
this.BulletNumTitle.Size = new System.Drawing.Size(80, 20);
this.BulletNumTitle.TabIndex = 5;
this.BulletNumTitle.Text = "子弹数:";
this.BulletNumTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// DirectionNumShow
//
this.DirectionNumShow.BackColor = System.Drawing.Color.Transparent;
this.DirectionNumShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.DirectionNumShow.ForeColor = System.Drawing.Color.Lime;
this.DirectionNumShow.Location = new System.Drawing.Point(600, 270);
this.DirectionNumShow.Name = "DirectionNumShow";
this.DirectionNumShow.Size = new System.Drawing.Size(60, 20);
this.DirectionNumShow.TabIndex = 8;
this.DirectionNumShow.Text = "无风";
this.DirectionNumShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DirectionNumTitle
//
this.DirectionNumTitle.BackColor = System.Drawing.Color.Transparent;
this.DirectionNumTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.DirectionNumTitle.ForeColor = System.Drawing.Color.Lime;
this.DirectionNumTitle.Location = new System.Drawing.Point(520, 270);
this.DirectionNumTitle.Name = "DirectionNumTitle";
this.DirectionNumTitle.Size = new System.Drawing.Size(80, 20);
this.DirectionNumTitle.TabIndex = 7;
this.DirectionNumTitle.Text = "风 向:";
this.DirectionNumTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// PowerNumShow
//
this.PowerNumShow.BackColor = System.Drawing.Color.Transparent;
this.PowerNumShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.PowerNumShow.ForeColor = System.Drawing.Color.Lime;
this.PowerNumShow.Location = new System.Drawing.Point(600, 320);
this.PowerNumShow.Name = "PowerNumShow";
this.PowerNumShow.Size = new System.Drawing.Size(60, 20);
this.PowerNumShow.TabIndex = 10;
this.PowerNumShow.Text = "0";
this.PowerNumShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// PowerNumTitle
//
this.PowerNumTitle.BackColor = System.Drawing.Color.Transparent;
this.PowerNumTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.PowerNumTitle.ForeColor = System.Drawing.Color.Lime;
this.PowerNumTitle.Location = new System.Drawing.Point(520, 320);
this.PowerNumTitle.Name = "PowerNumTitle";
this.PowerNumTitle.Size = new System.Drawing.Size(80, 20);
this.PowerNumTitle.TabIndex = 9;
this.PowerNumTitle.Text = "风 力:";
this.PowerNumTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// LevSuccessShow
//
this.LevSuccessShow.BackColor = System.Drawing.Color.Transparent;
this.LevSuccessShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.LevSuccessShow.ForeColor = System.Drawing.Color.Lime;
this.LevSuccessShow.Location = new System.Drawing.Point(420, 320);
this.LevSuccessShow.Name = "LevSuccessShow";
this.LevSuccessShow.Size = new System.Drawing.Size(60, 20);
this.LevSuccessShow.TabIndex = 14;
this.LevSuccessShow.Text = "0";
this.LevSuccessShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// LevSuccessTitle
//
this.LevSuccessTitle.BackColor = System.Drawing.Color.Transparent;
this.LevSuccessTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.LevSuccessTitle.ForeColor = System.Drawing.Color.Lime;
this.LevSuccessTitle.Location = new System.Drawing.Point(340, 320);
this.LevSuccessTitle.Name = "LevSuccessTitle";
this.LevSuccessTitle.Size = new System.Drawing.Size(80, 20);
this.LevSuccessTitle.TabIndex = 13;
this.LevSuccessTitle.Text = "此级分数:";
this.LevSuccessTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// CurrentSuccessShow
//
this.CurrentSuccessShow.BackColor = System.Drawing.Color.Transparent;
this.CurrentSuccessShow.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.CurrentSuccessShow.ForeColor = System.Drawing.Color.Lime;
this.CurrentSuccessShow.Location = new System.Drawing.Point(420, 270);
this.CurrentSuccessShow.Name = "CurrentSuccessShow";
this.CurrentSuccessShow.Size = new System.Drawing.Size(60, 20);
this.CurrentSuccessShow.TabIndex = 12;
this.CurrentSuccessShow.Text = "0";
this.CurrentSuccessShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// CurrentSuccessTitle
//
this.CurrentSuccessTitle.BackColor = System.Drawing.Color.Transparent;
this.CurrentSuccessTitle.Font = new System.Drawing.Font("新宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.CurrentSuccessTitle.ForeColor = System.Drawing.Color.Lime;
this.CurrentSuccessTitle.Location = new System.Drawing.Point(340, 270);
this.CurrentSuccessTitle.Name = "CurrentSuccessTitle";
this.CurrentSuccessTitle.Size = new System.Drawing.Size(80, 20);
this.CurrentSuccessTitle.TabIndex = 11;
this.CurrentSuccessTitle.Text = "当前分数:";
this.CurrentSuccessTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// LBHForm
//
this.AcceptButton = this.ButBegin;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Desktop;
this.CancelButton = this.ButEnd;
this.ClientSize = new System.Drawing.Size(692, 373);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.LevSuccessShow,
this.LevSuccessTitle,
this.CurrentSuccessShow,
this.CurrentSuccessTitle,
this.PowerNumShow,
this.PowerNumTitle,
this.DirectionNumShow,
this.DirectionNumTitle,
this.BulletNumShow,
this.BulletNumTitle,
this.SuccessShow,
this.SuccessTitle,
this.ButEnd,
this.ButBegin,
this.ShootRange});
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(700, 400);
this.MinimumSize = new System.Drawing.Size(700, 400);
this.Name = "LBHForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "当代罗宾汉";
this.Load += new System.EventHandler(this.LBHForm_Load);
this.ShootRange.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void LBHForm_Load(object sender, System.EventArgs e)
{
//初始参数
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -