private void CreateObject(Enemy enemy) { var baseObject = new BaseObject { Username = enemy.UniqueId.ToString()}; baseObject.AddComponent(new Sprite(_texture, 32, 32, new Vector2(enemy.Position.ScreenXPosition, enemy.Position.ScreenYPosition), Color.Black, enemy.Position.Visible)); baseObject.AddComponent(new Animation(16, 16, 2)); //Later we add specific component for enemies here. _enemies.Add(baseObject); }
public void AddEnemy() { var random = new Random(); //Generate enemies for test var enemy = new Enemy(0, new Position(random.Next(0, 600), random.Next(0, 400), 0, 0, true)); enemy.BaseMovement = new AttackMovement(enemy.Position, Players.Select(p => p.Player).ToList()); Enemies.Add(enemy); _logger.AddLogMessage("Room - " + GameRoomId, string.Format("Adding new enemy with Unique ID {0}", Enemies.Last().UniqueId)); }