Goal SFX added.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/soccer@13498 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
51a7b2b387
commit
43f8963a01
@ -21,6 +21,7 @@
|
||||
#include <IMeshSceneNode.h>
|
||||
|
||||
#include "audio/music_manager.hpp"
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart.hpp"
|
||||
@ -58,6 +59,7 @@ void SoccerWorld::init()
|
||||
fprintf(stderr, "No AI exists for this game mode\n");
|
||||
exit(1);
|
||||
}
|
||||
m_goal_sound = sfx_manager->createSoundSource("goal_scored");
|
||||
m_goal_target = race_manager->getMaxGoal();
|
||||
printf("Max Goal: %d\n", m_goal_target);
|
||||
} // init
|
||||
@ -102,11 +104,11 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
|
||||
printf("*** GOOOOOOOOOAAAAAAALLLLLL!!!! (team: %d) ***\n", first_goal ? 0 : 1);
|
||||
m_team_goals[first_goal ? 0 : 1]++;
|
||||
printf("Score:\nTeam One %d : %d Team Two\n", m_team_goals[0], m_team_goals[1]);
|
||||
}
|
||||
|
||||
World *world = World::getWorld();
|
||||
world->setPhase(WorldStatus::GOAL_PHASE);
|
||||
world->setClockMode(World::CLOCK_COUNTDOWN, 1.0);
|
||||
m_goal_sound->play();
|
||||
}
|
||||
|
||||
//m_check_goals_enabled = false; // TODO: remove?
|
||||
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
/** Whether or not goals can be scored (they are disabled when a point is scored
|
||||
and re-enabled when the next game can be played)*/
|
||||
bool m_can_score_points;
|
||||
SFXBase *m_goal_sound;
|
||||
|
||||
/** Team karts */
|
||||
|
||||
|
@ -237,7 +237,7 @@ void WorldStatus::update(const float dt)
|
||||
// Nothing to do here.
|
||||
break;
|
||||
case GOAL_PHASE:
|
||||
printf("%f", m_time);
|
||||
// Nothing to do here as well.
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user