-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameover.cpp
More file actions
54 lines (45 loc) · 990 Bytes
/
Gameover.cpp
File metadata and controls
54 lines (45 loc) · 990 Bytes
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
48
49
50
51
52
53
54
#include "Gameover.h"
#include "RaylibWrapper.h"
#include "settings.h"
Gameover::Gameover() : Scene(PartieFinie)
{
_screenText = "";
}
void Gameover::Init()
{
Vec2<float> dimensions{ 150, 75 };
int nbButtons = 3;
float screenXcenter = stg::screenWidth / 5.0f;
float posY = stg::screenHeight / static_cast<float>(nbButtons + 1);
_rematch.Init({ screenXcenter * 1, posY * 3 }, dimensions, "Rejouer", VERTFONCE);
_quit.Init({ screenXcenter * 4, posY * 3 }, dimensions, "Quitter", VERTFONCE);
}
void Gameover::SetScore(int score)
{
}
void Gameover::Update()
{
Vec2<float> mousePos = raywrp::GetMousePositionV();
_rematch.Update(mousePos);
_quit.Update(mousePos);
}
void Gameover::Draw()
{
Scene::Draw();
raywrp::DrawTextV(_screenText, { -69, -69 }, 50, VERT);
_rematch.Draw();
_quit.Draw();
}
int Gameover::IsSceneSwitching()
{
int Action = Nothing;
if (_rematch.IsClicked())
{
Action = Reset;
}
else if (_quit.IsClicked())
{
Action = Quit;
}
return Action;
}