예제 #1
0
        public static Entity CreateEnemy(EnemiesFactory enemy, Vector2 position)
        {
            //Nave1 = new Nave("Ship.png", 150, 400, (float)Math.Cos(0));
            //Nave2 = new Nave("ship.png", 250, 500, (float)Math.Sin(0)*200*250);
            //Nave3 = new Nave("ship.png", 50, 300, (float)Math.Cos(0)*50*250);
            switch (enemy)
            {
            //Agrego opcion para agregar posicion random
            case EnemiesFactory.enemyLevel1:
                return(new Enemy(position, -90, new Vector2(0.5f, 0.5f), new Vector2(144, 145), new Vector2(100, 100), "Textures/Entities/Characters/Enemy1.png", 10, 0, 30, 5, 15));

            case EnemiesFactory.enemyLevel2:
                return(new Enemy(position, -90, new Vector2(1, 1), new Vector2(31, 48), new Vector2(100, 100), "Textures/Entities/Characters/Enemy2.png", 15, 0, 20, 10, 15));

            case EnemiesFactory.enemyLevel3:
                return(new Enemy(position, -90, new Vector2(0.5f, 0.5f), new Vector2(182, 223), new Vector2(400, 400), "Textures/Entities/Characters/Enemy3.png", 40, 0, 8, 25, 10));

            case EnemiesFactory.enemyLevel4:
                return(new Enemy(position, -90, new Vector2(.5f, .5f), new Vector2(177, 189), new Vector2(200, 200), "Textures/Entities/Characters/Enemy4.png", 30, 0, 15, 15, 20));

            case EnemiesFactory.finalBossEnemy:
                return(new BossEnemy(position, -90, new Vector2(1, 1), new Vector2(207, 226), new Vector2(50, 50), "Textures/Entities/Characters/Boss.png", 100, 0, 60, 40, 100));

            default:
                return(new Enemy(position, -90, new Vector2(0.5f, 0.5f), new Vector2(144, 145), new Vector2(100, 100), "Textures/Entities/Characters/Enemy1.png", 10, 0, 30, 5, 15));
            }
        }
예제 #2
0
    //Bouncer'in belli bir sureden sonra yaratilmasini saglayan coroutine
    IEnumerator createAfter(float seconds)
    {
        //Coroutine yurutulmesini verilen saniye boyunca askiya alir
        yield return(new WaitForSeconds(seconds));

        EnemiesFactory.CreateBouncer();
    }
예제 #3
0
 public void Setup(Vector2 movementDirection, Vector3 position, Queue <Enemy> enemiesQueue, EnemiesFactory enemiesFactory)
 {
     Transform.position = position;
     MovementDirection  = movementDirection;
     _enemyQueue        = enemiesQueue;
     EnemiesFactory     = enemiesFactory;
     _isActive          = true;
     OnEnemyCreated();
 }
예제 #4
0
    protected virtual void firstButtonClickEvent()
    {
        hasAnswered = true;

        choicesCanvas.SetActive(false);
        doorObstacle.SetActive(false);
        //Ilk button tiklanma durumunda ghostu yaratir
        if (!enemyCreated)
        {
            enemyCreated = true;
            EnemiesFactory.CreateGhost();
        }
    }
예제 #5
0
        /// <summary>
        /// Waveに出現する敵群を生成する
        /// </summary>
        void SpawnEnemies()
        {
            Debug.Log(m_chapter.enemiesIds.Count);
            m_enemiesFactory             = EnemiesFactory.Instance;
            m_battleManager.EnemyObjects = m_enemiesFactory.Create(m_chapter);

            // 敵を1体生成する度にm_spawnSpacingValue分座標をずらして生成する
            // 生成した敵オブジェクトにアタッチされているEnemyコンポーネントをBattleManagerのリストに格納する
            float      spacings;
            Vector3    spawnPosition = m_battleManager.m_CoordinateForSpawn.position;
            GameObject enemyObject;

            for (int i = 0; i < m_battleManager.EnemyObjects.Count; i++)
            {
                spacings        = m_battleManager.m_CoordinateForSpawn.position.x + (m_spawnSpacing * i);
                spawnPosition.x = spacings;
                enemyObject     = Instantiate(m_battleManager.EnemyObjects[i], spawnPosition, Quaternion.identity, m_battleManager.m_CoordinateForSpawn);
                m_battleManager.Enemies.Add(enemyObject.GetComponent <Enemy>());
            }
        }
예제 #6
0
 protected override void OnEnemyKilled()
 {
     EnemiesFactory.RegisterSmallAsteroidDestruction();
 }
예제 #7
0
 protected override void OnEnemyKilled()
 {
     EnemiesFactory.SpawnAsteroids(Transform.position, EnemiesFactory.AsteroidsSize.Small);
 }
예제 #8
0
 private void Start()
 {
     EnemiesFactory.CreateWizard();
     fade.SetActive(true);
 }