/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 17:12:23 UTC
  • Revision ID: josh@9ix.org-20110917171223-hsvrl6q7mxxbc1sv
creatures move less, make everything smaller

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    footsteps->SetLoops(0); //loop indefinitely
20
20
    
21
21
    SetCollider(new RectangleCollider(16, 16));
22
 
 
23
 
    dark = new Entity();
24
 
    dark->SetGraphic(new Sprite("dark.png", FILTER_NONE, 2048, 1536)); //alpha?
25
22
  }
26
23
 
27
24
  void Player::Update()
77
74
    else
78
75
      footsteps->Pause(); //Stop()?
79
76
 
80
 
    dark->position = position;
81
 
 
82
77
    //Scene::GetCamera()->position = position;
83
78
  }
84
79
 
206
201
    Level::LoadProject("project.xml");
207
202
    Level::Load("level.xml", this);
208
203
 
209
 
    std::list<Entity*> *walls = GetAllTag("wall");
210
 
    for (std::list<Entity*>::iterator i = walls->begin(); i != walls->end(); ++i)
 
204
    std::list<Entity*> *inv = GetAllTag("invisible");
 
205
    for (std::list<Entity*>::iterator i = inv->begin(); i != inv->end(); ++i)
211
206
      {
212
207
        Entity *e = (*i);
213
208
        Vector2 s = e->scale;
214
209
        e->SetCollider(new RectangleCollider(s.x * 64, s.y * 64));
215
210
      }
216
211
   
217
 
    player = new Player();
 
212
    Player *player = new Player;
218
213
    player->position = Graphics::GetScreenCenter();
219
214
    Add(player);
220
 
    Add(player->dark);
221
215
 
222
216
    Creature *creature = new Creature;
223
217
    creature->position = Graphics::GetScreenCenter();
227
221
    creature2->position = Graphics::GetScreenCenter();
228
222
    Add(creature2);
229
223
 
230
 
    Graphics::SetBackgroundColor(Color::green * 0.2f);
 
224
    Graphics::SetBackgroundColor(Color::black * 0.2f);
231
225
 
232
226
  }
233
227
 
257
251
          {
258
252
            isPaused = !isPaused;
259
253
            
260
 
            if (isPaused) {
261
 
              player->dark->isVisible = false;
 
254
            if (isPaused)
262
255
              levelEditor->Enable();
263
 
            } else {
 
256
            else
264
257
              levelEditor->Disable();
265
 
              player->dark->isVisible = true;
266
 
            }
267
258
          }
268
259
      }
269
260
 
276
267
      this->font = Assets::RequestFont("LiberationSans-Regular.ttf", 18.0f);
277
268
    else
278
269
      this->font = font;
279
 
 
280
 
    SetLayer(-2);
281
270
  }
282
271
 
283
272
  void Text::Render()