Beispiel #1
0
    void beatDetection()
    {
        beatFull     = false;
        beatInterval = 60 / bpm;
        beatTimer   += Time.deltaTime;
        if (beatTimer >= beatInterval)
        {
            beatTimer -= beatInterval;
            beatFull   = true;
            beatCountFull++;
            if (shapeWallSpawn == 1)
            {
                spawnWall.spawnShapeWall();
                shapeWallSpawn = 0;
            }
            else
            {
                if (Random.Range(0, 6) == 0 && shapeWallSpawn == (0 | 2))
                {
                    spawnWall.spawnFakeWall();
                }
                shapeWallSpawn++;
            }
        }

        beat8         = false;
        beatInterval8 = beatInterval / 2;
        beatTimer8   += Time.deltaTime;
        if (beatTimer8 >= beatInterval8)
        {
            beatTimer8 -= beatInterval8;
            beat8       = true;
            beatCount8++;
        }
    }