Skip to content
Snippets Groups Projects
Commit 76db6c0c authored by alexis's avatar alexis
Browse files

modificition isInGame

parent 7cbf6c57
No related branches found
No related tags found
No related merge requests found
...@@ -126,7 +126,7 @@ class Being : public Entity ...@@ -126,7 +126,7 @@ class Being : public Entity
// Points de vie actuels. // Points de vie actuels.
int currHp=100; int currHp=100;
// Points de vie maximum. // Points de vie maximum.
int maxHp=100; int maxHp;
// Can take damage. // Can take damage.
bool CTD; bool CTD;
}; };
......
...@@ -20,7 +20,7 @@ class SoundManager{ ...@@ -20,7 +20,7 @@ class SoundManager{
shootingBow = Mix_LoadWAV("../assets/sound/bow_shoot.wav"); shootingBow = Mix_LoadWAV("../assets/sound/bow_shoot.wav");
hitBow = Mix_LoadWAV("../assets/sound/arrowHit.wav"); hitBow = Mix_LoadWAV("../assets/sound/arrowHit.wav");
walkingGrass = Mix_LoadWAV("../assets/sound/walkingGrass.wav"); walkingGrass = Mix_LoadWAV("../assets/sound/walkingGrass.wav");
monsterSlash = Mix_LoadWAV("../assets/sound/walkingGrass.wav"); monsterSlash = Mix_LoadWAV("../assets/sound/monsterSlash.wav");
Mix_Volume(-1,128); Mix_Volume(-1,128);
} }
......
...@@ -56,7 +56,7 @@ void MenuManager::menu(){ ...@@ -56,7 +56,7 @@ void MenuManager::menu(){
NK_WINDOW_BORDER | NK_WINDOW_BORDER |
NK_WINDOW_NO_SCROLLBAR)) NK_WINDOW_NO_SCROLLBAR))
{ {
string startGame = (game->getLoadedSave()=="" && !game->isInGame() ? "Nouvelle partie" : "Reprendre la partie"); string startGame = "Nouvelle partie";
float ratio[] = {0.1f, 0.80f,0.1f}; float ratio[] = {0.1f, 0.80f,0.1f};
int h = menu_height / 15; int h = menu_height / 15;
nk_layout_row(ctx, NK_DYNAMIC, h, 3, ratio); nk_layout_row(ctx, NK_DYNAMIC, h, 3, ratio);
...@@ -66,14 +66,8 @@ void MenuManager::menu(){ ...@@ -66,14 +66,8 @@ void MenuManager::menu(){
nk_spacer(ctx); nk_spacer(ctx);
if (nk_button_label(ctx, startGame.c_str())) { if (nk_button_label(ctx, startGame.c_str())) {
game->setState(InGame); game->setState(InGame);
game->buildWorld();
if(!game->isInGame()){ SoundManager::getInstance().PlayMusicBackground();
game->buildWorld();
SoundManager::getInstance().PlayMusicBackground();
}
else{
SoundManager::getInstance().resumeMusicBackground();
}
} }
nk_spacer(ctx); nk_spacer(ctx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment