fixed sound playback of ship destroyed

This commit is contained in:
2011-03-24 08:26:06 +01:00
parent 69c6e1aaef
commit b4c046bae2
6 changed files with 44 additions and 9 deletions
+1
View File
@@ -29,6 +29,7 @@ class Model : public Engine::ModelBase {
void ReloadLevel();
void ProceedToNextLevel ();
int GetPlayerLives () { return mPlayerLives; };
void SetPlayerLives (int lives) { mPlayerLives = lives; };
unsigned int GetPoints () { return mPoints; };
std::string GetPlayerName() { return mPlayerName; };
void SetPlayerName(const std::string &name) {
+5
View File
@@ -601,6 +601,7 @@ void View::DrawUiGameOver() {
// We do not want the background to show the remaining bits of the game
GetModel()->SetGameState(GameStatePaused);
PopViewState();
PopViewState();
PushViewState(ViewStateShowHighscore);
}
@@ -609,6 +610,10 @@ void View::DrawUiGameOver() {
void View::DrawUiLevelIntro() {
SelectFont ("console.ttf size=23");
if (level_assemble_mode) {
GetModel()->SetPlayerLives(100);
}
stringstream level_info_stream;
level_info_stream << "Level " << GetModel()->GetCurrentLevelIndex() + 1;
+3
View File
@@ -165,6 +165,9 @@ int main (int argc, char* argv[]) {
Engine::RunCommand ("exec config.rc");
Engine::PlayMusic (Engine::GetResourceFullPath("/data/sounds/intro_music.ogg"));
Engine::LoadSound(Engine::GetResourceFullPath("/data/sounds/thrust.wav"));
Engine::LoadSound(Engine::GetResourceFullPath("/data/sounds/ship_destroyed.wav"));
Engine::LoadSound(Engine::GetResourceFullPath("/data/sounds/rock_destroyed.wav"));
// load highscore list (either remote or local, depending on settings)
asteroids::GetModel()->LoadHighscoreList();