/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:31:01 UTC
  • Revision ID: josh@9ix.org-20110918223101-7s86wvx5dkkekhgg
now they chase you (hunt)

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 *(400-64)) + 64) /2;
 
87
    noisiness = ((magnitude / MAXSPEED *(300-32)) + 32) /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;
234
233
 
235
 
        if ((graceTime > 1.0f) && (maxspeed != DEFAULT_MAXSPEED))
 
234
        if ((aiTime > 1.0f) && (maxspeed != DEFAULT_MAXSPEED))
236
235
          maxspeed = DEFAULT_MAXSPEED;
237
236
 
238
237
        // if we hear the player (
242
241
          {
243
242
            direction = (player->position - position).GetNormalized();
244
243
            aiTime = 0.0f;
245
 
            if (noiseTime > 2.0f) {
 
244
            if (noiseTime > 1.0f) {
246
245
              freakout->Play();
247
246
              // TODO: big yellow ping
248
247
              noiseTime = 0.0f;
255
254
            //alert->Play();
256
255
            direction = Vector2::zero;
257
256
            aiTime = 0.0f;
258
 
            noiseTime = 0.0f;
259
 
            graceTime = 0.0f;
260
257
        }
261
258
 
262
259
        // if we collide with you... game over?