MainFrom.cs

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tank_11_14.Properties;
// 下载于www.51aspx.com
namespace Tank_11_14
{
    public partial class MainFrom : Form
    {
       // private static volatile MainForm instance;
        private Image minTank=Resources.mintank;
        private Random rd = new Random();
        private int n = 0;
        private int enemyNum = 24;
        private Image p1Tank = Resources.p1tankU;
        private Image p2Tank = Resources.p2tankU;
        private int count;//剩余的敌人数量
        private bool isStar = false;
        private Font font = new Font("ywq",15,FontStyle.Bold);//字体
        private SolidBrush sbBrash = new SolidBrush(Color.Black);
        public MainFrom()
        {
            InitializeComponent();
            InitMap();
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true);
            initGame();
        }
        //查看
        private void initGame()
        {
            Singleton.Instance.AddElement(new P1Tank(200, 600, 1, 4, direction.U));
            if (StartForm.isMultplayer)
            {
                Singleton.Instance.AddElement(new P2Tank(400, 600, 1, 1, direction.U));
            }
        }

        private void panel_Paint(object sender, PaintEventArgs e)//画坦克事件
        {
            Singleton.Instance.Draw(e.Graphics);
        }

        private void MainFrom_KeyDown(object sender, KeyEventArgs e)
        {
            if (!Singleton.Instance.P1Tank.Enable)
            {
                return;
            }
            //调用坦克的P1tank的方法
            Singleton.Instance.P1Tank.KeyDown(e);
            if (StartForm.isMultplayer)
            {
                Singleton.Instance.P2Tank.KeyDown(e);
            }
        }
后面还有 208 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。