/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 15:03:52 UTC
  • Revision ID: josh@9ix.org-20110917150352-j6nh9t61px2eitdu
skittering blue square

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