-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameOverInputHandler.cpp
More file actions
30 lines (27 loc) · 974 Bytes
/
Copy pathGameOverInputHandler.cpp
File metadata and controls
30 lines (27 loc) · 974 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
#include "GameOverInputHandler.h"
#include "WorldState.h"
#include <iostream>
using namespace std;
using namespace sf;
void GameOverInputHandler::handleKeyPressed(Event& event, RenderWindow&)
{
if (event.key.code == Keyboard::Escape)
{
getPointerToScreenManagerRemoteControl()->shareSoundPlayer().playClick();
getPointerToScreenManagerRemoteControl()->switchScreens("Select");
}
}
void GameOverInputHandler::handleLeftClick(std::string& buttonInteractedWith, RenderWindow&)
{
if (buttonInteractedWith == "Play")
{
getPointerToScreenManagerRemoteControl()->shareSoundPlayer().playClick();
WorldState::WAVE_NUMBER = 0;
getPointerToScreenManagerRemoteControl()->loadLevelInPlayMode("level1");
}
else if (buttonInteractedWith == "Home")
{
getPointerToScreenManagerRemoteControl()->shareSoundPlayer().playClick();
getPointerToScreenManagerRemoteControl()->switchScreens("Select");
}
}