/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-18 22:42:59 UTC
  • Revision ID: josh@9ix.org-20110918224259-0yxyd99mvuadfarf
they hear you more + fixed a bug if they're right on top of you

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
 
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
247
              // TODO: big yellow ping
247
248
              noiseTime = 0.0f;
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?