-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae8a1b3
commit cfd2e71
Showing
15 changed files
with
100 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
#include "audio.h" | ||
|
||
#include <SFML/Audio/SoundBuffer.hpp> | ||
#include <SFML/Audio/Sound.hpp> | ||
|
||
bool Audio::initialized = false; | ||
sf::SoundBuffer Audio::goodPlacement, Audio::badPlacement, Audio::completetion; | ||
sf::Sound Audio::playingSound; | ||
|
||
void Audio::initialize() { | ||
goodPlacement.loadFromFile("resources/goodPlacement.ogg"); | ||
badPlacement.loadFromFile("resources/badPlacement.ogg"); | ||
completetion.loadFromFile("resources/completetion.ogg"); | ||
|
||
initialized = true; | ||
} | ||
|
||
void Audio::play(effect theEffect) { | ||
if (!initialized) | ||
return; | ||
|
||
switch (theEffect) { | ||
case effect::BadPlacement: | ||
playingSound.setBuffer(badPlacement); | ||
break; | ||
case effect::GoodPlacement: | ||
playingSound.setBuffer(goodPlacement); | ||
break; | ||
case effect::Completetion: | ||
playingSound.setBuffer(completetion); | ||
break; | ||
} | ||
|
||
playingSound.play(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <SFML/Audio/SoundBuffer.hpp> | ||
#include <SFML/Audio/Sound.hpp> | ||
|
||
class Audio | ||
{ | ||
private: | ||
static bool initialized; | ||
static sf::SoundBuffer goodPlacement, badPlacement, completetion; | ||
static sf::Sound playingSound; | ||
|
||
public: | ||
enum class effect { GoodPlacement, BadPlacement, Completetion }; | ||
|
||
static void initialize(); | ||
|
||
static void play(effect theEffect); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "impl.h" | ||
|
||
#include <vector> | ||
|
||
class Block : Drawable | ||
{ | ||
private: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
#include "score.h" | ||
|
||
#include "spacing.h" | ||
#include "colors.h" | ||
#include "utilities.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters