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 Form2 : Form
{
public Form2()
{
InitializeComponent();
}
//随机颜色
Random sj = new Random();//属性的添加
//游戏界面
Panel gm = new Panel();
//飞机盒子创建
PictureBox feijihezi = new PictureBox();
//爆炸效果图
//PictureBox baozha = new PictureBox();
private void Form2_Load(object sender, EventArgs e)
{
//设置背景图片为透明颜色
//this.BackColor = Color.Transparent;
//this.Font = new Font("",50);//字体大小
//this.AutoSize = true;//字体大小自适应
//图片lashen
//this.SizeMode = PictureBoxSizeMode.StretchImage;
//this.Location = new Point(0,0);//相对位置
//this.Size=new Size();
this.BackColor = Color.Pink;
this.Size = new Size(1200,650);
//this.Location = new Point(this.Left/2,this.Top/2);
//把页面放中间
this.Location = new Point(Screen.PrimaryScreen.Bounds.Width/2 - this.Width/2, Screen.PrimaryScreen.Bounds.Height/2 - this.Height/2);
//this.Left = Screen.PrimaryScreen.Bounds.Width-this.Width;
//this.Top = Screen.PrimaryScreen.Bounds.Height-this.Height;
//创建一个游戏页面
//Panel gm
C#飞机大战(注释解释)
最新推荐文章于 2020-11-03 17:07:52 发布
本文详细介绍了使用C#编程实现飞机大战游戏的过程,涵盖了游戏逻辑、图形绘制和用户交互等方面,适合初学者理解C#游戏开发。
摘要由CSDN通过智能技术生成