The images for my reactions to your bad code are now up. Went with a more 'pixel video' look than a pixel art hand drawn thing.
This commit is contained in:
parent
581e5b4a60
commit
e1c667d816
12 changed files with 40 additions and 36 deletions
14
gui.cpp
14
gui.cpp
|
@ -17,13 +17,13 @@ using namespace fmt;
|
|||
using namespace nlohmann;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
GUI::GUI() {
|
||||
GUI::GUI(SFMLBackend &backend) : gui(backend) {
|
||||
std::ifstream infile(".tarpit.json");
|
||||
json data = json::parse(infile);
|
||||
|
||||
// json load the config file
|
||||
you_died_sound.load(data, "you_died");
|
||||
build_works_sound.load(data, "build_works");
|
||||
build_success_sound.load(data, "build_success");
|
||||
build_failed_sound.load(data, "build_failed");
|
||||
building_sound.load(data, "building", true);
|
||||
}
|
||||
|
@ -33,19 +33,21 @@ void GUI::output(const string msg) {
|
|||
std::cout << msg << std::endl;
|
||||
}
|
||||
|
||||
void GUI::main_loop(SFMLBackend &gui) {
|
||||
void GUI::main_loop() {
|
||||
gui.handle_events();
|
||||
gui.update_entities();
|
||||
gui.update_log(_lines);
|
||||
}
|
||||
|
||||
void GUI::build_works() {
|
||||
void GUI::build_success() {
|
||||
gui.change_face("build_success");
|
||||
building_sound.stop();
|
||||
build_works_sound.play();
|
||||
build_success_sound.play();
|
||||
output("BUILD FINISHED!");
|
||||
}
|
||||
|
||||
void GUI::build_failed(bool play_sound, const string &command) {
|
||||
gui.change_face("build_failed");
|
||||
building_sound.stop();
|
||||
|
||||
if(play_sound) {
|
||||
|
@ -56,6 +58,7 @@ void GUI::build_failed(bool play_sound, const string &command) {
|
|||
}
|
||||
|
||||
void GUI::you_died() {
|
||||
gui.change_face("you_died");
|
||||
building_sound.stop();
|
||||
you_died_sound.play();
|
||||
output("!!!! YOU DIED! !!!! Learn to code luser.");
|
||||
|
@ -63,6 +66,7 @@ void GUI::you_died() {
|
|||
}
|
||||
|
||||
void GUI::building() {
|
||||
gui.change_face("building");
|
||||
output("############# START ############");
|
||||
output(">>>> Will it Build?");
|
||||
building_sound.play();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue