コード例 #1
0
ファイル: ghosttree.cpp プロジェクト: slackstone/tuxjunior
void
GhostTree::die()
{
  mystate = STATE_DYING;
  sprite->set_action("dying", 1); 
  glow_sprite->set_action("dying", 1); 

  std::vector<TreeWillOWisp*>::iterator iter;
  for(iter = willowisps.begin(); iter != willowisps.end(); ++iter) {
    TreeWillOWisp *willo = *iter;
    willo->vanish();
  }
}
コード例 #2
0
ファイル: lantern.cpp プロジェクト: leper/supertux
HitResponse Lantern::collision(GameObject& other, const CollisionHit& hit) {
  if (is_open()) {
    WillOWisp* wow = dynamic_cast<WillOWisp*>(&other);
    if (wow) {
      // collided with WillOWisp while grabbed and unlit
      SoundManager::current()->play("sounds/willocatch.wav");
      lightcolor = Color(0,1,0);
      updateColor();
      wow->vanish();
    }
    TreeWillOWisp* twow = dynamic_cast<TreeWillOWisp*>(&other);
    if (twow) {
      // collided with TreeWillOWisp while grabbed and unlit
      SoundManager::current()->play("sounds/willocatch.wav");
      lightcolor = twow->get_color();
      updateColor();
      twow->vanish();
    }
  }
  return Rock::collision(other, hit);
}