flood-it v2.4 c--

git-svn-id: svn://kolibrios.org@2295 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2011-10-18 22:30:16 +00:00
parent 05bbd6e5b0
commit bd30a3086a

View File

@ -1,4 +1,4 @@
//Leency 06.10.2011, Flood-it! v2.2, GPL //Leency 06.10.2011, Flood-it! v2.4, GPL
#include "lib\kolibri.h" #include "lib\kolibri.h"
#include "lib\random.h" #include "lib\random.h"
@ -74,7 +74,7 @@ char *BOARD_SIZES[]={ "S", "L", 0 };
unsigned char color_matrix[28*28]; //öâåòà äëÿ ïîëÿ ñ êâàäðàòèêàìè unsigned char color_matrix[28*28]; //öâåòà äëÿ ïîëÿ ñ êâàäðàòèêàìè
unsigned char loose_matrix[14*14]={ unsigned char loss_matrix[14*14]={
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, 2,
@ -198,7 +198,7 @@ void draw_window()
//ïðîâåðÿåì íå ñõëîïíóòî ëè îêíî â çàãîëîâîê //ïðîâåðÿåì íå ñõëîïíóòî ëè îêíî â çàãîëîâîê
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
IF (Form.height==GetSkinWidth()+3) return; IF (Form.status_window==4) return;
//çàêðàøèâàåì ôîí -> óìåíüøàåò ïåðåðèñîâêó //çàêðàøèâàåì ôîí -> óìåíüøàåò ïåðåðèñîâêó
for (i=0;i<=4;i++) for (i=0;i<=4;i++)
@ -295,11 +295,11 @@ int check_for_end()
IF (CLICKS==MAX_CLICKS) //âûèãðûøü íà ïîñëåäíåì õîäå IF (CLICKS==MAX_CLICKS) //âûèãðûøü íà ïîñëåäíåì õîäå
{ {
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //ïðîâåðÿåì âñ¸ ëè ïîëå îäíîãî öâåòà, åñëè íåò óõîäèì for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //ïðîâåðÿåì âñ¸ ëè ïîëå îäíîãî öâåòà, åñëè íåò óõîäèì
IF (color_matrix[i]<>color_matrix[0]) goto _LOOSE_MARK; IF (color_matrix[i]<>color_matrix[0]) goto _loss_MARK;
goto _WIN_MARK; goto _WIN_MARK;
} }
_LOOSE_MARK: _loss_MARK:
for (i=0;i<14;i++) for (i=0;i<14;i++)
for (j=0;j<14;j++) for (j=0;j<14;j++)
@ -314,10 +314,10 @@ int check_for_end()
ii=i*2; ii=i*2;
jj=j*2; jj=j*2;
} }
color_matrix[ii*BLOCKS_NUM+jj]=loose_matrix[i*14+j]; color_matrix[ii*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
color_matrix[ii+1*BLOCKS_NUM+jj]=loose_matrix[i*14+j]; color_matrix[ii+1*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
color_matrix[ii*BLOCKS_NUM+jj+1]=loose_matrix[i*14+j]; color_matrix[ii*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
color_matrix[ii+1*BLOCKS_NUM+jj+1]=loose_matrix[i*14+j]; color_matrix[ii+1*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
draw_field(); draw_field();
//Pause(5); //Pause(5);
} }