This repository has been archived by the owner on Oct 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
119 lines (93 loc) · 2.39 KB
/
common.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#pragma once
// Libraries
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
#include <ctime>
// Define constants
#define WINDOW_WIDTH 1200
#define WINDOW_HEIGHT 700
#define MENU_TOP 250.0f
#define MENU_BUTTON_SPACING 75.0f
#define MENU_LINE_SPACING 40.0f
#define BOARD_LEFT 300.f
#define BOARD_TOP 50.f
#define ASCII_BACKSPACE 8
#define ASCII_ENTER 13
#define ASCII_ESC 27
// Namespace
using namespace sf;
// Environment Variables
extern RenderWindow window;
extern Texture t_menuBackground;
extern Sprite menuBackground;
extern Texture t_gameBackground;
extern Sprite gameBackground;
extern Texture t_logo;
extern Sprite logo;
extern Image icon;
extern Texture t_button_X, t_button_O;
extern Sprite button_X, button_O;
extern Texture t_cursor_X, t_cursor_O;
extern Sprite cursor_X, cursor_O;
extern Texture t_x_big, t_o_big;
extern Sprite x_big, o_big;
extern Font font_arial;
extern Font font_courierNew;
extern Font font_bebasNeueBold;
extern Font font_robotoMonoBold;
extern Music menuMusic;
extern Music gameMusic;
extern SoundBuffer s_optionSound;
extern Sound optionSound;
extern SoundBuffer s_moveSound;
extern Sound moveSound;
extern SoundBuffer s_winSound;
extern Sound winSound;
extern SoundBuffer s_loseSound;
extern Sound loseSound;
// Button
extern Texture t_blueButton_default;
extern Texture t_blueButton_mouseOver;
extern Texture t_brownButton_default;
extern Texture t_brownButton_mouseOver;
extern Texture t_greenButton_default;
extern Texture t_greenButton_mouseOver;
extern Texture t_redButton_default;
extern Texture t_redButton_mouseOver;
extern Texture t_yellowButton_default;
extern Texture t_yellowButton_mouseOver;
// Name Input
extern Texture t_dialogBox;
extern Texture t_board;
extern Texture t_textPlaceholder;
extern Texture t_navReset;
// Animation
extern Texture t_cloudLeft;
extern Texture t_cloudRight;
extern Texture t_star;
extern Texture t_smallStar;
extern Texture t_shine;
extern Texture t_smallShine;
extern Texture t_bad;
// About us
extern Music aboutUsMusic;
extern Texture t_artBg;
extern Texture t_artObj;
extern Texture t_zoom;
extern Texture t_group;
extern Texture t_fit;
extern Texture t_sLogo;
// Common methods
class common
{
public:
static void initGame();
static void runGame();
static void displayOpeningScreen();
static void aboutMenu();
};