-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenuState.cpp
More file actions
47 lines (38 loc) · 1.3 KB
/
MainMenuState.cpp
File metadata and controls
47 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* @file MainMenuState.cpp
* @brief Main Menu State Implementation
*/
#include "GameState.hpp"
#include "GameEngine.hpp"
#include "UIComponents.hpp"
#include <memory>
using std::make_unique;
namespace Queah {
void MainMenuState::enter() {
// Initialize menu
}
void MainMenuState::exit() {
// Cleanup
}
void MainMenuState::update(float deltaTime) {
// Menu logic
}
void MainMenuState::handleInput() {
Vector2 mousePos = GetMousePosition();
Rectangle jogarBtn = {200, 360, 300, 100};
Rectangle criadoresBtn = {250, 490, 200, 70};
Rectangle regrasBtn = {250, 580, 200, 70};
Rectangle historicoBtn = {250, 670, 200, 70};
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) {
if (CheckCollisionPointRec(mousePos, jogarBtn)) {
engine_->changeState(make_unique<PlayerSetupState>(engine_, 1));
} else if (CheckCollisionPointRec(mousePos, criadoresBtn)) {
engine_->changeState(make_unique<CreditsState>(engine_));
} else if (CheckCollisionPointRec(mousePos, regrasBtn)) {
engine_->changeState(make_unique<RulesState>(engine_));
} else if (CheckCollisionPointRec(mousePos, historicoBtn)) {
engine_->changeState(make_unique<HistoryState>(engine_));
}
}
}
}