1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * ©1995 Artsoft Development *
6 * 33659 Bielefeld-Senne *
7 * Telefon: (0521) 493245 *
8 * eMail: aeglos@valinor.owl.de *
9 * aeglos@uni-paderborn.de *
10 * q99492@pbhrzx.uni-paderborn.de *
11 *----------------------------------------------------------*
13 ***********************************************************/
30 int x1 = SX+(SXSIZE - strlen(GAMETITLE_STRING) * FONT1_XSIZE) / 2;
32 int x2 = SX+(SXSIZE - strlen(COPYRIGHT_STRING) * FONT2_XSIZE) / 2;
35 DrawText(x1,y1, GAMETITLE_STRING, FS_BIG,FC_YELLOW);
36 DrawText(x2,y2, COPYRIGHT_STRING, FS_SMALL,FC_RED);
49 DrawText(SX+32, SY+64, "Name:",FS_BIG,FC_GREEN);
50 DrawText(SX+192,SY+64, player.alias_name,FS_BIG,FC_RED);
51 DrawText(SX+32, SY+96, "Level:",FS_BIG,FC_GREEN);
52 DrawText(SX+352,SY+96, int2str(level_nr,3),FS_BIG,
53 (level_nr<leveldir[leveldir_nr].levels ? FC_RED : FC_YELLOW));
54 DrawText(SX+32, SY+128,"Hall Of Fame",FS_BIG,FC_GREEN);
55 DrawText(SX+32, SY+160,"Level Creator",FS_BIG,FC_GREEN);
56 DrawText(SY+32, SY+192,"Info Screen",FS_BIG,FC_GREEN);
57 DrawText(SX+32, SY+224,"Start Game",FS_BIG,FC_GREEN);
58 DrawText(SX+32, SY+256,"Setup",FS_BIG,FC_GREEN);
59 DrawText(SX+32, SY+288,"Quit",FS_BIG,FC_GREEN);
61 DrawMicroLevel(MICROLEV_XPOS,MICROLEV_YPOS);
64 DrawGraphic(0,i,GFX_KUGEL_BLAU);
65 DrawGraphic(10,3,GFX_PFEIL_L);
66 DrawGraphic(14,3,GFX_PFEIL_R);
68 DrawText(SX+54+16,SY+326,"A Game by Artsoft Development",FS_SMALL,FC_BLUE);
69 DrawText(SX+40+16,SY+344,"Graphics: Deluxe Paint IV Amiga",
71 DrawText(SX+60+16,SY+362,"Sounds: AudioMaster IV Amiga",
76 HandleMainMenu(0,0,0,0,MB_MENU_INITIALIZE);
79 if (TAPE_IS_EMPTY(tape))
80 LoadLevelTape(level_nr);
81 DrawCompleteVideoDisplay();
83 OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
86 XAutoRepeatOn(display);
89 void HandleMainMenu(int mx, int my, int dx, int dy, int button)
91 static int choice = 3;
92 static int redraw = TRUE;
93 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
95 if (redraw || button == MB_MENU_INITIALIZE)
97 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
101 if (button == MB_MENU_INITIALIZE)
108 x = (dx<0 ? 11 : 15);
125 if (!mx && !my && !dx && !dy)
131 if (y==4 && ((x==11 && level_nr>0) ||
132 (x==15 && level_nr<leveldir[leveldir_nr].levels)) &&
135 static long level_delay = 0;
136 int step = (button==1 ? 1 : button==2 ? 5 : 10);
137 int new_level_nr, old_level_nr = level_nr;
139 new_level_nr = level_nr + (x==11 ? -step : +step);
142 if (new_level_nr>leveldir[leveldir_nr].levels-1)
143 new_level_nr = leveldir[leveldir_nr].levels-1;
145 if (old_level_nr==new_level_nr || !DelayReached(&level_delay,15))
148 level_nr = new_level_nr;
150 if (level_nr>player.handicap)
151 level_nr = player.handicap;
153 DrawTextExt(drawto,gc,SX+352,SY+96, int2str(level_nr,3), FS_BIG,FC_RED);
154 DrawTextExt(window,gc,SX+352,SY+96, int2str(level_nr,3), FS_BIG,FC_RED);
157 DrawMicroLevel(MICROLEV_XPOS,MICROLEV_YPOS);
160 LoadLevelTape(level_nr);
161 DrawCompleteVideoDisplay();
163 /* needed because DrawMicroLevel() takes some time */
165 XSync(display,FALSE);
166 DelayReached(&level_delay,0); /* reset delay counter */
168 else if (x==1 && y>=3 && y<=10)
174 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
175 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
183 game_status = TYPENAME;
184 HandleTypeName(strlen(player.alias_name),0);
190 game_status = CHOOSELEVEL;
191 SavePlayerInfo(PLAYER_LEVEL);
197 game_status = HALLOFFAME;
202 game_status = LEVELED;
203 if (leveldir[leveldir_nr].readonly)
204 AreYouSure("This level is read only !",AYS_CONFIRM);
209 game_status = HELPSCREEN;
215 TapeStartRecording();
217 game_status = PLAYING;
227 SavePlayerInfo(PLAYER_LEVEL);
228 if (AreYouSure("Do you really want to quit ?",AYS_ASK|AYS_STAY_CLOSED))
229 game_status = EXITGAME;
240 if (game_status==MAINMENU)
244 #define MAX_HELPSCREEN_ELS 10
248 static long helpscreen_state;
249 static int helpscreen_step[MAX_HELPSCREEN_ELS];
250 static int helpscreen_frame[MAX_HELPSCREEN_ELS];
251 static int helpscreen_delay[MAX_HELPSCREEN_ELS];
252 static int helpscreen_action[] =
254 GFX_SPIELER_DOWN,4,2,
256 GFX_SPIELER_LEFT,4,2,
257 GFX_SPIELER_RIGHT,4,2,
258 GFX_SPIELER_PUSH_LEFT,4,2,
259 GFX_SPIELER_PUSH_RIGHT,4,2, HA_NEXT,
260 GFX_ERDREICH,1,100, HA_NEXT,
261 GFX_LEERRAUM,1,100, HA_NEXT,
262 GFX_MORAST_LEER,1,100, HA_NEXT,
263 GFX_BETON,1,100, HA_NEXT,
264 GFX_MAUERWERK,1,100, HA_NEXT,
265 GFX_MAUER_R1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10,
266 GFX_MAUER_L1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, HA_NEXT,
267 GFX_UNSICHTBAR,1,100, HA_NEXT,
268 GFX_FELSBODEN,1,100, HA_NEXT,
269 GFX_CHAR_A,30,4, GFX_CHAR_AUSRUF,32,4, HA_NEXT,
270 GFX_EDELSTEIN,2,5, HA_NEXT,
271 GFX_DIAMANT,2,5, HA_NEXT,
272 GFX_EDELSTEIN_BD,2,5, HA_NEXT,
273 GFX_EDELSTEIN_GELB,2,5, GFX_EDELSTEIN_ROT,2,5,
274 GFX_EDELSTEIN_LILA,2,5, HA_NEXT,
275 GFX_FELSBROCKEN,4,5, HA_NEXT,
276 GFX_BOMBE,1,50, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
277 GFX_KOKOSNUSS,1,50, GFX_CRACKINGNUT,3,1, GFX_EDELSTEIN,1,10, HA_NEXT,
278 GFX_ERZ_EDEL,1,50, GFX_EXPLOSION,8,1, GFX_EDELSTEIN,1,10, HA_NEXT,
279 GFX_ERZ_DIAM,1,50, GFX_EXPLOSION,8,1, GFX_DIAMANT,1,10, HA_NEXT,
280 GFX_ERZ_EDEL_BD,1,50, GFX_EXPLOSION,8,1,GFX_EDELSTEIN_BD,1,10,HA_NEXT,
281 GFX_ERZ_EDEL_GELB,1,50, GFX_EXPLOSION,8,1,
282 GFX_EDELSTEIN_GELB,1,10, GFX_ERZ_EDEL_ROT,1,50,
283 GFX_EXPLOSION,8,1, GFX_EDELSTEIN_ROT,1,10,
284 GFX_ERZ_EDEL_LILA,1,50, GFX_EXPLOSION,8,1,
285 GFX_EDELSTEIN_LILA,1,10, HA_NEXT,
286 GFX_GEBLUBBER,4,4, HA_NEXT,
287 GFX_SCHLUESSEL1,4,25, HA_NEXT,
288 GFX_PFORTE1,4,25, HA_NEXT,
289 GFX_PFORTE1X,4,25, HA_NEXT,
290 GFX_DYNAMIT_AUS,1,100, HA_NEXT,
291 GFX_DYNAMIT,7,6, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
292 GFX_DYNABOMB+0,4,3, GFX_DYNABOMB+3,1,3, GFX_DYNABOMB+2,1,3,
293 GFX_DYNABOMB+1,1,3, GFX_DYNABOMB+0,1,3, GFX_EXPLOSION,8,1,
294 GFX_LEERRAUM,1,10, HA_NEXT,
295 GFX_DYNABOMB_NR,1,100, HA_NEXT,
296 GFX_DYNABOMB_SZ,1,100, HA_NEXT,
297 GFX_FLIEGER+4,1,3, GFX_FLIEGER+0,1,3, GFX_FLIEGER+4,1,3,
298 GFX_FLIEGER+5,1,3, GFX_FLIEGER+1,1,3, GFX_FLIEGER+5,1,3,
299 GFX_FLIEGER+6,1,3, GFX_FLIEGER+2,1,3, GFX_FLIEGER+6,1,3,
300 GFX_FLIEGER+7,1,3, GFX_FLIEGER+3,1,3, GFX_FLIEGER+7,1,3, HA_NEXT,
301 GFX_KAEFER+4,1,1, GFX_KAEFER+0,1,1, GFX_KAEFER+4,1,1,
302 GFX_KAEFER+5,1,1, GFX_KAEFER+1,1,1, GFX_KAEFER+5,1,1,
303 GFX_KAEFER+6,1,1, GFX_KAEFER+2,1,1, GFX_KAEFER+6,1,1,
304 GFX_KAEFER+7,1,1, GFX_KAEFER+3,1,1, GFX_KAEFER+7,1,1, HA_NEXT,
305 GFX_BUTTERFLY,2,2, HA_NEXT,
306 GFX_FIREFLY,2,2, HA_NEXT,
307 GFX_PACMAN+0,1,3, GFX_PACMAN+4,1,2, GFX_PACMAN+0,1,3,
308 GFX_PACMAN+1,1,3, GFX_PACMAN+5,1,2, GFX_PACMAN+1,1,3,
309 GFX_PACMAN+2,1,3, GFX_PACMAN+6,1,2, GFX_PACMAN+2,1,3,
310 GFX_PACMAN+3,1,3, GFX_PACMAN+7,1,2, GFX_PACMAN+3,1,3, HA_NEXT,
311 GFX_MAMPFER+0,4,1, GFX_MAMPFER+3,1,1, GFX_MAMPFER+2,1,1,
312 GFX_MAMPFER+1,1,1, GFX_MAMPFER+0,1,1, HA_NEXT,
313 GFX_MAMPFER2+0,4,1, GFX_MAMPFER2+3,1,1, GFX_MAMPFER2+2,1,1,
314 GFX_MAMPFER2+1,1,1, GFX_MAMPFER2+0,1,1, HA_NEXT,
315 GFX_ROBOT+0,4,1, GFX_ROBOT+3,1,1, GFX_ROBOT+2,1,1,
316 GFX_ROBOT+1,1,1, GFX_ROBOT+0,1,1, HA_NEXT,
317 GFX_MAULWURF_DOWN,4,2,
319 GFX_MAULWURF_LEFT,4,2,
320 GFX_MAULWURF_RIGHT,4,2, HA_NEXT,
321 GFX_PINGUIN_DOWN,4,2,
323 GFX_PINGUIN_LEFT,4,2,
324 GFX_PINGUIN_RIGHT,4,2, HA_NEXT,
325 GFX_SCHWEIN_DOWN,4,2,
327 GFX_SCHWEIN_LEFT,4,2,
328 GFX_SCHWEIN_RIGHT,4,2, HA_NEXT,
332 GFX_DRACHE_RIGHT,4,2, HA_NEXT,
333 GFX_SONDE_START,8,1, HA_NEXT,
334 GFX_ABLENK,4,1, HA_NEXT,
335 GFX_BIRNE_AUS,1,25, GFX_BIRNE_EIN,1,25, HA_NEXT,
336 GFX_ZEIT_VOLL,1,25, GFX_ZEIT_LEER,1,25, HA_NEXT,
337 GFX_TROPFEN,1,25, GFX_AMOEBING,4,1, GFX_AMOEBE_LEBT,1,10, HA_NEXT,
338 GFX_AMOEBE_TOT+2,2,50, GFX_AMOEBE_TOT,2,50, HA_NEXT,
339 GFX_AMOEBE_LEBT,4,40, HA_NEXT,
340 GFX_AMOEBE_LEBT,1,10, GFX_AMOEBING,4,2, HA_NEXT,
341 GFX_AMOEBE_LEBT,1,25, GFX_AMOEBE_TOT,1,25, GFX_EXPLOSION,8,1,
342 GFX_DIAMANT,1,10, HA_NEXT,
343 GFX_LIFE,1,100, HA_NEXT,
344 GFX_LIFE_ASYNC,1,100, HA_NEXT,
345 GFX_SIEB_LEER,4,2, HA_NEXT,
346 GFX_SIEB2_LEER,4,2, HA_NEXT,
347 GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2,
348 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
349 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
350 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
351 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
354 static char *helpscreen_eltext[][2] =
356 {"THE HERO:", "(Is _this_ guy good old Rockford?)"},
357 {"Normal sand:", "You can dig through it"},
358 {"Empty field:", "You can walk through it"},
359 {"Quicksand: You cannot pass it,", "but rocks can fall though it"},
360 {"Massive Wall:", "Nothing can go through it"},
361 {"Normal Wall: You can't go through", "it, but you can bomb it away"},
362 {"Growing Wall: Grows to the left or", "right if there is an empty field"},
363 {"Invisible Wall: Behaves like normal","wall, but is invisible"},
364 {"Old Wall: Like normal wall, but", "some things can fall down from it"},
365 {"Letter Wall: Looks like a letter,", "behaves like a normal wall"},
366 {"Emerald: You must collect enough of","them to finish a level"},
367 {"Diamond: Counts as 3 emeralds, but", "can be destroyed by rocks"},
368 {"Diamond (BD style): Counts like one","emerald and behaves a bit different"},
369 {"Colorful Gems:", "Seem to behave like Emeralds"},
370 {"Rock: Smashes several things;", "Can be moved by the player"},
371 {"Bomb: You can move it, but be", "careful when dropping it"},
372 {"Nut: Throw a rock on it to open it;","Each nut contains an emerald"},
373 {"Wall with an emerald inside:", "Bomb the wall away to get it"},
374 {"Wall with a diamond inside:", "Bomb the wall away to get it"},
375 {"Wall with BD style diamond inside:", "Bomb the wall away to get it"},
376 {"Wall with colorful gem inside:", "Bomb the wall away to get it"},
377 {"Acid: Things that fall in are gone", "forever (including our hero)"},
378 {"Key: Opens the door that has the", "same color (red/yellow/green/blue)"},
379 {"Door: Can be opened by the key", "with the same color"},
380 {"Door: You have to find out the", "right color of the key for it"},
381 {"Dynamite: Collect it and use it to", "destroy walls or kill enemies"},
382 {"Dynamite: This one explodes after", "a few seconds"},
383 {"Dyna Bomb: Explodes in 4 directions","with variable explosion size"},
384 {"Dyna Bomb: Increases the number of", "dyna bombs available at a time"},
385 {"Dyna Bomb: Increases the size of", "explosion of dyna bombs"},
386 {"Spaceship: Moves at the left side", "of walls; don't touch it!"},
387 {"Bug: Moves at the right side", "of walls; don't touch it!"},
388 {"Butterfly: Moves at the right side", "of walls; don't touch it!"},
389 {"Firefly: Moves at the left side", "of walls; don't touch it!"},
390 {"Pacman: Eats the amoeba and you,", "if you're not careful"},
391 {"Cruncher: Eats diamonds and you,", "if you're not careful"},
392 {"Cruncher (BD style):", "Eats almost everything"},
393 {"Robot: Tries to kill the player", ""},
394 {"The mole: You must guide him savely","to the exit; he will follow you"},
395 {"The penguin: Guide him to the exit,","but keep him away from monsters!"},
396 {"The Pig: Harmless, but eats all", "gems it can get"},
397 {"The Dragon: Breathes fire,", "especially to some monsters"},
398 {"Sonde: Follows you everywhere;", "harmless, but may block your way"},
399 {"Magic Wheel: Touch it to get rid of","the robots for some seconds"},
400 {"Light Bulb: All of them must be", "switched on to finish a level"},
401 {"Extra Time Orb: Adds some seconds", "to the time available for the level"},
402 {"Amoeba Drop: Grows to an amoeba on", "the ground - don't touch it"},
403 {"Dead Amoeba: Does not grow, but", "can still kill bugs and spaceships"},
404 {"Normal Amoeba: Grows through empty", "fields, sand and quicksand"},
405 {"Dropping Amoeba: This one makes", "drops that grow to a new amoeba"},
406 {"Living Amoeba (BD style): Contains", "other element, when surrounded"},
407 {"Game Of Life: Behaves like the well","known 'Game Of Life' (2333 style)"},
408 {"Biomaze: A bit like the 'Game Of", "Life', but builds crazy mazes"},
409 {"Magic Wall: Changes rocks, emeralds","and diamonds when they pass it"},
410 {"Magic Wall (BD style):", "Changes rocks and BD style diamonds"},
411 {"Exit door: Opens if you have enough","emeralds to finish the level"},
412 {"Open exit door: Enter here to leave","the level and exit the actual game"},
414 static int num_helpscreen_els = sizeof(helpscreen_eltext)/(2*sizeof(char *));
416 static char *helpscreen_music[][3] =
418 { "Alchemy", "Ian Boddy", "Drive" },
419 { "The Chase", "Propaganda", "A Secret Wish" },
420 { "Network 23", "Tangerine Dream", "Exit" },
421 { "Czardasz", "Robert Pieculewicz", "Czardasz" },
422 { "21st Century Common Man", "Tangerine Dream", "Tyger" },
423 { "Voyager", "The Alan Parsons Project","Pyramid" },
424 { "Twilight Painter", "Tangerine Dream", "Heartbreakers" }
426 static int helpscreen_musicpos;
428 void DrawHelpScreenElAction(int start)
432 int xstart = SX+16, ystart = SY+64+2*32, ystep = TILEY+4;
434 while(helpscreen_action[j] != HA_END)
436 if (i>=start+MAX_HELPSCREEN_ELS || i>=num_helpscreen_els)
438 else if (i<start || helpscreen_delay[i-start])
440 if (i>=start && helpscreen_delay[i-start])
441 helpscreen_delay[i-start]--;
443 while(helpscreen_action[j] != HA_NEXT)
450 j += 3*helpscreen_step[i-start];
451 graphic = helpscreen_action[j++];
453 if (helpscreen_frame[i-start])
455 frame = helpscreen_action[j++] - helpscreen_frame[i-start];
456 helpscreen_frame[i-start]--;
461 helpscreen_frame[i-start] = helpscreen_action[j++]-1;
464 helpscreen_delay[i-start] = helpscreen_action[j++] - 1;
466 if (helpscreen_action[j] == HA_NEXT)
468 if (!helpscreen_frame[i-start])
469 helpscreen_step[i-start] = 0;
473 if (!helpscreen_frame[i-start])
474 helpscreen_step[i-start]++;
475 while(helpscreen_action[j] != HA_NEXT)
480 DrawGraphicExtHiRes(drawto,gc,xstart,ystart+(i-start)*ystep,
492 void DrawHelpScreenElText(int start)
495 int xstart = SX+56, ystart = SY+65+2*32, ystep = TILEY+4;
496 char text[FULL_SXSIZE/FONT2_XSIZE+10];
501 sprintf(text,"The game elements:");
502 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
503 text,FS_SMALL,FC_GREEN);
505 for(i=start;i<start+MAX_HELPSCREEN_ELS && i<num_helpscreen_els;i++)
507 DrawText(xstart,ystart+(i-start)*ystep+(*helpscreen_eltext[i][1] ? 0 : 8),
508 helpscreen_eltext[i][0],FS_SMALL,FC_YELLOW);
509 DrawText(xstart,ystart+(i-start)*ystep+16,
510 helpscreen_eltext[i][1],FS_SMALL,FC_YELLOW);
513 sprintf(text,"Press any key or button for next page");
514 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
515 text,FS_SMALL,FC_BLUE);
518 void DrawHelpScreenMusicText(int num)
520 int ystart = 150, ystep = 30;
521 char text[FULL_SXSIZE/FONT2_XSIZE+10];
527 sprintf(text,"The game background music loops:");
528 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
529 text,FS_SMALL,FC_GREEN);
531 sprintf(text,"Excerpt from");
532 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
533 text,FS_SMALL,FC_YELLOW);
534 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][0],'\"');
535 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
536 text,FS_SMALL,FC_RED);
538 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
539 text,FS_SMALL,FC_YELLOW);
540 sprintf(text,"%s",helpscreen_music[num][1]);
541 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
542 text,FS_SMALL,FC_RED);
543 sprintf(text,"from the album");
544 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
545 text,FS_SMALL,FC_YELLOW);
546 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][2],'\"');
547 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+5*ystep,
548 text,FS_SMALL,FC_RED);
550 sprintf(text,"Press any key or button for next page");
551 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
552 text,FS_SMALL,FC_BLUE);
554 PlaySoundLoop(background_loop[num]);
557 void DrawHelpScreenCreditsText()
559 int ystart = 150, ystep = 30;
560 char text[FULL_SXSIZE/FONT2_XSIZE+10];
566 sprintf(text,"Program information:");
567 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
568 text,FS_SMALL,FC_GREEN);
570 sprintf(text,"This game is Freeware!");
571 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
572 text,FS_SMALL,FC_YELLOW);
573 sprintf(text,"If you like it, send e-mail to:");
574 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
575 text,FS_SMALL,FC_YELLOW);
576 sprintf(text,"aeglos@valinor.owl.de");
577 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
578 text,FS_SMALL,FC_RED);
579 sprintf(text,"or SnailMail to:");
580 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
581 text,FS_SMALL,FC_YELLOW);
582 sprintf(text,"Holger Schemel");
583 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
584 text,FS_SMALL,FC_RED);
585 sprintf(text,"Sennehof 28");
586 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+20,
587 text,FS_SMALL,FC_RED);
588 sprintf(text,"33659 Bielefeld");
589 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+40,
590 text,FS_SMALL,FC_RED);
591 sprintf(text,"Germany");
592 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+60,
593 text,FS_SMALL,FC_RED);
595 sprintf(text,"If you have created new levels,");
596 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+7*ystep,
597 text,FS_SMALL,FC_YELLOW);
598 sprintf(text,"send them to me to include them!");
599 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+8*ystep,
600 text,FS_SMALL,FC_YELLOW);
602 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+9*ystep,
603 text,FS_SMALL,FC_YELLOW);
605 sprintf(text,"Press any key or button for main menu");
606 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
607 text,FS_SMALL,FC_BLUE);
610 void DrawHelpScreen()
614 CloseDoor(DOOR_CLOSE_2);
616 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
617 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
618 helpscreen_musicpos = 0;
619 helpscreen_state = 0;
620 DrawHelpScreenElText(0);
621 DrawHelpScreenElAction(0);
625 PlaySoundLoop(SND_RHYTHMLOOP);
628 void HandleHelpScreen(int button)
630 static long hs_delay = 0;
631 int num_helpscreen_els_pages =
632 (num_helpscreen_els + MAX_HELPSCREEN_ELS-1) / MAX_HELPSCREEN_ELS;
633 int button_released = !button;
638 if (helpscreen_state<num_helpscreen_els_pages-1)
640 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
641 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
643 DrawHelpScreenElText(helpscreen_state*MAX_HELPSCREEN_ELS);
644 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
646 else if (helpscreen_state<num_helpscreen_els_pages+num_bg_loops-1)
649 DrawHelpScreenMusicText(helpscreen_state-num_helpscreen_els_pages);
651 else if (helpscreen_state==num_helpscreen_els_pages+num_bg_loops-1)
654 DrawHelpScreenCreditsText();
660 game_status = MAINMENU;
665 if (DelayReached(&hs_delay,GAME_FRAME_DELAY))
667 if (helpscreen_state<num_helpscreen_els_pages)
668 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
678 int old_handicap = player.handicap;
680 if (!strcmp(player.alias_name,"Artsoft"))
681 player.handicap = leveldir[leveldir_nr].levels-1;
683 if (player.handicap != old_handicap)
685 SavePlayerInfo(PLAYER_LEVEL);
686 level_nr = player.handicap;
690 void HandleTypeName(int newxpos, KeySym key)
692 static int xpos = 0, ypos = 2;
698 DrawText(SX+6*32,SY+ypos*32,player.alias_name,FS_BIG,FC_YELLOW);
699 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
703 if ((key>=XK_A && key<=XK_Z) || (key>=XK_a && key<=XK_z &&
706 if (key>=XK_A && key<=XK_Z)
707 ascii = 'A'+(char)(key-XK_A);
708 if (key>=XK_a && key<=XK_z)
709 ascii = 'a'+(char)(key-XK_a);
710 player.alias_name[xpos] = ascii;
711 player.alias_name[xpos+1] = 0;
713 DrawTextExt(drawto,gc,SX+6*32,SY+ypos*32,
714 player.alias_name,FS_BIG,FC_YELLOW);
715 DrawTextExt(window,gc,SX+6*32,SY+ypos*32,
716 player.alias_name,FS_BIG,FC_YELLOW);
717 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
719 else if ((key==XK_Delete || key==XK_BackSpace) && xpos>0)
722 player.alias_name[xpos] = 0;
723 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
724 DrawGraphic(xpos+7,ypos,GFX_LEERRAUM);
726 else if (key==XK_Return && xpos>0)
728 DrawText(SX+6*32,SY+ypos*32,player.alias_name,FS_BIG,FC_RED);
729 DrawGraphic(xpos+6,ypos,GFX_LEERRAUM);
730 SavePlayerInfo(PLAYER_SETUP);
733 game_status = MAINMENU;
742 void DrawChooseLevel()
746 CloseDoor(DOOR_CLOSE_2);
749 DrawText(SX,SY,"Level Directories",FS_BIG,FC_GREEN);
750 for(i=0;i<num_leveldirs;i++)
752 DrawText(SX+32,SY+(i+2)*32,leveldir[i].name,FS_BIG,FC_YELLOW);
753 DrawGraphic(0,i+2,GFX_KUGEL_BLAU);
758 HandleChooseLevel(0,0,0,0,MB_MENU_INITIALIZE);
761 void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
763 static int choice = 3;
764 static int redraw = TRUE;
765 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
767 if (button == MB_MENU_INITIALIZE)
770 choice = leveldir_nr + 3;
775 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
779 if (button == MB_MENU_INITIALIZE)
794 else if (y>num_leveldirs+2)
798 if (!mx && !my && !dx && !dy)
804 if (x==1 && y>=3 && y<=num_leveldirs+2)
810 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
811 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
817 player.leveldir_nr = leveldir_nr = y-3;
818 LoadPlayerInfo(PLAYER_LEVEL);
819 SavePlayerInfo(PLAYER_SETUP);
823 LoadLevelTape(level_nr);
825 game_status = MAINMENU;
832 if (game_status==CHOOSELEVEL)
836 void DrawHallOfFame(int pos)
841 CloseDoor(DOOR_CLOSE_2);
846 DrawText(SX+64,SY+10,"Hall Of Fame",FS_BIG,FC_YELLOW);
847 sprintf(txt,"HighScores of Level %d",level_nr);
848 DrawText(SX+256-strlen(txt)*7,SY+48,txt,FS_SMALL,FC_RED);
849 for(y=0;y<MAX_SCORE_ENTRIES;y++)
851 DrawText(SX,SY+64+y*32,".................",FS_BIG,
852 (y==pos ? FC_RED : FC_GREEN));
853 DrawText(SX,SY+64+y*32,highscore[y].Name,FS_BIG,
854 (y==pos ? FC_RED : FC_GREEN));
855 DrawText(SX+12*32,SY+64+y*32,
856 int2str(highscore[y].Score,5),FS_BIG,
857 (y==pos ? FC_RED : FC_GREEN));
862 PlaySound(SND_HALLOFFAME);
865 void HandleHallOfFame(int button)
867 int button_released = !button;
871 FadeSound(SND_HALLOFFAME);
872 game_status = MAINMENU;
880 void DrawSetupScreen()
886 char *text, *mode[2];
890 {SETUP_SOUND, "Sound:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
891 {SETUP_SOUND_LOOPS, " Sound Loops:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
892 {SETUP_SOUND_MUSIC, " Game Music:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
893 {SETUP_TOONS, "Toons:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
894 {SETUP_DIRECT_DRAW, "Buffered gfx:",{"off","on" }, {FC_BLUE,FC_YELLOW}},
895 {SETUP_SCROLL_DELAY,"Scroll Delay:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
896 {SETUP_SOFT_SCROLL, "Soft Scroll.:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
897 {SETUP_FADING, "Fading:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
898 {SETUP_QUICK_DOORS, "Quick Doors:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
899 {SETUP_AUTO_RECORD, "Auto-Record:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
900 {SETUP_2ND_JOYSTICK,"Joystick:", {"2nd","1st"}, {FC_YELLOW,FC_YELLOW}},
901 {0, "Cal. Joystick",{"", ""}, {0,0}},
902 {0, "", {"", ""}, {0,0}},
903 {0, "Exit", {"", ""}, {0,0}},
904 {0, "Save and exit",{"", ""}, {0,0}}
907 CloseDoor(DOOR_CLOSE_2);
909 DrawText(SX+16, SY+16, "SETUP",FS_BIG,FC_YELLOW);
911 for(i=SETUP_SCREEN_POS_START;i<=SETUP_SCREEN_POS_END;i++)
913 int base = i - SETUP_SCREEN_POS_START;
915 if (i != SETUP_SCREEN_POS_EMPTY)
917 DrawGraphic(0,i,GFX_KUGEL_BLAU);
918 DrawText(SX+32,SY+i*32, setup[base].text, FS_BIG,FC_GREEN);
921 if (i < SETUP_SCREEN_POS_EMPTY)
923 int setting_bit = setup[base].bit;
924 int setting_pos = ((player.setup & setting_bit) != 0 ? 0 : 1);
925 DrawText(SX+14*32, SY+i*32,setup[base].mode[setting_pos],
926 FS_BIG,setup[base].color[setting_pos]);
932 HandleSetupScreen(0,0,0,0,MB_MENU_INITIALIZE);
935 void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
937 static int choice = 3;
938 static int redraw = TRUE;
939 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
940 int pos_start = SETUP_SCREEN_POS_START + 1;
941 int pos_empty = SETUP_SCREEN_POS_EMPTY + 1;
942 int pos_end = SETUP_SCREEN_POS_END + 1;
944 if (button == MB_MENU_INITIALIZE)
949 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
953 if (button == MB_MENU_INITIALIZE)
967 y = (dy>0 ? pos_empty+1 : pos_empty-1);
971 else if (y > pos_end)
975 if (!mx && !my && !dx && !dy)
981 if (x==1 && y>=pos_start && y<=pos_end && y!=pos_empty)
987 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
988 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
996 if (y==3 && sound_status==SOUND_AVAILABLE)
998 if (SETUP_SOUND_ON(player.setup))
1000 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1001 DrawText(SX+14*32, SY+(yy+1)*32,"off",FS_BIG,FC_BLUE);
1002 DrawText(SX+14*32, SY+(yy+2)*32,"off",FS_BIG,FC_BLUE);
1003 player.setup &= ~SETUP_SOUND_LOOPS;
1004 player.setup &= ~SETUP_SOUND_MUSIC;
1007 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1008 player.setup ^= SETUP_SOUND;
1010 else if (y==4 && sound_loops_allowed)
1012 if (SETUP_SOUND_LOOPS_ON(player.setup))
1013 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1016 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1017 DrawText(SX+14*32, SY+(yy-1)*32,"on ",FS_BIG,FC_YELLOW);
1018 player.setup |= SETUP_SOUND;
1020 player.setup ^= SETUP_SOUND_LOOPS;
1022 else if (y==5 && sound_loops_allowed)
1024 if (SETUP_SOUND_MUSIC_ON(player.setup))
1025 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1028 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1029 DrawText(SX+14*32, SY+(yy-2)*32,"on ",FS_BIG,FC_YELLOW);
1030 player.setup |= SETUP_SOUND;
1032 player.setup ^= SETUP_SOUND_MUSIC;
1036 if (SETUP_TOONS_ON(player.setup))
1037 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1039 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1040 player.setup ^= SETUP_TOONS;
1044 if (!SETUP_DIRECT_DRAW_ON(player.setup))
1045 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1047 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1048 player.setup ^= SETUP_DIRECT_DRAW;
1052 if (SETUP_SCROLL_DELAY_ON(player.setup))
1053 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1055 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1056 player.setup ^= SETUP_SCROLL_DELAY;
1060 if (SETUP_SOFT_SCROLL_ON(player.setup))
1061 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1063 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1064 player.setup ^= SETUP_SOFT_SCROLL;
1068 if (SETUP_FADING_ON(player.setup))
1069 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1071 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1072 player.setup ^= SETUP_FADING;
1076 if (SETUP_QUICK_DOORS_ON(player.setup))
1077 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1079 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1080 player.setup ^= SETUP_QUICK_DOORS;
1084 if (SETUP_AUTO_RECORD_ON(player.setup))
1085 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1087 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1088 player.setup ^= SETUP_AUTO_RECORD;
1092 if (SETUP_2ND_JOYSTICK_ON(player.setup))
1093 DrawText(SX+14*32, SY+yy*32,"1st",FS_BIG,FC_YELLOW);
1095 DrawText(SX+14*32, SY+yy*32,"2nd",FS_BIG,FC_YELLOW);
1096 player.setup ^= SETUP_2ND_JOYSTICK;
1100 CalibrateJoystick();
1103 else if (y==pos_end-1 || y==pos_end)
1107 SavePlayerInfo(PLAYER_SETUP);
1111 game_status = MAINMENU;
1119 if (game_status==SETUP)
1123 void CalibrateJoystick()
1126 struct joystick joy_ctrl;
1128 struct joystick_control
1136 int new_joystick_xleft, new_joystick_xright, new_joystick_xmiddle;
1137 int new_joystick_yupper, new_joystick_ylower, new_joystick_ymiddle;
1139 if (joystick_status==JOYSTICK_OFF)
1143 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1144 DrawText(SX+16, SY+8*32, " THE UPPER LEFT ",FS_BIG,FC_YELLOW);
1145 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1149 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1151 joy_ctrl.buttons = 0;
1153 while(Joystick() & JOY_BUTTON);
1155 while(!(joy_ctrl.b1||joy_ctrl.b2))
1157 while(!joy_ctrl.buttons)
1160 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1162 joystick_status=JOYSTICK_OFF;
1168 new_joystick_xleft = joy_ctrl.x;
1169 new_joystick_yupper = joy_ctrl.y;
1172 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1173 DrawText(SX+32, SY+8*32, "THE LOWER RIGHT",FS_BIG,FC_YELLOW);
1174 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1178 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1180 joy_ctrl.buttons = 0;
1182 while(Joystick() & JOY_BUTTON);
1184 while(!(joy_ctrl.b1||joy_ctrl.b2))
1186 while(!joy_ctrl.buttons)
1189 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1191 joystick_status=JOYSTICK_OFF;
1197 new_joystick_xright = joy_ctrl.x;
1198 new_joystick_ylower = joy_ctrl.y;
1201 DrawText(SX+32, SY+16+7*32, "CENTER JOYSTICK",FS_BIG,FC_YELLOW);
1202 DrawText(SX+16, SY+16+8*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1206 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1208 joy_ctrl.buttons = 0;
1210 while(Joystick() & JOY_BUTTON);
1212 while(!(joy_ctrl.b1||joy_ctrl.b2))
1214 while(!joy_ctrl.buttons)
1217 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1219 joystick_status=JOYSTICK_OFF;
1225 new_joystick_xmiddle = joy_ctrl.x;
1226 new_joystick_ymiddle = joy_ctrl.y;
1228 joystick[joystick_nr].xleft = new_joystick_xleft;
1229 joystick[joystick_nr].yupper = new_joystick_yupper;
1230 joystick[joystick_nr].xright = new_joystick_xright;
1231 joystick[joystick_nr].ylower = new_joystick_ylower;
1232 joystick[joystick_nr].xmiddle = new_joystick_xmiddle;
1233 joystick[joystick_nr].ymiddle = new_joystick_ymiddle;
1235 CheckJoystickData();
1238 while(Joystick() & JOY_BUTTON);
1244 DrawText(SX+16, SY+16, "NO JOYSTICK",FS_BIG,FC_YELLOW);
1245 DrawText(SX+16, SY+48, " AVAILABLE ",FS_BIG,FC_YELLOW);
1250 void HandleGameActions()
1252 if (game_status != PLAYING)
1258 if (PlayerGone && !TAPE_IS_STOPPED(tape))
1264 void HandleVideoButtons(int mx, int my, int button)
1266 if (game_status != MAINMENU && game_status != PLAYING)
1269 switch(CheckVideoButtons(mx,my,button))
1271 case BUTTON_VIDEO_EJECT:
1273 if (TAPE_IS_EMPTY(tape))
1275 LoadLevelTape(level_nr);
1276 if (TAPE_IS_EMPTY(tape))
1277 AreYouSure("No tape for this level !",AYS_CONFIRM);
1282 SaveLevelTape(tape.level_nr);
1285 DrawCompleteVideoDisplay();
1287 case BUTTON_VIDEO_STOP:
1290 case BUTTON_VIDEO_PAUSE:
1293 case BUTTON_VIDEO_REC:
1294 if (TAPE_IS_STOPPED(tape))
1296 TapeStartRecording();
1297 game_status = PLAYING;
1300 else if (tape.pausing)
1302 if (tape.playing) /* PLAYING -> PAUSING -> RECORDING */
1304 tape.pos[tape.counter].delay = tape.delay_played;
1305 tape.playing = FALSE;
1306 tape.recording = TRUE;
1307 tape.changed = TRUE;
1309 DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON,0);
1315 case BUTTON_VIDEO_PLAY:
1316 if (TAPE_IS_EMPTY(tape))
1319 if (TAPE_IS_STOPPED(tape))
1322 game_status = PLAYING;
1325 else if (tape.playing)
1327 if (tape.pausing) /* PAUSE -> PLAY */
1329 else if (!tape.fast_forward) /* PLAY -> FAST FORWARD PLAY */
1331 tape.fast_forward = TRUE;
1332 DrawVideoDisplay(VIDEO_STATE_FFWD_ON, 0);
1334 else if (!tape.pause_before_death) /* FFWD PLAY -> + AUTO PAUSE */
1336 tape.pause_before_death = TRUE;
1337 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, VIDEO_DISPLAY_LABEL_ONLY);
1339 else /* -> NORMAL PLAY */
1341 tape.fast_forward = FALSE;
1342 tape.pause_before_death = FALSE;
1343 DrawVideoDisplay(VIDEO_STATE_FFWD_OFF | VIDEO_STATE_PAUSE_OFF, 0);
1354 void HandleSoundButtons(int mx, int my, int button)
1356 if (game_status != PLAYING)
1359 switch(CheckSoundButtons(mx,my,button))
1361 case BUTTON_SOUND_MUSIC:
1364 sound_music_on = FALSE;
1365 player.setup &= ~SETUP_SOUND_MUSIC;
1366 FadeSound(background_loop[level_nr % num_bg_loops]);
1367 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1369 else if (sound_loops_allowed)
1371 sound_on = sound_music_on = TRUE;
1372 player.setup |= (SETUP_SOUND | SETUP_SOUND_MUSIC);
1373 PlaySoundLoop(background_loop[level_nr % num_bg_loops]);
1374 DrawSoundDisplay(BUTTON_SOUND_MUSIC_ON);
1377 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1379 case BUTTON_SOUND_LOOPS:
1382 sound_loops_on = FALSE;
1383 player.setup &= ~SETUP_SOUND_LOOPS;
1384 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1386 else if (sound_loops_allowed)
1388 sound_on = sound_loops_on = TRUE;
1389 player.setup |= (SETUP_SOUND | SETUP_SOUND_LOOPS);
1390 DrawSoundDisplay(BUTTON_SOUND_LOOPS_ON);
1393 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1395 case BUTTON_SOUND_SIMPLE:
1396 if (sound_simple_on)
1398 sound_simple_on = FALSE;
1399 player.setup &= ~SETUP_SOUND;
1400 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1402 else if (sound_status==SOUND_AVAILABLE)
1404 sound_on = sound_simple_on = TRUE;
1405 player.setup |= SETUP_SOUND;
1406 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_ON);
1409 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1418 void HandleGameButtons(int mx, int my, int button)
1420 if (game_status != PLAYING)
1423 switch(CheckGameButtons(mx,my,button))
1425 case BUTTON_GAME_STOP:
1428 CloseDoor(DOOR_CLOSE_1);
1429 game_status = MAINMENU;
1434 if (AreYouSure("Do you really want to quit the game ?",
1435 AYS_ASK | AYS_STAY_CLOSED))
1437 game_status = MAINMENU;
1441 OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
1443 case BUTTON_GAME_PAUSE:
1446 tape.pausing = FALSE;
1447 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);
1451 tape.pausing = TRUE;
1452 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON,0);
1455 case BUTTON_GAME_PLAY:
1458 tape.pausing = FALSE;
1459 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);