public void CreateScriptTest()
        {
            List <DeviceSession> sessions  = TestSetup.GetSessions();
            WaveGenerator        generator = new WaveGenerator(sessions[8]);
            string output = generator.Generate();

            Assert.IsNotNull(output);
        }
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         GameObject g = generator.Generate(this.transform.position);
         transform.position += new Vector3(moviment, 0);
     }
 }
示例#3
0
    IEnumerator AdvanceWave()
    {
        currentWave += 1;

        yield return(new WaitForSeconds(3));

        enemiesToKill = generator.Generate(currentWave, player, points.ToArray());

        if (onScoreChange != null)
        {
            onScoreChange(currentScore);
        }
    }
示例#4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Vector v1 = new Vector(0, -1);
            Vector v2 = new Vector(-.95f, -.35f);
            Vector v3 = new Vector(-.59f, .81f);
            Vector v4 = new Vector(.59f, .81f);
            Vector v5 = new Vector(.95f, -.35f);

            WaveGenerator wg = new WaveGenerator();

            wg.SetWaveShape(new Vector[] { v1, v3, v5, v2, v4 });
            wg.Generate();
            wg.Save("C:\\Users\\theen\\Desktop\\wawawaw\\test.wav");
        }
示例#5
0
        private float GenerateParallelWaves(WaveTimeline timeline, float startTime, int wave, float credits, ref int offset)
        {
            float frequency = GetSpawnFrequency(wave);

            int waves = GetParallelAmount(wave);

            for (int i = 0; i < waves; i++)
            {
                float waveFrequency = frequency * (1 + RandomRange(FrequencyVariance.x, FrequencyVariance.y));
                float waveCredits   = credits * (1 + RandomRange(CreditsVariance.x, CreditsVariance.y));

                IWaveGenerator gen      = new WaveGenerator(startTime, wave, Seed + offset++, waveCredits / waves, waveFrequency / waves, MaxSpawnFrequency / waves, MinSpawnFrequency / waves);
                SpawnInterval  interval = gen.Generate();
                timeline.AddSpawn(interval);
            }
            return(timeline.EndTime + RandomRange(TimeVariance.x, TimeVariance.y));
        }