コード例 #1
0
 public BarrowWightDeath(BarrowWight zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Skeletons\BarrowWight\Death");
     this.Image.Delay = 40;
     this.Align = new Vector2(18f, 92f);
     this.Timer.Interval = TimeSpan.FromMilliseconds(2000);
 }
コード例 #2
0
 public BarrowWightWalk(BarrowWight zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Skeletons\BarrowWight\Walk");
     this.Image.Delay = 40;
     this.Align = new Vector2(10, 72);
     this.Velocity = 2;
 }
コード例 #3
0
 public BarrowWightAttack(BarrowWight zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Skeletons\BarrowWight\Attack");
     this.Image.Delay = 60;
     this.Align = new Vector2(18f, 92f);
     this.Damage = 7;
     this.AttackTimer.Interval = TimeSpan.FromMilliseconds(this.Image.Delay * (this.Image.Frames.Count + 1));
 }
コード例 #4
0
ファイル: LuongPvZ.cs プロジェクト: doanhtdpl/pvz-the-birds
        void TimerTick(Counter.ICounter counter)
        {
            Zombies.Zombie zombie;
            if (GRandom.RandomLogic(0.3))
            {
                zombie = new Zombies.Skeletons.Skeleton(this);
            }
            else if (GRandom.RandomLogic(0.6))
            {
                zombie = new Zombies.Skeletons.BarrowWight(this);
            }
            else
            {
                zombie = new Zombies.Skeletons.BladeSkeleton(this);
            }

            ZMan.Add(zombie, GRandom.RandomInt(grid.NumberOfRows));
        }
コード例 #5
0
ファイル: LuongPvZ.cs プロジェクト: doanhtdpl/pvz-the-birds
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            //Input Update:
            GMouse.Update(gameTime);
            GKeyBoard.Update(gameTime);

            // Allows the game to exit
            if (GKeyBoard.IsKeyPressed(Keys.Escape))
                this.Exit();

            if (GMouse.IsLeftButtonClicked)
            {
                Zombies.Zombie zombie = new Zombies.Zombies.Vampire(this);
                zombie.Position = GMouse.MousePosition;
                ZMan.Add(zombie);
            }

            if (GMouse.IsRightButtonClicked)
            {
                Zombies.Skeletons.BarrowWight zombie = new Zombies.Skeletons.BarrowWight(this);
                zombie.Position = GMouse.MousePosition;
                ZMan.Add(zombie);
            }

            timer.Update(gameTime);
            grid.Update(gameTime);
            ZMan.Update(gameTime);

            base.Update(gameTime);
        }