Subversion Repositories Kolibri OS

Rev

Rev 4254 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4254 Rev 6167
Line 5... Line 5...
5
#include "lib\boxes.txt"
5
#include "lib\boxes.txt"
6
system_colors sc;
6
system_colors sc;
Line 7... Line 7...
7
 
7
 
8
//óðîâíè ñëîæíîñòè
8
//óðîâíè ñëîæíîñòè
9
int DIFFICULTY_LEVEL=1; //ïî-óìîë÷àíèþ ñðåäíåå ïîëå
9
int DIFFICULTY_LEVEL=1; //ïî-óìîë÷àíèþ ñðåäíåå ïîëå
10
char *BOARD_SIZES[]={ "S", "M", "L", 0 };
10
char *BOARD_SIZES[]={ "S\0", "M\0", "L\0", 0 };
Line 11... Line 11...
11
int DIFFICULTY_LEV_PARAMS[]={ 9, 12, 16 };
11
int DIFFICULTY_LEV_PARAMS[]={ 9, 12, 16 };
12
 
12
 
13
int BLOCKS_NUM; //êîëè÷åñòâî êâàäðàòèêîâ ïî Õ è ïî Y
13
int BLOCKS_NUM; //êîëè÷åñòâî êâàäðàòèêîâ ïî Õ è ïî Y
Line 14... Line 14...
14
int BLOCKS_LEFT; //áëîêîâ îñòàëîñü
14
int BLOCKS_LEFT; //áëîêîâ îñòàëîñü
15
int blocks_matrix[28*28]; //öâåòà äëÿ ïîëÿ ñ êâàäðàòèêàìè
15
int blocks_matrix[28*28]; //öâåòà äëÿ ïîëÿ ñ êâàäðàòèêàìè
16
 
16
 
17
#define USER_PANEL_HEIGHT 35
17
#define USER_PANEL_HEIGHT 35
18
#define BLOCK_SIZE 21 //ðàçìåð êâàäðàòèêà
18
#define BLOCK_SIZE 21 //ðàçìåð êâàäðàòèêà
Line 19... Line 19...
19
#define MARKED 7
19
#define MARKED 7
20
#define DELETED_BLOCK 6
20
#define DELETED_BLOCK 6
21
#define HEADER "Just Clicks v2.1"
21
#define HEADER "Just Clicks v2.2"
Line 36... Line 36...
36
#endif
36
#endif
Line 37... Line 37...
37
 
37
 
38
 
38
 
39
void main()
39
void main()
Line 40... Line 40...
40
{
40
{
Line 41... Line 41...
41
	int key, id;
41
	int key_scancode, id;
Line 73... Line 73...
73
					MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +9, BLOCK_SIZE*BLOCKS_NUM +GetSkinWidth()+4+USER_PANEL_HEIGHT);
73
					MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +9, BLOCK_SIZE*BLOCKS_NUM +GetSkinWidth()+4+USER_PANEL_HEIGHT);
74
					break;
74
					break;
75
				}
75
				}
76
				break;
76
				break;
77
			case evKey:
77
			case evKey:
78
				key = GetKey();
78
				key_scancode = GetKeyScancode();
79
				if (key==027) //Escape
79
				if (key_scancode==001) //Escape
80
					 ExitProcess();
80
					 ExitProcess();
81
				if (key==051) //F2
81
				if (key_scancode==060) //F2
82
				{
82
				{
83
					_NEW_GAME_MARK:
83
					_NEW_GAME_MARK:
84
						new_game();
84
						new_game();
85
						draw_clicks_num();
85
						draw_clicks_num();
86
						draw_field();
86
						draw_field();
Line 179... Line 179...
179
 
179
 
Line 180... Line 180...
180
	PANEL_Y=BLOCK_SIZE*BLOCKS_NUM;
180
	PANEL_Y=BLOCK_SIZE*BLOCKS_NUM;
Line 181... Line -...
181
 
-
 
182
	DrawBar(0,PANEL_Y, PANEL_Y, USER_PANEL_HEIGHT, sc.work); //ïàíåëü ñíèçó
-
 
183
 
181
 
184
	//íîâàÿ èãðà
-
 
185
	DefineButton(10,PANEL_Y+7, 13*6+6, 20, 2,sc.work_button);
-
 
186
	WriteText(10+4,PANEL_Y+14,0x80,sc.work_button_text,#NEW_GAME_TEXT,0);
-
 
187
 
-
 
188
 
182
	DrawBar(0,PANEL_Y, PANEL_Y, USER_PANEL_HEIGHT, sc.work); //ïàíåëü ñíèçó
Line 189... Line 183...
189
	//êíîïî÷êa âûáîðà óðîâíÿ ñëîæíîñòè
183
 
Line 190... Line 184...
190
	DefineButton(95,PANEL_Y+7, 20,20, 10,sc.work_button);
184
	DrawCaptButton(10, PANEL_Y+7, 90, 20, 2, sc.work_button, sc.work_button_text,#NEW_GAME_TEXT);
191
	WriteText(95+8,PANEL_Y+14,0x80,sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL],0);
185
	DrawCaptButton(105,PANEL_Y+7, 20, 20, 10,sc.work_button, sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL]);
Line 270... Line 264...
270
				DrawBar(j*BLOCK_SIZE,i*BLOCK_SIZE, BLOCK_SIZE,BLOCK_SIZE, 0xB2B4BF);
264
				DrawBar(j*BLOCK_SIZE,i*BLOCK_SIZE, BLOCK_SIZE,BLOCK_SIZE, 0xB2B4BF);
271
			}
265
			}
272
			else
266
			else
273
			{
267
			{
274
				DefineButton(j*BLOCK_SIZE,i*BLOCK_SIZE,BLOCK_SIZE-1,BLOCK_SIZE-1, current_id+100+BT_HIDE,0);
268
				DefineButton(j*BLOCK_SIZE,i*BLOCK_SIZE,BLOCK_SIZE-1,BLOCK_SIZE-1, current_id+100+BT_HIDE,0);
275
				PutImage(blocks_matrix[current_id]*1323+#img,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE);
269
				PutImage(blocks_matrix[current_id]*1323+#block,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE);
276
			}
270
			}
277
		}
271
		}
278
}
272
}