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