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 <IMeshSceneNode.h>
|
||||||
|
|
||||||
#include "audio/music_manager.hpp"
|
#include "audio/music_manager.hpp"
|
||||||
|
#include "audio/sfx_base.hpp"
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "karts/kart.hpp"
|
#include "karts/kart.hpp"
|
||||||
@ -58,6 +59,7 @@ void SoccerWorld::init()
|
|||||||
fprintf(stderr, "No AI exists for this game mode\n");
|
fprintf(stderr, "No AI exists for this game mode\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
m_goal_sound = sfx_manager->createSoundSource("goal_scored");
|
||||||
m_goal_target = race_manager->getMaxGoal();
|
m_goal_target = race_manager->getMaxGoal();
|
||||||
printf("Max Goal: %d\n", m_goal_target);
|
printf("Max Goal: %d\n", m_goal_target);
|
||||||
} // init
|
} // init
|
||||||
@ -102,12 +104,12 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
|
|||||||
printf("*** GOOOOOOOOOAAAAAAALLLLLL!!!! (team: %d) ***\n", first_goal ? 0 : 1);
|
printf("*** GOOOOOOOOOAAAAAAALLLLLL!!!! (team: %d) ***\n", first_goal ? 0 : 1);
|
||||||
m_team_goals[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]);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
World *world = World::getWorld();
|
|
||||||
world->setPhase(WorldStatus::GOAL_PHASE);
|
|
||||||
world->setClockMode(World::CLOCK_COUNTDOWN, 1.0);
|
|
||||||
|
|
||||||
//m_check_goals_enabled = false; // TODO: remove?
|
//m_check_goals_enabled = false; // TODO: remove?
|
||||||
|
|
||||||
// Reset original positions for the soccer balls
|
// Reset original positions for the soccer balls
|
||||||
|
@ -50,6 +50,7 @@ private:
|
|||||||
/** Whether or not goals can be scored (they are disabled when a point is scored
|
/** 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)*/
|
and re-enabled when the next game can be played)*/
|
||||||
bool m_can_score_points;
|
bool m_can_score_points;
|
||||||
|
SFXBase *m_goal_sound;
|
||||||
|
|
||||||
/** Team karts */
|
/** Team karts */
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ void WorldStatus::update(const float dt)
|
|||||||
// Nothing to do here.
|
// Nothing to do here.
|
||||||
break;
|
break;
|
||||||
case GOAL_PHASE:
|
case GOAL_PHASE:
|
||||||
printf("%f", m_time);
|
// Nothing to do here as well.
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user