资源简介
坦克大战(小时候的那种插卡游戏,程序已经实现,但还有一些值得改进的地方)
代码片段和文件信息
using MyTankGame.Portal.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Media;
using System.Text;
using System.Windows.Forms;
namespace MyTankGame.Portal
{
public partial class MainForm : Form
{
private Random rand = new Random();
public MainForm()
{
InitializeComponent();
InitialGame(); // 初始化游戏
}
private void InitialGame()
{
//初始化游戏对象
InitialGameobjects();
//初始化游戏事件
InitialGameEvents();
}
private void InitialGameobjects()
{
// 初始化玩家坦克
Game.GetInstance().AddGameobject(new PlayerTank(330 300
10 3 Direction.Up));
// 初始化电脑坦克
for (int i = 0; i < 5; i++)
{
Game.GetInstance().AddGameobject(
new EnemyTank(rand.Next(0 this.Width)
rand.Next(200 this.Height-300)
rand.Next(0 3) Direction.Up));
}
# region 初始化建筑物
//铁墙
Game.GetInstance().AddGameobject(new Steel(0 350));
Game.GetInstance().AddGameobject(new Steel(0 380));
Game.GetInstance().AddGameobject(new Steel(35 350));
Game.GetInstance().AddGameobject(new Steel(35 380));
Game.GetInstance().AddGameobject(new Steel(710 350));
Game.GetInstance().AddGameobject(new Steel(745 350));
Game.GetInstance().AddGameobject(new Steel(710 380));
Game.GetInstance().AddGameobject(new Steel(745 380));
Game.GetInstance().AddGameobject(new Steel(325 150));
Game.GetInstance().AddGameobject(new Steel(360 150));
Game.GetInstance().AddGameobject(new Steel(325 180));
Game.GetInstance().AddGameobject(new Steel(360 180));
//基地
Game.GetInstance().AddGameobject( new Brick(290 620));
Game.GetInstance().AddGameobject(new Brick(290 590));
Game.GetInstance().AddGameobject(new Brick(290 560));
Game.GetInstance().AddGameobject(new Brick(325 560));
Game.GetInstance().AddGameobject(new Brick(360 560));
Game.GetInstance().AddGameobject(new Camp(325 590));
Game.GetInstance().AddGameobject(new Brick(395 620));
Game.GetInstance().AddGameobject(new Brick(395 590));
Game.GetInstance().AddGameobject(new Brick(395 560));
//砖墙
Game.GetInstance().AddGameobject(new Brick(70 350));
Game.GetInstance().AddGameobject(new Brick(70 380));
Game.GetInstance().AddGameobject(new Brick(105 350));
Game.GetInstance().AddGameobject(new Brick(105 380));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 84992 2018-07-02 16:52 MyTankGame\.vs\MyTankGame\v15\.suo
文件 8192 2018-06-29 16:33 MyTankGame\MyTankGame.ProtalV1\.vs\MyTankGame\v15\.suo
文件 1522176 2018-07-02 16:42 MyTankGame\MyTankGame.ProtalV1\bin\Debug\MyTankGame.Portal.exe
文件 95744 2018-07-02 16:42 MyTankGame\MyTankGame.ProtalV1\bin\Debug\MyTankGame.Portal.pdb
文件 22472 2014-12-11 22:51 MyTankGame\MyTankGame.ProtalV1\bin\Debug\MyTankGame.Portal.vshost.exe
文件 490 2010-03-17 22:39 MyTankGame\MyTankGame.ProtalV1\bin\Debug\MyTankGame.PortalV1.vshost.exe.manifest
文件 9324 2018-07-01 16:01 MyTankGame\MyTankGame.ProtalV1\MainForm.cs
文件 2225 2018-06-29 15:36 MyTankGame\MyTankGame.ProtalV1\MainForm.Designer.cs
文件 6383 2018-06-28 16:35 MyTankGame\MyTankGame.ProtalV1\MainForm.resx
文件 7757 2018-06-30 20:10 MyTankGame\MyTankGame.ProtalV1\MyTankGame.csproj
文件 1452 2018-06-25 19:51 MyTankGame\MyTankGame.ProtalV1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 10528 2018-06-30 20:09 MyTankGame\MyTankGame.ProtalV1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 42 2018-06-29 22:15 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.csproj.CoreCompileInputs.cache
文件 1852 2018-06-29 15:44 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.csproj.FileListAbsolute.txt
文件 2746 2018-06-30 20:11 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.csproj.GenerateResource.cache
文件 12802 2018-06-29 15:36 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.csprojResolveAssemblyReference.cache
文件 42 2018-06-29 12:27 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.csproj.CoreCompileInputs.cache
文件 2589 2018-06-29 11:05 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.csproj.FileListAbsolute.txt
文件 2705 2018-06-28 16:35 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.csproj.GenerateResource.cache
文件 12802 2018-06-24 22:14 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.csprojResolveAssemblyReference.cache
文件 1522176 2018-07-02 16:42 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.exe
文件 180 2018-06-30 20:10 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.MainForm.resources
文件 95744 2018-07-02 16:42 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.pdb
文件 1492179 2018-06-30 20:10 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.Portal.Properties.Resources.resources
文件 893 2014-12-06 22:31 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.csproj.FileListAbsolute.txt
文件 2045 2014-12-06 19:56 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.csproj.GenerateResource.Cache
文件 2209 2014-12-06 19:56 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.csprojResolveAssemblyReference.cache
文件 161792 2014-12-06 22:30 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.exe
文件 42496 2014-12-06 22:30 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.pdb
文件 111386 2014-12-06 19:56 MyTankGame\MyTankGame.ProtalV1\obj\Debug\MyTankGame.PortalV1.Properties.Resources.resources
............此处省略96个文件信息
评论
共有 条评论