From bc7fb12564ac99be0383d080474f686e7518be63 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 2 Apr 2022 11:32:50 -0400 Subject: [PATCH] Fix the rest of the merge issues --- game/game_logic/src/scenes/main_menu.rs | 62 +++++++++++-------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/game/game_logic/src/scenes/main_menu.rs b/game/game_logic/src/scenes/main_menu.rs index 7c7d1825..769819e1 100644 --- a/game/game_logic/src/scenes/main_menu.rs +++ b/game/game_logic/src/scenes/main_menu.rs @@ -67,11 +67,11 @@ impl MainMenu { draw.clear_background(Color::WHITE); //I wanna see where mouseeee - let mouse_x = draw.get_mouse_x(); - let mouse_y = draw.get_mouse_y(); - - draw.draw_text(&mouse_x.to_string(), 20, 5, 20, Color::BLACK); - draw.draw_text(&mouse_y.to_string(), 70, 5, 20, Color::BLACK); + let mouse_x = draw.get_mouse_x(); + let mouse_y = draw.get_mouse_y(); + + draw.draw_text(&mouse_x.to_string(), 20, 5, 20, Color::BLACK); + draw.draw_text(&mouse_y.to_string(), 70, 5, 20, Color::BLACK); // TODO: Render stuff //Initial Option placeholder words in the main menu @@ -82,36 +82,34 @@ impl MainMenu { draw.draw_text("Leaderboard", 100, 470, 34, Color::BLACK); draw.draw_text("Exit", 100, 550, 34, Color::BLACK); - //First two are starting X and Y position, last two finishing X and Y. Made to resemble a box + //First two are starting X and Y position, last two finishing X and Y. Made to resemble a box - if mouse_x >= 100 && mouse_y >= 193 && mouse_x <= 290 && mouse_y <= 216{ - //Insides while make a lil shade for it to look cool - draw.draw_text("Start Game", 103, 191, 34, Color::GRAY); - draw.draw_text("Start Game", 100, 190, 34, Color::BLACK); - if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) { - return true; - } + if mouse_x >= 100 && mouse_y >= 193 && mouse_x <= 290 && mouse_y <= 216 { + //Insides while make a lil shade for it to look cool + draw.draw_text("Start Game", 103, 191, 34, Color::GRAY); + draw.draw_text("Start Game", 100, 190, 34, Color::BLACK); + if draw.is_mouse_button_down(MouseButton::MOUSE_LEFT_BUTTON) { + return MenuStateSignal::StartGame; } + } - if mouse_x >= 100 && mouse_y >= 250 && mouse_x <= 222 && mouse_y <= 275{ - draw.draw_text("Options", 103, 251, 34, Color::GRAY); - draw.draw_text("Options", 100, 250, 34, Color::BLACK); - } + if mouse_x >= 100 && mouse_y >= 250 && mouse_x <= 222 && mouse_y <= 275 { + draw.draw_text("Options", 103, 251, 34, Color::GRAY); + draw.draw_text("Options", 100, 250, 34, Color::BLACK); + } + if mouse_x >= 100 && mouse_y >= 410 && mouse_x <= 222 && mouse_y <= 437 { + draw.draw_text("Credits", 103, 411, 34, Color::GRAY); + draw.draw_text("Credits", 100, 410, 34, Color::BLACK); + } + if mouse_x >= 100 && mouse_y >= 470 && mouse_x <= 316 && mouse_y <= 496 { + draw.draw_text("Leaderboard", 103, 471, 34, Color::GRAY); + draw.draw_text("Leaderboard", 100, 470, 34, Color::BLACK); + } - if mouse_x >= 100 && mouse_y >= 410 && mouse_x <= 222 && mouse_y <= 437{ - draw.draw_text("Credits", 103, 411, 34, Color::GRAY); - draw.draw_text("Credits", 100, 410, 34, Color::BLACK); - } - if mouse_x >= 100 && mouse_y >= 470 && mouse_x <= 316 && mouse_y <= 496{ - draw.draw_text("Leaderboard", 103, 471, 34, Color::GRAY); - draw.draw_text("Leaderboard", 100, 470, 34, Color::BLACK); - } - - if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 162 && mouse_y <= 575{ - draw.draw_text("Exit", 103, 551, 34, Color::GRAY); - draw.draw_text("Exit", 100, 550, 34, Color::BLACK); - } + if mouse_x >= 100 && mouse_y >= 550 && mouse_x <= 162 && mouse_y <= 575 { + draw.draw_text("Exit", 103, 551, 34, Color::GRAY); + draw.draw_text("Exit", 100, 550, 34, Color::BLACK); } // Return MenuStateSignal::StartGame if you want the game to start. @@ -127,7 +125,6 @@ impl MainMenu { global_resources: &GlobalResources, constants: &ProjectConstants, ) -> MenuStateSignal { - return MenuStateSignal::DoOptions; } @@ -139,7 +136,6 @@ impl MainMenu { global_resources: &GlobalResources, constants: &ProjectConstants, ) -> MenuStateSignal { - return MenuStateSignal::DoCredits; } @@ -151,8 +147,6 @@ impl MainMenu { global_resources: &GlobalResources, constants: &ProjectConstants, ) -> MenuStateSignal { - return MenuStateSignal::DoLeaderboard; - } }