Beispiel #1
0
 public static string RayIntersectsHitbox(Ray ray, out float?distance, out CEnemy enemyVal)
 {
     foreach (CEnemy enemy in _enemyList)
     {
         string enemytest = enemy.RayIntersectsHitbox(ray, out distance);
         enemyVal = enemy;
         if (enemytest != "")
         {
             return(enemytest);
         }
     }
     distance = null;
     enemyVal = null;
     return("");
 }
Beispiel #2
0
        public CPlayer(int PlayerID, string Name, Vector3 pos)
        {
            this.userName = Name;
            this.ID       = PlayerID;

            Texture2D[] textures = new Texture2D[1];
            textures[0]   = Display2D.C2DEffect._content.Load <Texture2D>("Textures\\MedievalCharacter");
            botController = new CEnemy("MedievalCharacter", textures, pos, Matrix.CreateFromYawPitchRoll(0, 0, 0), 100f, 20, 10, false, Name, 2);
            botController._isMultiPlayer = true;
            Game.CEnemyManager.AddEnemy(Display2D.C2DEffect._content, CConsole._Camera, botController);

            oldPos  = pos;
            newPos  = pos;
            oldTime = DateTime.Now;

            life = 100;
            botController._life = life;
        }
Beispiel #3
0
        public static void UpdateGameLevel(ref Game.LevelInfo.LevelData lvl)
        {
            FixQueuedBots();
            for (int i = 0; i < _enemyList.Count; i++)
            {
                CEnemy enemy = _enemyList[i];

                lvl.Bots.Bots[i].IsAggressive  = enemy._isAgressive;
                lvl.Bots.Bots[i].Life          = enemy._life;
                lvl.Bots.Bots[i].Name          = enemy._hudText;
                lvl.Bots.Bots[i].RangeOfAttack = enemy._rangeAttack;
                lvl.Bots.Bots[i].SpawnPosition = new Game.LevelInfo.Coordinates(enemy._model._position);
                lvl.Bots.Bots[i].Type          = enemy._type;
                lvl.Bots.Bots[i].Velocity      = enemy._runningVelocity;
            }

            while (lvl.Bots.Bots.Count != _enemyList.Count)
            {
                lvl.Bots.Bots.RemoveAt(lvl.Bots.Bots.Count - 1);
            }
        }
Beispiel #4
0
 public static void RemoveBot(CEnemy enemy)
 {
     enemiesToRemoveQueue.Add(enemy);
 }
Beispiel #5
0
 public static void AddEnemy(ContentManager content, Display3D.CCamera cam, CEnemy enemy)
 {
     enemiesToAddQueue.Add(enemy);
     enemy.LoadContent(content, cam);
 }