コード例 #1
0
ファイル: Vampire.cs プロジェクト: doanhtdpl/pvz-the-birds
 public VampireDeath(Vampire zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Zombies\Vampire\Death");
     this.Image.Delay = 40;
     this.Align = new Vector2(15f, 62f);
     this.Timer.Interval = TimeSpan.FromMilliseconds(2000);
 }
コード例 #2
0
ファイル: Vampire.cs プロジェクト: doanhtdpl/pvz-the-birds
 public VampireWalk(Vampire zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Zombies\Vampire\Walk");
     this.Image.Delay = 40;
     this.Align = new Vector2(-1f, 61f);
     this.Velocity = 3.5f;
 }
コード例 #3
0
ファイル: Vampire.cs プロジェクト: doanhtdpl/pvz-the-birds
 public VampireAttack(Vampire zombie)
     : base(zombie)
 {
     this.Image = SpriteBank.GetAnimation(@"Images\Zombies\Zombies\Vampire\Attack");
     this.Image.Delay = 80;
     this.Align = new Vector2(4f, 66f);
     this.Damage = 7;
     this.AttackTimer.Interval = TimeSpan.FromMilliseconds(this.Image.Delay * (this.Image.Frames.Count + 1));
 }
コード例 #4
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);
        }