diff --git a/bin/back b/bin/back index 89b278c..b3e00bb 100755 Binary files a/bin/back and b/bin/back differ diff --git a/levels/level_02/room_0 b/levels/level_02/room_0 index 9c0bf8d..fd2048d 100644 --- a/levels/level_02/room_0 +++ b/levels/level_02/room_0 @@ -123,6 +123,8 @@ Entities: [18.0, 42.0, 3.5, 1.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192, 1, 0, 13, 0, 3.5] [14.0, 43.0, 3.5, 1.0, 1.0, 1.0, 0.0, 0.0, 192, 192, 192, 1, 0, 13, 0, 3.5] +[10.0, 0.0, 10.0, 2.0, 2.0, 2.0, 0.0, 0.0, 233, 233, 233, 1, 0, 13, 0, 0.2] // bonus math + Weight : 0 diff --git a/obj/entities.o b/obj/entities.o index 1b3f92f..2f8e535 100644 Binary files a/obj/entities.o and b/obj/entities.o differ diff --git a/obj/maeth.o b/obj/maeth.o index 1d8b41a..0452bfe 100644 Binary files a/obj/maeth.o and b/obj/maeth.o differ diff --git a/sound/audio/kahoot_theme.mp3 b/sound/audio/kahoot_10s.mp3 similarity index 100% rename from sound/audio/kahoot_theme.mp3 rename to sound/audio/kahoot_10s.mp3 diff --git a/sound/audio/kahoot_theme.wav b/sound/audio/kahoot_10s.wav similarity index 100% rename from sound/audio/kahoot_theme.wav rename to sound/audio/kahoot_10s.wav diff --git a/sound/audio/kahoot_20s.mp3 b/sound/audio/kahoot_20s.mp3 new file mode 100644 index 0000000..9139061 Binary files /dev/null and b/sound/audio/kahoot_20s.mp3 differ diff --git a/sound/audio/kahoot_20s.wav b/sound/audio/kahoot_20s.wav new file mode 100644 index 0000000..974301c Binary files /dev/null and b/sound/audio/kahoot_20s.wav differ diff --git a/sound/audio/kahoot_30s.mp3 b/sound/audio/kahoot_30s.mp3 new file mode 100644 index 0000000..42d7c92 Binary files /dev/null and b/sound/audio/kahoot_30s.mp3 differ diff --git a/sound/audio/kahoot_30s.wav b/sound/audio/kahoot_30s.wav new file mode 100644 index 0000000..85eefd5 Binary files /dev/null and b/sound/audio/kahoot_30s.wav differ diff --git a/sound/audio/kahoot_5s.mp3 b/sound/audio/kahoot_5s.mp3 new file mode 100644 index 0000000..3987d88 Binary files /dev/null and b/sound/audio/kahoot_5s.mp3 differ diff --git a/sound/audio/kahoot_5s.wav b/sound/audio/kahoot_5s.wav new file mode 100644 index 0000000..6317c31 Binary files /dev/null and b/sound/audio/kahoot_5s.wav differ diff --git a/sound/audio/kahoot_60s.mp3 b/sound/audio/kahoot_60s.mp3 new file mode 100644 index 0000000..3ee6aa0 Binary files /dev/null and b/sound/audio/kahoot_60s.mp3 differ diff --git a/sound/audio/kahoot_60s.wav b/sound/audio/kahoot_60s.wav new file mode 100644 index 0000000..65c2c83 Binary files /dev/null and b/sound/audio/kahoot_60s.wav differ diff --git a/src/entities.c b/src/entities.c index 43e019f..5675733 100644 --- a/src/entities.c +++ b/src/entities.c @@ -182,9 +182,9 @@ void math_block(double x, double y, double z, double w, double h, double d, doub if(ent->metad1 > -0.9) { ent->metad1 = maxd(ent->metad1 - (double)dtime, 0.0); } - if(mathResult == FAILURE && ent->metad1 > 0.1) { - mathResult = IDLE; - ent->metad1 = 0.1; + if(mathResult == FAILURE && ent->metad1 != 0.0) { + ent->metad1 = 0.0; + //mathResult = IDLE; } } diff --git a/src/maeth.c b/src/maeth.c index d56f7b2..816fde9 100644 --- a/src/maeth.c +++ b/src/maeth.c @@ -32,10 +32,10 @@ double mathAnsT = 10.0; int mathDoDmg = 1; // between 1 and 1000 -int mathDmg = 500; +int mathDmg = 400; // between 2 and 20 -int mathLength = 4; +int mathLength = 8; // --------------------------------------------------------------------- // // min bound for number gen (disregarding difficulty) int mthInf = 1; @@ -46,10 +46,16 @@ int mthSup = 20; // whether or not to allow operations (SUM is always enabled) bool mthAllow[3]; +// allow for dynamic difficulty +int mthDynDiff = 1; + +// dynamic multiplier +double mthDynMultiplier = 0.9; + // --------------------------------------------------------------------- // int mthDiffSetting, mthAnsTSetting, mthLengthSetting, mthDoDmgSetting, mthDmgSetting; -int mthInfSetting, mthSupSetting; +int mthInfSetting, mthSupSetting, mthDynSetting, mthMultSetting; int mthExitSetting; int mthInterface; @@ -68,8 +74,10 @@ void init_math_interfaces() { mthDoDmgSetting = button_create_onoff("damage if wrong", 255, 64, 64, -0.6f, -0.5f, 0.5f, 0.25f, SET_VAR, &mathDoDmg, 0, 1, INT, NULL, NULL); mthDmgSetting = button_create_onoff("damage value", 128, 6, 6, -0.6f, -0.8f, 0.5f, 0.25f, SET_VAR, &mathDmg, 1, 1000, INT, NULL, NULL); - mthInfSetting = button_create_onoff("minimum val", 128, 128, 255, 0.1f, 0.4f, 0.5f, 0.25f, SET_VAR, &mthInf, 1, 32767, INT, NULL, NULL); - mthSupSetting = button_create_onoff("maximum val", 128, 128, 255, 0.1f, 0.1f, 0.5f, 0.25f, SET_VAR, &mthSup, 1, 32767, INT, NULL, NULL); + mthInfSetting = button_create_onoff("minimum val", 128, 128, 255, 0.1f, 0.4f, 0.5f, 0.25f, SET_VAR, &mthInf, 1, 32767, INT, NULL, NULL); + mthSupSetting = button_create_onoff("maximum val", 128, 128, 255, 0.1f, 0.1f, 0.5f, 0.25f, SET_VAR, &mthSup, 1, 32767, INT, NULL, NULL); + mthDynSetting = button_create_onoff("dynamic difficluty",192, 144, 100, 0.1f, -0.2f, 0.5f, 0.25f, SET_VAR, &mthDynDiff, 0, 1, INT, NULL, NULL); + mthMultSetting = button_create_onoff("dynamic multiplier",255, 192, 128, 0.1f, -0.5f, 0.5f, 0.25f, SET_VAR, &mthDynMultiplier, 0.1, 0.98, DOUBLE, NULL, NULL); mthExitSetting = button_create_onoff("back", 64, 255, 64, 0.25f, -0.8f, 0.5f, 0.25f, WARP, &welcome_start_i, 0, 1, INT, &rebalance, NULL); @@ -82,6 +90,8 @@ void init_math_interfaces() { interface_link_button(mthInterface, mthDmgSetting); interface_link_button(mthInterface, mthInfSetting); interface_link_button(mthInterface, mthSupSetting); + interface_link_button(mthInterface, mthDynSetting); + interface_link_button(mthInterface, mthMultSetting); interface_link_button(mthInterface, mthExitSetting); } @@ -257,7 +267,19 @@ void the_actual_main_math_function(GLFWwindow* window) { mPress[k] = false; } float ratio = 0.0f; - play_sound("sound/audio/kahoot_theme.wav"); + + if(mathAnsT <= 5.0) { + play_sound("sound/audio/kahoot_5s.wav"); + } else if(mathAnsT <= 10.0) { + play_sound("sound/audio/kahoot_10s.wav"); + } else if(mathAnsT <= 20.0) { + play_sound("sound/audio/kahoot_20s.wav"); + } else if(mathAnsT <= 30.0) { + play_sound("sound/audio/kahoot_30s.wav"); + } else { + play_sound("sound/audio/kahoot_60s.wav"); + } + while(!solved && ratio < 1.0f) { if(player_answer*sign == correct_answer) { solved = true; @@ -352,10 +374,12 @@ void the_actual_main_math_function(GLFWwindow* window) { reset_music(); play_sound("sound/audio/kahoot-gong.wav"); if(solved) { - player_hp += 100; + //player_hp += 100; + mathAnsT = maxd(mthDynMultiplier*mathAnsT, 1.0); mathResult = SUCCESS; } else { player_hp -= mathDmg*mathDoDmg; + mathAnsT = mind(mathAnsT/(mthDynMultiplier*mthDynMultiplier), 60.0); mathResult = FAILURE; } } \ No newline at end of file