/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-17 16:54:23 UTC
  • Revision ID: josh@9ix.org-20110917165423-wflahgpej1hbjowe
harder to see creatures

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    SetGraphic(sprite);
14
14
 
15
15
    AddTag("player");
 
16
 
 
17
    footsteps = Audio::NewDeck(Assets::RequestAudio("footsteps.ogg"));
 
18
    footsteps->SetLoops(0); //loop indefinitely
16
19
    
17
20
    SetCollider(new RectangleCollider(32, 32));
18
21
  }
65
68
      }
66
69
    if (ycol) {velocity.y = 0;}
67
70
 
 
71
    if (velocity.GetSquaredMagnitude() > 20)
 
72
      footsteps->Play();
 
73
    else
 
74
      footsteps->Pause(); //Stop()?
68
75
 
69
76
    //Scene::GetCamera()->position = position;
70
77
  }
76
83
  {
77
84
    sprite = new SpriteAnimation("creature.png", FILTER_NONE, 64, 64);
78
85
    sprite->Add("idle", 0, 0, 0.35f);
 
86
    sprite->Add("move", 1, 2, 4.0f);
79
87
    sprite->Play("idle");
80
88
    SetGraphic(sprite);
81
89
 
145
153
      }
146
154
    if (ycol) {velocity.y = 0;}
147
155
 
148
 
    if (velocity.GetSquaredMagnitude() > 0)
149
 
      skitter1->Play();
 
156
    if (velocity.GetSquaredMagnitude() > 20)
 
157
      {
 
158
        skitter1->Play();
 
159
        sprite->Play("move");
 
160
      }
150
161
    else
151
 
      skitter1->Pause(); //Stop()?
 
162
      {
 
163
        skitter1->Pause(); //Stop()?
 
164
        sprite->Play("idle");
 
165
      }
152
166
  }
153
167
 
154
168
  // Scene
201
215
    creature->position = Graphics::GetScreenCenter();
202
216
    Add(creature);
203
217
 
204
 
    Graphics::SetBackgroundColor(Color::green * 0.2f);
 
218
    Creature *creature2 = new Creature;
 
219
    creature2->position = Graphics::GetScreenCenter();
 
220
    Add(creature2);
 
221
 
 
222
    Graphics::SetBackgroundColor(Color::black * 0.2f);
205
223
 
206
224
  }
207
225