Dodano w miare sensowne poruszanie sie tla i muzyke, do zrobienia lepsze tlo

This commit is contained in:
2024-11-20 19:32:35 +01:00
parent a69dc434a9
commit e38bb6e5d0
68 changed files with 6390 additions and 9 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef AUDIOMANAGER_H
#define AUDIOMANAGER_H
#include <SFML/Audio.hpp>
#include <unordered_map>
#include <string>
class AudioManager {
public:
bool loadBackgroundMusic(const std::string& filePath);
void playBackgroundMusic(float volume = 50.f, bool loop = true);
void stopBackgroundMusic();
bool loadSoundEffect(const std::string& name, const std::string& filePath);
void playSoundEffect(const std::string& name, float volume = 50.f);
private:
sf::Music backgroundMusic;
std::unordered_map<std::string, sf::SoundBuffer> soundBuffers;
std::unordered_map<std::string, sf::Sound> sounds;
};
#endif // AUDIOMANAGER_H
+20
View File
@@ -0,0 +1,20 @@
#ifndef BACKGROUND_H
#define BACKGROUND_H
#include "SFML/Graphics.hpp"
class Background {
private:
sf::Texture texture;
sf::Sprite sprite1;
sf::Sprite sprite2;
float speed;
public:
Background(const std::string& texturePath, float speed);
void update();
void draw(sf::RenderWindow& window);
};
#endif // BACKGROUND_H