コード例 #1
0
 // Begin the actual game, start recording metrics
 void StartGame()
 {
     mcMetric.startRecording();
     metricWriter  = new MetricJSONWriter("Feeder", DateTime.Now, seed); // initialize metric data writer
     gameStartTime = Time.time;
     sound.clip    = bite_sound;
 }
コード例 #2
0
 // Begin the actual game, start recording metrics
 void StartGame()
 {
     pMetric.startRecording();
     lvMetric.startRecording();
     metricWriter      = new MetricJSONWriter("Rockstar", DateTime.Now, seed); // initialize metric data writer
     gameStartTime     = Time.time;
     rockstar.enabled  = true;
     spotlight.enabled = true;
     meter.enabled     = true;
     if (enableAnimations)
     {
         background.Play("Base Layer.rockstarbg_1");
     }
     if (musicTrack > -1)
     {
         music.clip = tracks[musicTrack - 1];
         music.Play();
     }
 }
コード例 #3
0
    float currRockstarVel;          // used to detect change in rockstar velocity for pMetric

    // Start is called before the first frame update
    void Start()
    {
        Setup();            // run initial setup, inherited from parent class

        InitConfigurable(); // initialize configurable values

        randomSeed = new System.Random(seed.GetHashCode());

        // set the leftKey for the intro instructions
        int tempIdx = lrkeyText.text.IndexOf("LKEY");

        lrkeyText.text = lrkeyText.text.Substring(0, tempIdx) + KeyCodeDict.toString[leftKey] + lrkeyText.text.Substring(tempIdx + 4);

        // set the rightKey for the intro instructions
        tempIdx        = lrkeyText.text.IndexOf("RKEY");
        lrkeyText.text = lrkeyText.text.Substring(0, tempIdx) + KeyCodeDict.toString[rightKey] + lrkeyText.text.Substring(tempIdx + 4);

        // set the upKey for the intro instructions
        tempIdx       = ukeyText.text.IndexOf("UKEY");
        ukeyText.text = ukeyText.text.Substring(0, tempIdx) + KeyCodeDict.toString[upKey] + ukeyText.text.Substring(tempIdx + 4);

        countDoneText = "Rock!";

        pMetric = new PositionMetric(new List <string> {
            "rockstar", "spotlight"
        });                                                                      // initialize position metric recorder
        lvMetric = new LinearVariableMetric(0f, 100f, 75f, new List <string> {
            "gameDrop", "playerRaise"
        });                                                                  // initialize linear variable metric recorder
        metricWriter = new MetricJSONWriter("Rockstar", DateTime.Now, seed); // initialize metric data writer

        rockstar.Init(seed, rockstarChangeFreq, rockstarVelocity);
        spotlight.Init(spotlightVelocity);
        meter.Init(seed, meterChangeFreq, meterMinVel, meterMaxVel, meterUpVel, 0f, 100f, meterGoodRange, 50f);
        rockstar.enabled  = false;
        spotlight.enabled = false;
        meter.enabled     = false;

        currMeterVel    = 0f;
        lastMeterLvl    = 50f;
        currRockstarVel = 0f;
    }
コード例 #4
0
 // Begin the actual game, start recording metrics
 public void StartGame()
 {
     bpMetric.startRecording();
     metricWriter  = new MetricJSONWriter("Digger", DateTime.Now); // initialize metric data writer
     gameStartTime = Time.time;
 }