Ejemplo n.º 1
0
 public override GraphicalEntity New()
 {
     Zombie z = new Zombie();
     if (speed >= 4f) speed = 4f;
     z.Speed = speed;
     z.CurrentStrategy = new ZombieStrategy();
     z.CurrentState = new ZombieWalkState();
     return z;
 }
Ejemplo n.º 2
0
        private void Spawn()
        {
            for (int i = 0; i < 1; i++)
            {

                double angle = Game1.Instance.Random.NextDouble() * Math.PI * 2;
                double radius = Math.Sqrt(Game1.Instance.Random.NextDouble() + 0.25) * 600;
                float x = (float)(Game1.Instance.GameWorld.Player.Position.X - (radius * Math.Cos(angle)));
                float y = (float)(Game1.Instance.GameWorld.Player.Position.Y - (radius * Math.Sin(angle)));
                Zombie zombie = new Zombie(new Vector2(x, y));
                if (Game1.Instance.Random.NextDouble() < 0.005)
                {
                    zombie = new BigZombie(new Vector2(x, y));
                }
                CreateEntity(zombie);
                zombies_spawned++;
            }
        }