C#飞机大战(注释解释)

本文详细介绍了使用C#编程实现飞机大战游戏的过程,涵盖了游戏逻辑、图形绘制和用户交互等方面,适合初学者理解C#游戏开发。
摘要由CSDN通过智能技术生成
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
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值