using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 打字游戏
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Random r = new Random();
//游戏区
Panel Gamearea = new Panel();
//控制区
Panel area = new Panel();
//装鸟的盒子
PictureBox Bird = new PictureBox();
//字母出现定时器
Timer zimu = new Timer();
//飞鸟与字母下落定时器
Timer fly = new Timer();
//开始/暂停按钮
Button button = new Button();
//积分器
Label scoring = new Label();
//血条
Label Bar = new Label();
//尾翼
PictureBox wei = new PictureBox();
PictureBox weiyi = new PictureBox();
//装字母的盒子
List<Label> zmbox = new List<Label>();
private void Form1_Load(object sender, EventArgs e)
{
//button设置
this.KeyPreview = true;
//最大化窗口
this.WindowState = FormWindowState.Maximized;
//背景图
this.BackgroundImage = Image.FromFile("../../img/背景 (2).jpg");
//拉伸
this.BackgroundImageLayout = ImageLayout.Stretch;
//游戏区设置
Gamearea.Size = new Size(1000,750);
//游戏区位置
Gamearea.Location = new Point(30,30);
this.Controls.Add(Gamearea);
Gamearea.Tag = "game";
//控制区设置
area.Size = new Size(300,750);
//控制区位置
area.Location = new Point(Gamearea.Left+Gamearea.Width+20,30);
area.BackColor = Color.Cyan;
this.Controls.Add(area);
//开始/暂停按钮
//Button button = new Button();
button.Text = "开始";
this .KeyPreview = true;
//字体大小
button.Font = new Font("",20);
//按钮大小
button.Size = new Size(100,50);
//按钮颜色
button.BackColor = Color.Blue;
//按钮位置
button.Location = new Point(100,20);
area.Controls.Add(button);
//按钮点击事件
button.Click += Button_Click;
//积分器
//Label scoring = new Label();
scoring.Text = "积分:0";
scoring.Font = new Font("",15);