added remaining kahoot music
This commit is contained in:
parent
4c6ca3d4e8
commit
162ea1bd30
|
@ -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
|
||||
|
||||
|
|
BIN
obj/entities.o
BIN
obj/entities.o
Binary file not shown.
BIN
obj/maeth.o
BIN
obj/maeth.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
38
src/maeth.c
38
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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue