-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame_Screen.h
129 lines (114 loc) · 5.15 KB
/
Game_Screen.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
120
121
122
123
124
125
126
127
128
#pragma once
#include "screen_abstract.h"
class Game_Screen :
public Screen_Abstract
{
public:
//OBSLUGA MYSZKI
void Handling_Mouse( ALLEGRO_EVENT &events ) ;
//OBSLUGA KLAWIATURY
void Handling_Keyboard( ALLEGRO_EVENT &events , ALLEGRO_KEYBOARD_STATE &keyState , ALLEGRO_TIMER *MoveFPS = 0 , ALLEGRO_TIMER *ChangeFPS = 0 ) ;
//RYSOWANIE EKRANU
void Draw_Screen( ALLEGRO_EVENT &events , ALLEGRO_TIMER *FPS , ALLEGRO_TIMER *MapFPS = 0 ) ;
//PRZYCIEMNIANIE EKRANU PRZY PRZEJSCIU NA INNY
void Screen_Fading() ;
//ROZJASNIANIE EKRANU PRZY WCZYTANIU
void Screen_Lighten() ;
Game_Screen()
{
//ZAZNACZONA POZYCJA PRZEZ MYSZKE
Mouse_Select = 0 ;
Maps = new Map() ;
Game_Over = false ;
Start_Game = false ;
Draw_Over = false ;
Screen_Bitmap["Arrow"] = load_bitmap_at_size( "Graphics\\Game\\Keyboard_Arrow.png" , 200 , 100 ) ;
Screen_Bitmap["Back"] = load_bitmap_at_size( "Graphics\\Game\\Back_to_Choice.png" , 200 , 50 ) ;
Screen_Bitmap["Start"] = load_bitmap_at_size( "Graphics\\Game\\Start.png" , 200 , 50 ) ;
Screen_Bitmap["Pause"] = load_bitmap_at_size( "Graphics\\Game\\Pause.png" , 200 , 50 ) ;
Screen_Bitmap["Pause_Screen"] = load_bitmap_at_size( "Graphics\\Game\\Pause_Screen.png" , 600 , 600 ) ;
Screen_Bitmap["Game_Over"] = load_bitmap_at_size( "Graphics\\Game\\Game_Over.png" , 600 , 400 ) ;
Screen_Bitmap["Back2"] = load_bitmap_at_size( "Graphics\\Game\\Back_to_Choice2.png" , 200 , 50 ) ;
Screen_Bitmap["Start2"] = load_bitmap_at_size( "Graphics\\Game\\Start2.png" , 200 , 50 ) ;
Screen_Bitmap["Pause2"] = load_bitmap_at_size( "Graphics\\Game\\Pause2.png" , 200 , 50 ) ;
//SPRAWDZAMY CZY BITMAPY ISTNIEJA
if( !Screen_Bitmap["Arrow"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Keyboard_Arrow.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Back"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Back_to_Choice.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Start"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Start.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Pause"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Pause.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Back2"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Back_to_Choice2.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Start2"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Start2.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Pause2"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Pause2.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Pause_Screen"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Pause_Screen.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
else if( !Screen_Bitmap["Game_Over"] )
{
al_show_native_message_box( display , "ERROR BITMAP" , "ERROR" , "You don't have bitmap \"Graphics\\Game\\Game_Over.png\" " , NULL , ALLEGRO_MESSAGEBOX_ERROR ) ;
exit(1) ;
}
//USTAWIAMY MASKE DLA PRZYCISKOW
al_convert_mask_to_alpha( Screen_Bitmap["Arrow"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Back"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Back2"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Start"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Start2"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Pause"] , al_map_rgb(255 , 255 , 255) ) ;
al_convert_mask_to_alpha( Screen_Bitmap["Pause2"] , al_map_rgb(255 , 255 , 255) ) ;
}
~Game_Screen()
{
delete Maps ;
al_destroy_bitmap( Screen_Bitmap["Arrow"] ) ;
al_destroy_bitmap( Screen_Bitmap["Back"] ) ;
al_destroy_bitmap( Screen_Bitmap["Start"] ) ;
al_destroy_bitmap( Screen_Bitmap["Pause"] ) ;
al_destroy_bitmap( Screen_Bitmap["Back2"] ) ;
al_destroy_bitmap( Screen_Bitmap["Start2"] ) ;
al_destroy_bitmap( Screen_Bitmap["Pause2"] ) ;
al_destroy_bitmap( Screen_Bitmap["Pause_Screen"] ) ;
al_destroy_bitmap( Screen_Bitmap["Game_Over"] ) ;
//al_destroy_bitmap( Screen_Photo ) ;
}
private:
//ZAZNACZONA POZYCJA PRZEZ MYSZKE
int Mouse_Select ;
//WSKAZNIK MAPY
Map * Maps ;
//KONIEC GRY
bool Game_Over ;
//START PAUZA
bool Start_Game ;
//ZMIENNA DO RYSOWANIA GAMEOVER
bool Draw_Over ;
};