/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-19 18:35:23 UTC
  • Revision ID: josh@9ix.org-20110919183523-l8igju1c92tkjzix
win!

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    bool xcol = false;
59
59
    bool ycol = false;
60
60
 
 
61
    if (Collide("exit")) {
 
62
      Scene *s = GetScene();
 
63
      s->isPaused = true;
 
64
      
 
65
      Text *win1 = new Text("You made it safely through the dark!", 
 
66
                           Assets::RequestFont("LiberationSans-Regular.ttf", 50.0f));
 
67
      win1->position = Vector2(-350,0);
 
68
      s->Add(win1);
 
69
 
 
70
      Text *win2 = new Text("Congratulations!", 
 
71
                           Assets::RequestFont("LiberationSans-Regular.ttf", 50.0f));
 
72
      win2->position = Vector2(-150,50);
 
73
      s->Add(win2);
 
74
    }
 
75
 
61
76
    Collider *collider = NULL;
62
77
 
63
78
    position.x += velocity.x * Monocle::deltaTime;
384
399
 
385
400
    Graphics::Set2D(1024, 768);
386
401
 
 
402
    Text *inst1 = new Text("Use arrow keys to move");
 
403
    inst1->position = Vector2(-492, -354);
 
404
    Add(inst1);
 
405
 
387
406
    Text *inst2 = new Text("Press ESC to quit");
388
 
    inst2->position = Vector2(-492, -354); // 20px h, 30px v from U-L corner
 
407
    inst2->position = Vector2(-492, -334); // 20px h, 30px v from U-L corner
389
408
    Add(inst2);
390
409
 
391
410
    Input::DefineMaskKey("left", KEY_LEFT);
424
443
        Vector2 s = e->scale;
425
444
        e->SetCollider(new RectangleCollider(s.x * 64, s.y * 64));
426
445
      }
 
446
 
 
447
    Entity* exit = GetFirstEntityWithTag("exit");
 
448
    Vector2 s = exit->scale;
 
449
    exit->SetCollider(new RectangleCollider(s.x * 64, s.y * 64));
 
450
 
427
451
   
428
452
    Graphics::SetBackgroundColor(Color::green * 0.2f);
429
453