Subversion Repositories Kolibri OS

Rev

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

Rev 1006 Rev 1768
Line 9... Line 9...
9
#pragma option meos
9
#pragma option meos
10
#include "lib\kolibri.h--"
10
#include "lib\kolibri.h--"
11
#include "lib\random.h--"
11
#include "lib\random.h--"
12
#include "files\boxes.txt"
12
#include "files\boxes.txt"
13
#include "files\cups.txt"
13
#include "files\cups.txt"
14
 
14
 
-
 
15
#ifndef AUTOBUILD
-
 
16
#include "lang.h--"
-
 
17
#endif
Line 15... Line 18...
15
 
18
 
-
 
19
byte i,j, XX, YY;
Line 16... Line 20...
16
byte i,j, XX, YY;
20
system_colors sc;
17
 
21
 
18
struct
22
struct
19
{
23
{
Line 123... Line 127...
123
			matrix[num].y=i;
127
			matrix[num].y=i;
124
			IF (matrix[num].mark==0)
128
			IF (matrix[num].mark==0)
125
				{
129
				{
126
				DefineButton(j*21,y-22, 20, 20, num+BT_HIDE, 0);
130
				DefineButton(j*21,y-22, 20, 20, num+BT_HIDE, 0);
127
				PutImage(matrix[num].color-1*1323+#img,21,21,j*21,y-22);
131
				PutImage(matrix[num].color-1*1323+#img,21,21,j*21,y-22);
-
 
132
				}
-
 
133
			ELSE
128
				}	ELSE DrawBar(j*21,y-22,21,21, 0xB2B4BF);
134
				DrawBar(j*21,y-22,21,21, 0xB2B4BF);
129
			num++;
135
			num++;
130
		}
136
		}
131
		y=y+21;
137
		y=y+21;
132
	}
138
	}
-
 
139
#ifdef LANG_RUS
133
	DrawBar(90,178,71,8,0xE4DFE1);
140
	DrawBar(90,178,71,8,sc.work);
134
	IF (check_for_end()==1) WriteText(90,178,0x80,0,"¥§ã«ìâ â:",10);
141
	IF (check_for_end()==1) WriteText(90,178,0x80,sc.work_text,"¥§ã«ìâ â:",10);
135
	ELSE WriteText(96,178,0x80,0,"Žáâ «®áì:",10);
142
	ELSE WriteText(96,178,0x80,sc.work_text,"Žáâ «®áì:",10);
-
 
143
#else
-
 
144
	DrawBar(108,178,60,8,sc.work);
-
 
145
	IF (check_for_end()==1) WriteText(108,178,0x80,sc.work_text,"Result:",10);
-
 
146
	ELSE WriteText(108,178,0x80,sc.work_text,"Blocks:",10);
-
 
147
#endif
136
	FOR (i=0;i<8;i++) FOR (j=0;j<8;j++) IF (matrix[j*8+i].mark==0) count_blocks++;
148
	FOR (i=0;i<8;i++) FOR (j=0;j<8;j++) IF (matrix[j*8+i].mark==0) count_blocks++;
137
	WriteNumber(150,178,0x80,0,count_blocks);
149
	WriteNumber(150,178,0x80,sc.work_text,count_blocks);
138
	//
150
	//
139
	if (check_for_end()==1) && (count_blocks<8)
151
	if (check_for_end()==1) && (count_blocks<8)
140
	{
152
	{
141
		DrawFlatButton(21,42,125,62,0,0xE4DFE1,"");
153
		DrawFlatButton();
-
 
154
#ifdef LANG_RUS
142
		IF (count_blocks==0) copystr(" ‹ãçè¥ ¢á¥å!", #temp);  
155
		IF (count_blocks==0) copystr(" ‹ãçè¥ ¢á¥å!", #temp);  
143
		IF (count_blocks==1) copystr("  à¥ªà á­®", #temp);
156
		IF (count_blocks==1) copystr("  à¥ªà á­®", #temp);
144
		IF (count_blocks==2) copystr("Žç¥­ì å®à®è®!", #temp);
157
		IF (count_blocks==2) copystr("Žç¥­ì å®à®è®!", #temp);
-
 
158
#else
-
 
159
		IF (count_blocks==0) copystr("The best!", #temp);
-
 
160
		IF (count_blocks==1) copystr("Wonderful", #temp);
-
 
161
		IF (count_blocks==2) copystr("Very good", #temp);
-
 
162
#endif
145
		IF (count_blocks>=3) //¡ £!!!
163
		IF (count_blocks>=3) //¡ £!!!
146
		{
164
		{
-
 
165
#ifdef LANG_RUS
147
			copystr("   ¥¯«®å®", #temp);
166
			copystr("   ¥¯«®å®", #temp);
-
 
167
#else
-
 
168
			copystr(" Not bed", #temp);
-
 
169
#endif
148
			count_blocks=3;
170
			count_blocks=3;
149
		}
171
		}
150
		PutImage(count_blocks*42*37*3+#cups,42,37,63,48);
172
		PutImage(count_blocks*4662+#cups,42,37,63,48);
-
 
173
#ifdef LANG_RUS
151
		WriteText(46,91,0x80,0x0,#temp,0);
174
		WriteText(46,91,0x80,0x0,#temp,0);
-
 
175
#else
-
 
176
		WriteText(58,91,0x80,0x0,#temp,0);
-
 
177
#endif
152
	}
178
	}
153
}
179
}
Line 154... Line 180...
154
 
180
 
155
 
181
 
156
void main()
182
void main()
157
{	byte id, skin_width;
183
{	byte id;
158
	randomize();
184
	//randomize();
159
	ReDraw_Blocks(1);
185
	ReDraw_Blocks(1);
160
	loop()
186
	loop()
161
	{
187
	{
Line 181... Line 207...
181
					}
207
					}
182
				}    
208
				}    
183
				break;
209
				break;
184
			case evReDraw:
210
			case evReDraw:
185
				WindowRedrawStatus(1);
211
				WindowRedrawStatus(1);
186
				skin_width = GetSkinWidth();
-
 
187
				DefineAndDrawWindow(400,276,177,201+skin_width,0x74,0x10B2B4BF,0,0,"Just Clicks v0.76");
212
				DefineAndDrawWindow(400,276,177,201+GetSkinWidth(),0x74,0x10B2B4BF,0,0,"Just Clicks v0.77");
188
				DefineButton(150,2-skin_width,18,18,255+BT_HIDE+BT_NOFRAME,0x0866CC00);
-
 
189
				DrawBar(0,168,168,29,0xE4DFE1);
-
 
190
				//DrawFlatButton(9,172,84,19,254,0xE4DFE1,"New game (F2)");
-
 
191
				DrawFlatButton(4,172,80,19,254,0xE4DFE1,"‡ ­®¢® (F2)");
-
 
192
				ReDraw_Blocks(0);
-
 
193
				WindowRedrawStatus(2);
213
				WindowRedrawStatus(2);
-
 
214
				sc.get();
-
 
215
				DefineButton(150,-18,18,18,255+BT_HIDE+BT_NOFRAME,0); //ª­®¯®çª  § ªàëâ¨ï :]
-
 
216
				DrawBar(0,168,168,29,sc.work); //¯ ­¥«ìª  á­¨§ã
-
 
217
#ifdef LANG_RUS
-
 
218
				DefineButton(9,172,76,19,254,sc.work_button);
-
 
219
				WriteText(16,178,0x80,sc.work_button_text,"‡ ­®¢® (F2)",0);
-
 
220
#else
-
 
221
				DefineButton(9,172,86,19,254,sc.work_button);
-
 
222
				WriteText(15,178,0x80,sc.work_button_text,"New game (F2)",0);
-
 
223
#endif
-
 
224
				ReDraw_Blocks(0);
194
		}
225
		}
195
	}
226
	}
196
}
227
}
Line -... Line 228...
-
 
228
 
-
 
229
 
-
 
230
void DrawFlatButton()
-
 
231
{
-
 
232
	DrawBar(21,42,125,1,0x94AECE); //¯®«®á  £®à ᢥàåã
-
 
233
	DrawBar(21,104,125,1,0x94AECE); //¯®«®á  £®à á­¨§ã
-
 
234
	DrawBar(21,42,1,62,0x94AECE); //¯®«®á  ¢¥àâ á«¥¢ 
-
 
235
	DrawBar(146,42,1,63,0x94AECE); //¯®«®á  ¢¥àâ á¯à ¢ 
-
 
236
	DrawBar(22,43,124,1,0xFFFFFF); //¯®«®á  £®à ¡¥« ï
-
 
237
	DrawBar(22,103,123,1,0xC7C7C7); //â¥­ì ¢¥àâ
-
 
238
	DrawBar(22,43,1,61,0xFFFFFF); //¯®«®á  ¢¥àâ ¡¥« ï
-
 
239
	DrawBar(145,44,1,60,0xC7C7C7); //â¥­ì ¢¥àâ
-
 
240
	DrawBar(23,44,122,59,0xE4DFE1); //§ «¨¢ª 
-
 
241
}
197
 
242