Beispiel #1
0
 public void OnKilled(Zombie killedBy)
 {
     isAlive = false;
     killedSound.Play();
     sprite.PlayAnimation(dieAnimation);
 }
Beispiel #2
0
        /// <summary>
        /// Clear the current flock if it exists and randomly generate a new one
        /// </summary>
        public void ResetHoard(Game game, Random rnd)
        {
            hoard.Clear();
            hoard.Capacity = hoardSize;

            Zombie tempBird;
            //            Vector2 tempDir;
            //            Vector2 tempLoc;

            Random random = new Random();

            for (int i = 0; i < hoardSize; i++)
            {
            //                tempLoc = new Vector2((float)
            //                    random.Next(boundryWidth), (float)random.Next(boundryHeight));
            //                tempDir = new Vector2((float)
            //                    random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f);
            //                tempDir.Normalize();

                tempBird = new Zombie( game, rnd);
                hoard.Add(tempBird);
            }
        }