Example #1
0
        public TankZombie(Pause pause) : base(pause)
        {
            Health         = 100;
            MaxHealth      = 100;
            WalkSpeed      = 350;
            AttackDamage   = 35;
            AttackSpeed    = 2000;
            IsPushable     = false;
            Direction      = Direction.DOWN;
            ZombieModel    = new TankZombieModel(GameData.TankZombieModel);
            ZombiePosition = FindSpawnPosition();
            ZombieState    = new NormalState();
            GameData.AddZombieAtPosition(ZombiePosition, this);
            Thread zombieThread = new Thread(() => LiveTemplateMethod());

            GameData.AddThread(zombieThread);
            this.ZombieThread = zombieThread;
            zombieThread.Start();
        }
Example #2
0
 public static Collision CheckForCollision(Position position)
 {
     if (ValidatePosition(position) == true)
     {
         lock (ConsoleAccessObject)
         {
             if (gameMap[position.Y, position.X] != ' ')
             {
                 if (NormalZombieModel.Equals(gameMap[position.Y, position.X]) || HunterZombieModel.Equals(gameMap[position.Y, position.X]) ||
                     TankZombieModel.Equals(gameMap[position.Y, position.X]))
                 {
                     return(Collision.ZOMBIE);
                 }
                 else if (GameData.PlayerModel.Equals(gameMap[position.Y, position.X]))
                 {
                     return(Collision.PLAYER);
                 }
                 else if (Player.CurrentWeapon.BulletModel.Equals(gameMap[position.Y, position.X]))
                 {
                     return(Collision.BULLET);
                 }
                 else
                 {
                     return(Collision.DROP);
                 }
             }
             else
             {
                 return(Collision.NONE);
             }
         }
     }
     else
     {
         return(Collision.WALL);
     }
 }