Esempio n. 1
0
 public void PlayHurt(Player p, Zombie z=null)
 {
     if (z != null)
         hurt.Play(0.25f, 0.0f, z.X - p.X > 0 ? 0.20f : -0.20f);
     else
         hurt.Play(0.15f, 0.0f, 0.0f);
 }
Esempio n. 2
0
        public void Update(GameTime theGameTime, ExplosionHandler explosions, ItemHandler ih, Camera c)
        {
            if(random.Next(200) == (int)X / 64)
            {
                if (random.Next(2) == 0) newZombie = new Zombie(new Vector2(this.X + 8, this.Y + 48), new Vector2(-1, 1)); else newZombie = new Zombie(new Vector2(this.X + 8, this.Y + 48), new Vector2(1, 1));
                newZombie.LoadContent(contentManager);
                zombies.Add(newZombie);
                newZombie = null;
            }

            foreach (Zombie z in zombies)
                if (z.Visible)
                    z.Update(theGameTime, c);

            this.RemoveZombies(explosions, ih);
            this.Animate();
        }