Beispiel #1
0
    protected override void spawnEnemies()
    {
//		TweenProperties enterPath = new SingleTween ("8_enter", enterDuration);
        TweenProperties cruisePath    = new SingleTween("8_cruise", cruiseDuration, cruiseDelay);
        TweenProperties cruisePathRev = cruisePath.Clone().Reverse();

        for (int i = 0; i < enemiesToSpawn; i++)
        {
            float yOffset = -i * enemyDistance;

            int             enterPathIndex = ((i % 3) + 1);
            float           enterDelay     = enterMaxDelay * Random.value;
            TweenProperties preEnterDelay  = new DelayTween(enterDelay);
            TweenProperties enter          = new SingleTween("8_enter" + enterPathIndex, enterDuration).OffsetByY(yOffset);
            TweenProperties postEnterDelay = new DelayTween(enterMaxDelay - enterDelay);

            TweenProperties preCruiseDelay = new DelayTween((enemiesToSpawn - i) * cruiseDuration);
            TweenProperties postCruiseDlay = new DelayTween(cruiseDuration * i);

            TweenProperties cruise    = cruisePath.Clone().OffsetByY(yOffset);
            TweenProperties cruiseRev = cruisePathRev.Clone().OffsetByY(yOffset);

            TweenProperties loop = new LoopTween(preCruiseDelay, cruise, postCruiseDlay, postCruiseDlay, cruiseRev, preCruiseDelay);
            spawnEnemy(EnemyObjectPool.type_enemy2, preEnterDelay, enter, postEnterDelay, loop);
        }
    }
Beispiel #2
0
    override protected void spawnEnemies()
    {
        TweenProperties enter          = new SingleTween("9_enter", enterDuration);
        TweenProperties postEnterDelay = new DelayTween(loopDelay);

        TweenProperties goDown        = new SingleTween("9_changeSide", changeSideDuration);
        TweenProperties goUp          = goDown.Clone().Reverse();
        TweenProperties attackUp      = new SingleTween("9_attackUp", attackDuration);
        TweenProperties attackUpRev   = attackUp.Clone().Reverse();
        TweenProperties attackDown    = new SingleTween("9_attackDown", attackDuration);
        TweenProperties attackDownRev = attackDown.Clone().Reverse();

        TweenProperties loop = new LoopTween(attackUp, attackUpRev, goDown, attackDown, attackDownRev, goUp);

        spawnEnemy(EnemyObjectPool.type_boss, enter, postEnterDelay, loop);
    }
Beispiel #3
0
    override protected void spawnEnemies()
    {
        TweenProperties uniteUp   = new SingleTween("7_uniteUp", uniteDuration, 0, true);
        TweenProperties uniteDown = new SingleTween("7_uniteDown", uniteDuration, 0, true);

        for (int i = 1; i <= enemiesToSpawn; i++)
        {
            float           enterDelay     = enterMaxDelay * Random.value;
            TweenProperties enter          = new SingleTween("7_enter" + i, enterDuration, enterDelay);
            TweenProperties postEnterDelay = new DelayTween(enterMaxDelay - enterDelay);              //so all enemies start loop simultaneously

            TweenProperties loopDelay = new DelayTween(this.loopDelay);

            TweenProperties preUniteDelay  = new DelayTween(uniteDuration * (i - 1) / enemiesToSpawn);
            TweenProperties postUniteDelay = new DelayTween(uniteDuration * (enemiesToSpawn - i) / enemiesToSpawn);

            TweenProperties cruise = new SingleTween("7_cruise" + i, loopDuration, 0, true);

            TweenProperties loop = new LoopTween(preUniteDelay, uniteUp, postUniteDelay, cruise, loopDelay,
                                                 preUniteDelay, uniteDown, postUniteDelay, cruise, loopDelay);

            spawnEnemy(EnemyObjectPool.type_enemy1, enter, postEnterDelay, loop);
        }
    }