[Added] Crates, Hud for bullets and health

This commit is contained in:
Ninjaws
2024-12-15 00:12:16 +01:00
parent 55792bb954
commit de958b02e6
17 changed files with 448 additions and 38 deletions
+7
View File
@@ -20,6 +20,13 @@ void AssetService::setAssets()
music[EMusic::GAME_OVER] = loadMusic("Audio/Music/gameOverTheme_2.ogg", false);
/** Todo: set volume */
sounds[ESound::SHOOT] = loadSound("Audio/Sounds/gunShot.wav");
SetSoundVolume(sounds[ESound::SHOOT], 0.4f);
sounds[ESound::NO_AMMO] = loadSound("Audio/Sounds/outOfAmmo.wav");
sounds[ESound::CRATE_BREAK] = loadSound("Audio/Sounds/crateBreak.wav");
SetSoundVolume(sounds[ESound::CRATE_BREAK], 1.0f);
sounds[ESound::JELLY_FREED] = loadSound("Audio/Sounds/jellyFreed.wav");
backgrounds[EBackground::TUTORIAL] = loadTexture("Textures/TutorialBackground2.png");
backgrounds[EBackground::GAME1] = loadTexture("Textures/GameBackground_1.png");
backgrounds[EBackground::GAME2] = loadTexture("Textures/GameBackground_2.jpg");
+5 -5
View File
@@ -1,13 +1,13 @@
#include "services/StateService.h"
#include "raylib.h"
#include "services/StateService.h"
#include "services/AudioService.h"
#include "services/InputService.h"
#include "screens/TitleScreen.h"
#include "screens/MainScreen.h"
#include "screens/TutorialScreen.h"
#include "screens/GameScreen.h"
#include "screens/GameOverScreen.h"
#include <optional>
#include "services/AudioService.h"
#include "services/InputService.h"
void StateService::setScreen(EScreen state)
{
@@ -45,7 +45,7 @@ void StateService::startGame()
{
// if(!instance)
// return;
// InitAudioDevice();
InitAudioDevice();
// InitWindow(640,544, "Jelly Rescue");
InitWindow(screenSize.x, screenSize.y, "Jelly Rescue");
SetTargetFPS(45);
@@ -75,7 +75,7 @@ void StateService::startGame()
#endif
CloseWindow();
// CloseAudioDevice();
CloseAudioDevice();
}
void StateService::handleMusic()