@ -217,6 +222,50 @@ int main(int argc, char** argv) {
boolgame_started=false;
boolgame_started=false;
srand(std::time(NULL));
srand(std::time(NULL));
/* Display a drop-down menu, to allow user to pick between Single player, server and client. This section of the code uses the raygui library, and is written in C. */
GuiLoadStyleDark();// Load the dark theme style
/* Modify the default style, by changing font size and spacing */
intfont_size=25;
intfont_spacing=2;
GuiSetStyle(DEFAULT,TEXT_SIZE,font_size);
GuiSetStyle(DEFAULT,TEXT_SPACING,font_spacing);
/* Set variables to position objects on screen */
intselected_item=0;// variable to hold the index of the selected item
char*game_mode_txt="Select Game Mode";// Text to display
/* Size of the label, drop down box and button */
Vector2label_size=MeasureTextEx(GetFontDefault(),game_mode_txt,font_size,font_spacing);// Set the size based on the width of the string to print, the font size and the text spacing. I added 1 to font_size and font_spacing, to account for any possible rounding errors, since the function expects floats.
/* Drop-down menu, that allows user to select game mode */
if(GuiDropdownBox((Rectangle){(WIDTH/2)-(box_size.x/2),(HEIGHT/2)-(HEIGHT/8),box_size.x,box_size.y},"SINGLE;CLIENT;SERVER",&selected_item,is_being_edited)){// This function returns != 0 if there was a mouse click inside the dropdown area
is_being_edited=!is_being_edited;// If the dropdown menu was selected, then it is being edited (or not being edited, if it previously was).
}
// printf("%d\n", selected_item);
GuiUnlock();
EndDrawing();
}
/* Variable to store the response given by the other player */
/* Variable to store the response given by the other player */