예제 #1
0
        public NormalZombie(Pause pause) : base(pause)
        {
            Health         = 10;
            MaxHealth      = 10;
            WalkSpeed      = 1000;
            AttackDamage   = 10;
            AttackSpeed    = 1000;
            IsPushable     = true;
            Direction      = Direction.DOWN;
            ZombieModel    = new NormalZombieModel(GameData.NormalZombieModel);
            ZombiePosition = FindSpawnPosition();
            ZombieState    = new NormalState();
            GameData.AddZombieAtPosition(ZombiePosition, this);
            Thread zombieThread = new Thread(() => LiveTemplateMethod());

            GameData.AddThread(zombieThread);
            this.ZombieThread = zombieThread;
            zombieThread.Start();
        }
예제 #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);
     }
 }