コード例 #1
0
        private float zombieCountdown; // How often zombies will spawn

        #endregion Fields

        #region Constructors

        public HvZWorld()
        {
            m_Player = new Player(this, new Vector2(300, 300), new Vector2(1f,0f), 32f, new Vector2(1f,0f), 400f, Settings.playerWeaponTimer, Settings.playerWeaponSpeed, Settings.playerAmmo);
            this.m_Entities = new SortedDictionary<ulong, Entity>();
            this.AddEntity(this.m_Player);
            this.numZombies = 0;
            this.numItems = 0;

            this.m_WallGrid = new List<GridPoint>();
            this.m_WallIndices = new List<ulong>();

            this.CreateGrid();

            this.SpawnWall();

            //define the boundaries of the play area using walls drawn offscreen that do not cast shadows
            this.AddEntity(new Wall(this, new Vector2(Settings.worldWidth / 2, -16), Vector2.UnitX, Settings.worldWidth, 64, false));
            this.AddEntity(new Wall(this, new Vector2(-16, Settings.worldHeight / 2), Vector2.UnitY, Settings.worldHeight, 64, false));
            this.AddEntity(new Wall(this, new Vector2(Settings.worldWidth / 2, Settings.worldHeight + 16), Vector2.UnitX, Settings.worldWidth, 64, false));
            this.AddEntity(new Wall(this, new Vector2(Settings.worldWidth + 16, Settings.worldHeight / 2), Vector2.UnitY, Settings.worldHeight, 64, false));

            this.m_ColMatrix = null;
            this.zombieCountdown = Settings.zombieTimer;
            this.wallCountdown = Settings.wallSpawnTimer;
            this.wallCountdown = Settings.wallSpawnTimer;
            m_TimeElapsed = 0;
            m_secondCheck = m_TimeElapsed;
            m_Random = new Random();
            m_GameOver = false;

            ClusterAIBrains.Initialize();
        }
コード例 #2
0
 public override void OnPickup(Player player)
 {
     this.SetDead(true);
     player.TemporarySpeedIncrease(5f);
 }
コード例 #3
0
 public override void OnPickup(Player player)
 {
     this.SetDead(true);
     world.AddEntity(new Explosion(world, this.GetPosition(), Vector2.UnitX, 0f, 1024, 2200));
 }
コード例 #4
0
ファイル: Item.cs プロジェクト: seankruer/Human_vs_Zombies
 public abstract void OnPickup(Player player);
コード例 #5
0
 public override void OnPickup( Player player)
 {
     this.SetDead(true);
     player.AddAmmo(m_Ammo);
 }
コード例 #6
0
 public override void OnPickup( Player player)
 {
     this.SetDead(true);
     player.AddRockets(m_Rockets);
 }