Exemplo n.º 1
0
void Scene2Controller::Setup() {
  // Box2D
  CreateBorder();
  CreateCourt();
  CreateNet();
  scene_begin_time = ofGetElapsedTimef();
  const ofPoint left(256-64, 200);
  const ofPoint right(768-64, 200);
  const float pause = 0.5;
  model_.dialogue
      .Speed(20.0)
      .Foreground(ofColor::white)
      .Background(ofColor(0, 0, 0, 0))
      .Position("left", left)
      .Position("right", right)
      .Message("You know why you're here, right?", "right").Pause(pause)
      .Message("No.", "left").Pause(pause)
      .Message("Because you're bad at tennis.\nI'm gonna make you good.", "right").Pause(2.0)
      .Clear();
}
Exemplo n.º 2
0
void Scene3Controller::Setup() {
  // Box2D
  CreateBorder();
  CreateCourt();
  CreateEight();
  CreateNet();
  model_.world.SetContactListener(this);
  const ofPoint right(768-256, 50);
  const float pause = 2.0;
  model_.dialogue
      .Speed(25.0)
      .PunctuationDelay(0.0)
      .FontSize(16.0)
      .Foreground(ofColor::black)
      .Position("court", ofPoint(768, 600))
      .Position("right", right)
      .Position("below", right + ofVec2f(0, 100)).Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.1); //bass sound
        volume_targets.push_back(0.5); //high arpeg v1
        volume_targets.push_back(0.0); //high arpeg v2
        volume_targets.push_back(0.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Message("I don't believe in gravity, \nI will surely win this match!", "right").Then([this] () {
        model_.served = false;
        model_.ball_in_play = true;
        model_.opponent_index = 0;
      })
      .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.2); //bass sound
        volume_targets.push_back(0.5); //high arpeg v1
        volume_targets.push_back(0.0); //high arpeg v2
        volume_targets.push_back(1.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause)
  .Message("I have time, \nI will surely win this match!", "right").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 1;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.5); //bass sound
        volume_targets.push_back(0.3); //high arpeg v1
        volume_targets.push_back(0.0); //high arpeg v2
        volume_targets.push_back(1.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause)
  .Message("I have many racquets, \nI will surely win this match!", "right").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 2;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.5); //bass sound
        volume_targets.push_back(0.2); //high arpeg v1
        volume_targets.push_back(0.0); //high arpeg v2
        volume_targets.push_back(1.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause)
  .Message("We're playing a whole different game,\nwe will surely win this match!", "right").Then([this] () {
    model_.served = true;
    model_.ball_in_play = true;
    model_.opponent_index = 3;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.5); //bass sound
        volume_targets.push_back(0.2); //high arpeg v1
        volume_targets.push_back(0.0); //high arpeg v2
        volume_targets.push_back(0.9); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.3); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause)
  .Message("I'm made of glass, \nI will surely win this match!", "right").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 4;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.5); //bass sound
        volume_targets.push_back(0.0); //high arpeg v1
        volume_targets.push_back(0.5); //high arpeg v2
        volume_targets.push_back(0.0); //low arpeg v1
        volume_targets.push_back(1.0); //low arpeg v2
        volume_targets.push_back(0.0); //words 1
        volume_targets.push_back(0.3); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
  }).Clear().Pause(pause).Then([this] () {
    model_.served = true;
    model_.ball_in_play = true;
    model_.opponent_index = 5;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.5); //bass sound
        volume_targets.push_back(0.0); //high arpeg v1
        volume_targets.push_back(0.5); //high arpeg v2
        volume_targets.push_back(1.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.6); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.0); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      })
      .Message("I'm late, I will...", "court").Pause(0.5).Clear().Pause(0.5)
  .Message("I'm a blank slate,\nI will surely win this match!", "right").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 6;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.7); //bass sound
        volume_targets.push_back(0.0); //high arpeg v1
        volume_targets.push_back(0.5); //high arpeg v2
        volume_targets.push_back(1.0); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.4); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.4); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause)
  .Message("I've spent my life studying this game,\nI will surely win this match!", "right").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 7;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.7); //bass sound
        volume_targets.push_back(0.0); //high arpeg v1
        volume_targets.push_back(0.3); //high arpeg v2
        volume_targets.push_back(0.5); //low arpeg v1
        volume_targets.push_back(0.0); //low arpeg v2
        volume_targets.push_back(0.4); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.4); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause).Foreground(ofColor::white)
  .Message("I'm the score itself, \nI will surely win this match!", "right").Then([this] () {
    model_.eight_body->SetActive(true);
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 8;
  })
  .Barrier("point").Then([this] () {
        std::vector<float> volume_targets;
        volume_targets.push_back(0.9); //bass sound
        volume_targets.push_back(0.0); //high arpeg v1
        volume_targets.push_back(0.2); //high arpeg v2
        volume_targets.push_back(0.0); //low arpeg v1
        volume_targets.push_back(1.0); //low arpeg v2
        volume_targets.push_back(0.5); //words 1
        volume_targets.push_back(0.0); //words 2
        volume_targets.push_back(0.5); //words 3
        scene_manager.GetMusic().GetSoundEffect<LoopSet>("opponents")->SetVolumeTargets(volume_targets);
      }).Clear().Pause(pause).Foreground(ofColor::black)
  .Message("I'm you, \nI will surely win this match!", "right").Then([this] () {
    model_.eight_body->SetActive(false);
    model_.served = false;
    model_.ball_in_play = true;
    model_.opponent_index = 9;
  })
  .Barrier("score").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
  }).Barrier("score").Then([this] () {
    model_.served = false;
    model_.ball_in_play = true;
  }).Barrier("point").Clear();
}