/minild29

To get this branch, use:
bzr branch http://9ix.org/bzr/minild29

« back to all changes in this revision

Viewing changes to Dark.cpp

  • Committer: Josh C
  • Date: 2011-09-19 16:17:11 UTC
  • Revision ID: josh@9ix.org-20110919161711-uy03f0x3g8l0waxu
much level changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
    // How far away can they hear your footsteps?
86
86
    // The circle is diameter 300 at MAXSPEED, 32 (2x your size) at 0 speed
87
 
    noisiness = ((magnitude / MAXSPEED *(300-32)) + 32) /2;
 
87
    noisiness = ((magnitude / MAXSPEED *(400-64)) + 64) /2;
88
88
 
89
89
    dark->position = position;
90
90
 
208
208
            maxspeed = 0; // give them a running start
209
209
            sniff->Stop();
210
210
            freakout->Play();
211
 
            // TODO: big yellow ping
 
211
            Ping::NewPing(position, 8.0f, 64.0f, 0.15f); 
212
212
            aiTime = 0.0f;
213
213
            noiseTime = 0.0f;
214
214
          }
230
230
      {
231
231
        aiTime += Monocle::deltaTime;
232
232
        noiseTime += Monocle::deltaTime;
 
233
        graceTime += Monocle::deltaTime;
233
234
 
234
 
        if ((aiTime > 1.0f) && (maxspeed != DEFAULT_MAXSPEED))
 
235
        if ((graceTime > 1.0f) && (maxspeed != DEFAULT_MAXSPEED))
235
236
          maxspeed = DEFAULT_MAXSPEED;
236
237
 
237
238
        // if we hear the player (
241
242
          {
242
243
            direction = (player->position - position).GetNormalized();
243
244
            aiTime = 0.0f;
244
 
            if (noiseTime > 1.0f) {
 
245
            if (noiseTime > 2.0f) {
245
246
              freakout->Play();
246
 
              // TODO: big yellow ping
 
247
              Ping::NewPing(position, 8.0f, 64.0f, 0.15f);
247
248
              noiseTime = 0.0f;
248
249
            }
249
250
          }
254
255
            //alert->Play();
255
256
            direction = Vector2::zero;
256
257
            aiTime = 0.0f;
 
258
            noiseTime = 0.0f;
 
259
            graceTime = 0.0f;
257
260
        }
258
261
 
259
262
        // if we collide with you... game over?