Rev 1808 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
950 | leency | 1 | |
2 | #include "stdio.h" |
||
3 | #include "stdlib.h" |
||
4 | #include "string.h" |
||
5 | |||
6 | |||
7 | |||
8 | |||
9 | #include "car_02.h" |
||
10 | #include "donkey_01.h" |
||
11 | #include "donkey_02.h" |
||
12 | #include "az.h" |
||
13 | |||
14 | |||
15 | |||
16 | |||
17 | int dox, doy; |
||
18 | int drx, dry; |
||
19 | |||
20 | |||
21 | |||
22 | |||
23 | |||
24 | |||
25 | |||
26 | |||
27 | |||
28 | |||
29 | { |
||
30 | gb_image_set_t(&screen, x, y, &az, (c-'!')*11, 0, 11, 16, 0); |
||
31 | } |
||
32 | |||
33 | |||
34 | |||
35 | |||
36 | { |
||
37 | unsigned i; |
||
38 | i = 0; |
||
39 | while (*(s+i)) |
||
40 | { |
||
41 | az_putc(*(s+i), x+i*11, y); |
||
42 | i++; |
||
43 | } |
||
44 | |||
45 | |||
46 | |||
47 | |||
48 | |||
49 | |||
50 | { |
||
51 | drx = -1; |
||
52 | dry = 0; |
||
53 | doy = random(40)+130; |
||
54 | |||
55 | |||
56 | if (0 == dox) |
||
57 | dox--; |
||
58 | |||
59 | |||
60 | paintbg = 1; |
||
61 | |||
62 | |||
63 | |||
64 | |||
65 | } |
||
66 | |||
67 | |||
68 | |||
69 | { |
||
70 | |||
71 | |||
72 | |||
73 | |||
74 | gb_bar(&screen, 183, 6, 305-183, 195-6, 0x488888); |
||
75 | |||
76 | |||
77 | az_puts("Driver", 189, 30); |
||
78 | |||
79 | |||
80 | az_putc (drn/10+'0', 189, 48); |
||
81 | |||
82 | |||
83 | az_puts("Space Bar", 189, 116); |
||
84 | az_puts("Enter", 189, 132); |
||
85 | az_puts("Esc", 189, 148); |
||
86 | |||
87 | |||
88 | |||
89 | gb_line(&screen, 180, 0, 180, 199, 0xffffff); |
||
90 | |||
91 | |||
92 | } |
||
93 | |||
94 | |||
95 | |||
96 | |||
97 | { |
||
98 | |||
99 | |||
100 | |||
101 | |||
102 | { |
||
103 | screen_back(); |
||
104 | |||
105 | |||
106 | az_puts ("P A U S E", 5, 30); |
||
107 | az_puts ("Press Enter to continue", 5, 60); |
||
108 | |||
109 | |||
110 | kol_paint_image( 0, 0, 320, 200, screen.bmp); |
||
111 | |||
112 | |||
113 | return; |
||
114 | } |
||
115 | |||
116 | |||
117 | { |
||
118 | gb_bar(&screen, 0, 0, 320, 200, 0x880000); |
||
119 | az_puts ("G A M E O V E R", 5, 30); |
||
120 | |||
121 | |||
122 | kol_paint_image( 0, 0, 320, 200, screen.bmp); |
||
123 | |||
124 | |||
125 | game_start(); |
||
126 | start = 1; |
||
127 | } |
||
128 | |||
129 | |||
130 | { |
||
131 | gb_bar(&screen, 0, 0, 320, 200, 0x88); |
||
132 | az_puts ("CONGRATULATIONS !!!", 5, 30); |
||
133 | |||
134 | |||
135 | kol_paint_image( 0, 0, 320, 200, screen.bmp); |
||
136 | |||
137 | |||
138 | game_start(); |
||
139 | start = 1; |
||
140 | } |
||
141 | |||
142 | |||
143 | speed = 1; |
||
144 | |||
145 | |||
146 | speed = 2; |
||
147 | |||
148 | |||
149 | |||
150 | { |
||
151 | if (!paintbg) |
||
152 | return; |
||
153 | |||
154 | |||
155 | |||
156 | |||
157 | az_puts ("remake for KolibriOS", 5, 78); |
||
158 | az_puts ("by Albom", 5, 78+16); |
||
159 | |||
160 | |||
161 | az_puts ("to continue", 5, 156); |
||
162 | |||
163 | |||
164 | |||
165 | kol_paint_image( 0, 0, 320, 200, screen.bmp); |
||
166 | paintbg = 0; |
||
167 | return; |
||
168 | } |
||
169 | |||
170 | |||
171 | screen_back(); |
||
172 | else |
||
173 | gb_bar(&screen, 102, 0, 180-102, 200, 0x888888); |
||
174 | |||
175 | |||
176 | gb_line(&screen, 140, y-10*(doy%2), 140, y+10-10*(doy%2), 0xffffff); |
||
177 | |||
178 | |||
179 | if (doy < -50) |
||
180 | { |
||
181 | |||
182 | |||
183 | if (0 == dox) |
||
184 | dox--; |
||
185 | |||
186 | |||
187 | dry += 10; |
||
188 | drn++; |
||
189 | if (0 == drn%10) |
||
190 | dry = 0; |
||
191 | paintbg = 1; |
||
192 | } |
||
193 | |||
194 | |||
195 | { |
||
196 | don++; |
||
197 | dry = 0; |
||
198 | drn /= 10; |
||
199 | drn *= 10; |
||
200 | for (y = 0; y<2; y++) |
||
201 | { |
||
202 | kol_sleep(8); |
||
203 | screen_back(); |
||
204 | az_puts("BOOM!", 6, 120); |
||
205 | |||
206 | |||
207 | gb_image_set_t(&screen, 120+(y+3)*20, 120-dry+(y+1)*20, &car02, 0, 0, 13, 34, 0x888888); |
||
208 | |||
209 | |||
210 | gb_image_set_t(&screen, 140+(y+3)*20, 120-(y+1)*20, &donkey02, 0, 0, 13, 17, 0x888888); |
||
211 | |||
212 | |||
213 | kol_paint_image(0, 0, 320, 200, screen.bmp); |
||
214 | } |
||
215 | |||
216 | |||
217 | if (0 == dox) |
||
218 | dox--; |
||
219 | |||
220 | |||
221 | paintbg = 1; |
||
222 | } |
||
223 | |||
224 | |||
225 | gb_image_set_t(&screen, 140-drx*20, 130-dry, &car02, 0, 0, 13, 34, 0x888888); |
||
226 | |||
227 | |||
228 | gb_image_set_t(&screen, 140-dox*20, 130-doy, &donkey02, 0, 0, 13, 17, 0x888888); |
||
229 | |||
230 | |||
231 | kol_paint_image(0, 0, 320, 200, screen.bmp); |
||
232 | |||
233 | |||
234 | |||
235 | |||
236 | |||
237 | |||
238 | { |
||
239 | kol_paint_start(); |
||
240 | kol_wnd_define(280, 200, 328, 204+kol_skin_height(), 0x34888888); |
||
241 | kol_wnd_caption(STR_DONKEY); |
||
242 | screen_draw(); |
||
243 | kol_paint_end(); |
||
244 | } |
||
245 | |||
246 | |||
247 | |||
248 | |||
249 | |||
250 | { |
||
251 | |||
252 | |||
253 | unsigned key; |
||
254 | |||
255 | |||
256 | start = 1; |
||
257 | paintbg = 1; |
||
258 | |||
259 | |||
260 | |||
261 | |||
262 | |||
263 | |||
264 | screen.w = 320; |
||
265 | screen.h = 200; |
||
266 | |||
267 | |||
268 | car01.w = 13; |
||
269 | car01.h = 34; |
||
270 | |||
271 | |||
272 | car02.w = 13; |
||
273 | car02.h = 34; |
||
274 | |||
275 | |||
276 | donkey01.w = 17; |
||
277 | donkey01.h = 17; |
||
278 | |||
279 | |||
280 | donkey02.w = 13; |
||
281 | donkey02.h = 17; |
||
282 | |||
283 | |||
284 | az.w = 1012; |
||
285 | az.h = 16; |
||
286 | |||
287 | |||
288 | |||
289 | |||
290 | |||
291 | { |
||
292 | |||
293 | |||
294 | screen_draw(); |
||
295 | event = kol_event_check(); |
||
296 | |||
297 | |||
298 | { |
||
299 | case 1: |
||
300 | paintbg = 1; |
||
301 | wnd_draw(); |
||
302 | break; |
||
303 | |||
304 | |||
305 | key = (kol_key_get() & 0xff00)>>8; |
||
306 | if (start && (32==key)) |
||
307 | { |
||
308 | start = 0; |
||
309 | game_start(); |
||
310 | screen_draw(); |
||
311 | break; |
||
312 | } |
||
313 | |||
314 | |||
315 | { |
||
316 | if (-1 == pause) |
||
317 | break; |
||
318 | start = 1; |
||
319 | paintbg = 1; |
||
320 | break; |
||
321 | } |
||
322 | |||
323 | |||
324 | { |
||
325 | if (-1 == pause) |
||
326 | break; |
||
327 | drx *= -1; |
||
328 | screen_draw(); |
||
329 | } |
||
330 | |||
331 | |||
332 | { |
||
333 | pause *= -1; |
||
334 | screen_draw(); |
||
335 | } |
||
336 | |||
337 | |||
338 | |||
339 | |||
340 | |||
341 | if ( 1 == (kol_btn_get() & 0xff00)>>8 ) |
||
342 | kol_exit(); |
||
343 | break; |
||
344 | |||
345 | |||
346 | } |
||
347 | |||
348 | |||
349 | start><8); |