-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtop_interface.cpp
More file actions
40 lines (32 loc) · 1002 Bytes
/
Copy pathtop_interface.cpp
File metadata and controls
40 lines (32 loc) · 1002 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
#include <iostream>
#include "functions_definitions.h"
#include "conio.h"
#include "interfaces.h"
void set(Player* player1)
{
// settitle sets the window title
settitle("Mateusz Wieczorek - Data Engineering group 3, id = 197743");
// hide the blinking cursor
_setcursortype(_NOCURSOR);
// Create static interface for our game
textbackground(BLACK);
// Print the title
textcolor(WHITE);
gotoxy(TOP_LEFT_X_CORNER_COORDINATE, 2);
cputs("BackGammon Game v1.0.0");
gotoxy(TOP_LEFT_X_CORNER_COORDINATE, 3);
cputs("Score: ");
// Print the scores
textcolor(LIGHTCYAN);
gotoxy(TOP_LEFT_X_CORNER_COORDINATE + 8, 4);
std::cout << player1->name << " (B) = " << player1->points;
}
void print_top_interface(Player* player1, Player* player2, bool playing)
{
set(player1);
textcolor(LIGHTRED);
gotoxy(TOP_LEFT_X_CORNER_COORDINATE + 8, 5);
std::cout << player2->name << " (R) = " << player2->points;
if (playing) { print_playing_interface(); }
else { print_startup_options_interface(); }
}