Subversion Repositories Kolibri OS

Rev

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

Rev 6996 Rev 6997
Line 23... Line 23...
23
libimg_image road;
23
libimg_image road;
24
libimg_image objects;
24
libimg_image objects;
Line 25... Line 25...
25
 
25
 
Line 26... Line 26...
26
int frame_timeout = 1;
26
int frame_timeout = 1;
27
 
27
 
28
int lives=0, level=0, score=0;
28
int lifes=0, level=0, score=0;
29
int don_x, don_y, don_h, don_w=68, don_type, don_image_y, don_step_y, don_step_y_default=3;
29
int don_x, don_y, don_h, don_w=68, don_type, don_image_y, don_step_y, don_step_y_default=3;
Line 30... Line 30...
30
int don_h_mas[8] = { 36,72,36,74,24,64,48,74 };
30
int don_h_mas[8] = { 36,72,36,74,24,64,48,74 };
Line 52... Line 52...
52
‚«¥¢®/‚¯à ¢® ¨«¨ à®¡¥«
52
‚«¥¢®/‚¯à ¢® ¨«¨ à®¡¥«
53
Š« ¢¨è  P áâ ¢¨â ­  ¯ ã§ã'tI"
53
Š« ¢¨è  P áâ ¢¨â ­  ¯ ã§ã'tI"
54
#define ABOUT_TEXT "'Œ àèàã⪠
54
#define ABOUT_TEXT "'Œ àèàã⪠
55
‚¥àá¨ï v1.01
55
‚¥àá¨ï v1.01
Line 56... Line 56...
56
 
56
 
57
‘ë£à ©â¥ §  ¤¥à᪮£® ¬ àèàãâ稪 , 
57
‘ë£à ©â¥ §  ¤¥à§ª®£® ¬ àèàãâ稪 , 
58
ª®â®àë© ­¥á¥âáï ¤®¬®© ¯®á«¥ ᬥ­ë.
58
ª®â®àë© ­¥á¥âáï ¤®¬®© ¯®á«¥ ᬥ­ë.
59
Ž­ 㦥 ¢ê¥¡ « àåã á ¬ã¦¨ª ¬¨ 
59
Ž­ 㦥 ¢ê¥¡ « àåã á ¬ã¦¨ª ¬¨ 
Line 60... Line 60...
60
¨ ⥯¥àì ¥£® ­¨çâ® ­¥ ®áâ ­®¢¨â!
60
¨ ⥯¥àì ¥£® ­¨çâ® ­¥ ®áâ ­®¢¨â!
61
 
61
 
62
€¢â®à Leency
62
€¢â®à Leency
63
Š à⨭ª  ¢ ¬¥­î Freepik.com'tI"
63
Š à⨭ª  ¢ ¬¥­î Freepik.com'tI"
64
#define PAUSE_TEXT "€“‡€"
64
#define PAUSE_TEXT "€“‡€"
65
#define GAME_OVER_TEXT "ˆ£à  ®ª®­ç¥­ "
65
#define GAME_OVER_TEXT "ˆ£à  ®ª®­ç¥­ "
66
#define FINAL_SCORE_TEXT "”¨­ «ì­ë© áç¥â"
66
#define FINAL_SCORE_TEXT "”¨­ «ì­ë© áç¥â"
67
#define LIVES_TEXT "†¨§­¨"
67
#define LIFES_TEXT "†¨§­¨"
68
#define LEVEL_TEXT "“஢¥­ì"
68
#define LEVEL_TEXT "“஢¥­ì"
69
#define SCORE_TEXT "‘ç¥â"
69
#define SCORE_TEXT "‘ç¥â"
70
char *MENU_LIST[]={
70
char *MENU_LIST[]={
Line 84... Line 84...
84
Author: Leency
84
Author: Leency
85
Menu image from Freepik.com'tI"
85
Menu image from Freepik.com'tI"
86
#define PAUSE_TEXT "PAUSE"
86
#define PAUSE_TEXT "PAUSE"
87
#define GAME_OVER_TEXT "GAME OVER"
87
#define GAME_OVER_TEXT "GAME OVER"
88
#define FINAL_SCORE_TEXT "Final Score"
88
#define FINAL_SCORE_TEXT "Final Score"
89
#define LIVES_TEXT "Lives"
89
#define LIFES_TEXT "Lifes"
90
#define LEVEL_TEXT "Level"
90
#define LEVEL_TEXT "Level"
91
#define SCORE_TEXT "Score"
91
#define SCORE_TEXT "Score"
92
char *MENU_LIST[]={
92
char *MENU_LIST[]={
93
"New game",
93
"New game",
94
"Control keys",
94
"Control keys",
Line 201... Line 201...
201
				
201
				
202
			default:
202
			default:
203
				if (screen_type==SCR_GAME) 
203
				if (screen_type==SCR_GAME) 
204
				{
204
				{
205
					if ((don_x == bus_x)&&(don_y + don_h > bus_y )&&(don_y < bus_y + don_h )) {
205
					if ((don_x == bus_x)&&(don_y + don_h > bus_y )&&(don_y < bus_y + don_h )) {
206
						lives--;
206
						lifes--;
207
						DrawBus(bus_x*80+200,bus_y);
207
						DrawBus(bus_x*80+200,bus_y);
208
						DrawBoom(bus_x*80+180,bus_y+10);
208
						DrawBoom(bus_x*80+180,bus_y+10);
209
						pause(150);
209
						pause(150);
210
						GetNewObstacle(RAND);
210
						GetNewObstacle(RAND);
211
						DrawScreen();
211
						DrawScreen();
Line 212... Line 212...
212
					}
212
					}
213
	
213
	
214
					if (lives==0) {
214
					if (lifes==0) {
215
						DrawGameOverMessage();
215
						DrawGameOverMessage();
Line 216... Line 216...
216
						break;
216
						break;
Line 247... Line 247...
247
	bus_y = bus_y_default;
247
	bus_y = bus_y_default;
248
}
248
}
Line 249... Line 249...
249
 
249
 
250
void StartNewGame()
250
void StartNewGame()
251
{
251
{
252
	lives=3;
252
	lifes=3;
253
	level=0;
253
	level=0;
254
	score=0;
254
	score=0;
255
	bus_y = bus_y_default;
255
	bus_y = bus_y_default;
256
	don_step_y = don_step_y_default;
256
	don_step_y = don_step_y_default;
Line 278... Line 278...
278
		DrawMenuList();
278
		DrawMenuList();
279
	}
279
	}
280
	if (screen_type==SCR_GAME) || (screen_type==SCR_PAUSE) 
280
	if (screen_type==SCR_GAME) || (screen_type==SCR_PAUSE) 
281
	{
281
	{
282
		DrawHighway();
282
		DrawHighway();
283
		WriteText(20, 20,  0x81, 0xFFFFFF, LIVES_TEXT);
283
		WriteText(20, 20,  0x81, 0xFFFFFF, LIFES_TEXT);
284
		WriteText(20, 46,  0x81, 0xFFFFFF, itoa(lives));
284
		WriteText(20, 46,  0x81, 0xFFFFFF, itoa(lifes));
285
		WriteText(20, 80,  0x81, 0xFFFFFF, LEVEL_TEXT);
285
		WriteText(20, 80,  0x81, 0xFFFFFF, LEVEL_TEXT);
286
		WriteText(20, 106, 0x81, 0xFFFFFF, itoa(level));
286
		WriteText(20, 106, 0x81, 0xFFFFFF, itoa(level));
287
		WriteScore();
287
		WriteScore();
288
		DrawRoad();
288
		DrawRoad();
289
		if (screen_type==SCR_PAUSE) {
289
		if (screen_type==SCR_PAUSE) {