/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 19:59:09 UTC
  • Revision ID: josh@9ix.org-20110917195909-v02b0cco0yri61qc
disappear darkness mask in editor mode

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
 
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->position = Vector2(2048, 1600);
255
262
              levelEditor->Enable();
256
 
            else
 
263
            } else {
257
264
              levelEditor->Disable();
 
265
            }
258
266
          }
259
267
      }
260
268
 
267
275
      this->font = Assets::RequestFont("LiberationSans-Regular.ttf", 18.0f);
268
276
    else
269
277
      this->font = font;
 
278
 
 
279
    SetLayer(-2);
270
280
  }
271
281
 
272
282
  void Text::Render()