-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserScene.cpp
More file actions
41 lines (37 loc) · 1.32 KB
/
UserScene.cpp
File metadata and controls
41 lines (37 loc) · 1.32 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
#include "UserScene.h"
#include <conio.h>
void TeleportScene::ToWrite()
{
switch (Number_of_string)
{
case if_blue_teleport:
wcout << endl;
print_with_delay(L"Òû áûë òåëåïîðòèðîâàí â ñèíèé òåëåïîðò", 10);
break;
case if_yellow_teleport:
wcout << endl;
print_with_delay(L"Òû áûë òåëåïîðòèðîâàí â æ¸ëòûé òåëåïîðò", 10);
break;
default:
break;
}
Number_of_string = -1;
}
TeleportScene::TeleportScene(const wstring& a_Name_of_Scene, int a_Size_X, int a_Size_Y, const Character& a_main_character, const ObjectGame& a_Piece) :
Scene(a_Name_of_Scene, a_Size_X, a_Size_Y, a_main_character, a_Piece)
{}
void TeleportScene::func()
{
if ((this->GetNextStepMainCharacter() == this->GetPositionCharacter(m_characters[1])) &&
(this->GetPositionCharacter(m_characters[0]) == (this->GetPositionCharacter(m_characters[1]) - 1)))
{
this->move(this->GetPositionCharacter(m_characters[0]), this->GetPositionCharacter(m_characters[2]) + 2);
Number_of_string = if_blue_teleport;
}
else if ((this->GetNextStepMainCharacter() == this->GetPositionCharacter(m_characters[2])) &&
(this->GetPositionCharacter(m_characters[0]) == (this->GetPositionCharacter(m_characters[2]) + 1)))
{
this->move(this->GetPositionCharacter(m_characters[0]), this->GetPositionCharacter(m_characters[1]) - 2);
Number_of_string = if_yellow_teleport;
}
}