/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 20:36:00 UTC
  • Revision ID: josh@9ix.org-20110917203600-4g34074fjamm0ov4
and the graphic

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