Beispiel #1
0
void end_kill_pacman()
{
  stop_anim(pacman.death_anim_);
  play_anim(pacman.pacman_anim_);

  PacmanDead();

  pacman_reset(&pacman);
  --remaining_lives;
}
Beispiel #2
0
void start_kill_pacman()
{
  if(pacman_dead == 1)
    return;

  pacman_dead = 1;

  stop_anim(pacman.pacman_anim_);
  play_anim(pacman.death_anim_);
  pacman.dying = 1;

  PacmanDie();
}
void CControllerPsyHit::on_event(ControlCom::EEventType type, ControlCom::IEventData *data)
{
	if (type == ControlCom::eventAnimationEnd) {
		if (m_current_index < 3) {
			m_current_index++;
			play_anim			();
			
			switch (m_current_index) {
				case 1: death_glide_start();	break;
				case 2: hit();					break;
				case 3: death_glide_end();		break;
			}
		} else {
			m_man->deactivate	(this);
			return;
		}
	}
}
void CControllerPsyHit::activate()
{
	m_man->capture_pure				(this);
	m_man->subscribe				(this, ControlCom::eventAnimationEnd);

	m_man->path_stop				(this);
	m_man->move_stop				(this);

	//////////////////////////////////////////////////////////////////////////
	// set direction
	SControlDirectionData			*ctrl_dir = (SControlDirectionData*)m_man->data(this, ControlCom::eControlDir); 
	VERIFY							(ctrl_dir);
	ctrl_dir->heading.target_speed	= 3.f;
	ctrl_dir->heading.target_angle	= m_man->direction().angle_to_target(Actor()->Position());

	//////////////////////////////////////////////////////////////////////////
	m_current_index					= 0;
	play_anim						();

	m_blocked						= false;

	set_sound_state					(ePrepare);
}