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 ***********************************************************/
29 extern unsigned char get_ascii(KeySym);
34 int x1 = SX+(SXSIZE - strlen(GAMETITLE_STRING) * FONT1_XSIZE) / 2;
36 int x2 = SX+(SXSIZE - strlen(COPYRIGHT_STRING) * FONT2_XSIZE) / 2;
39 DrawText(x1,y1, GAMETITLE_STRING, FS_BIG,FC_YELLOW);
40 DrawText(x2,y2, COPYRIGHT_STRING, FS_SMALL,FC_RED);
53 DrawText(SX+32, SY+64, "Name:",FS_BIG,FC_GREEN);
54 DrawText(SX+192,SY+64, player.alias_name,FS_BIG,FC_RED);
55 DrawText(SX+32, SY+96, "Level:",FS_BIG,FC_GREEN);
56 DrawText(SX+352,SY+96, int2str(level_nr,3),FS_BIG,
57 (level_nr<leveldir[leveldir_nr].levels ? FC_RED : FC_YELLOW));
58 DrawText(SX+32, SY+128,"Hall Of Fame",FS_BIG,FC_GREEN);
59 DrawText(SX+32, SY+160,"Level Creator",FS_BIG,FC_GREEN);
60 DrawText(SY+32, SY+192,"Info Screen",FS_BIG,FC_GREEN);
61 DrawText(SX+32, SY+224,"Start Game",FS_BIG,FC_GREEN);
62 DrawText(SX+32, SY+256,"Setup",FS_BIG,FC_GREEN);
63 DrawText(SX+32, SY+288,"Quit",FS_BIG,FC_GREEN);
65 DrawMicroLevel(MICROLEV_XPOS,MICROLEV_YPOS);
68 DrawGraphic(0,i,GFX_KUGEL_BLAU);
69 DrawGraphic(10,3,GFX_PFEIL_L);
70 DrawGraphic(14,3,GFX_PFEIL_R);
72 DrawText(SX+54+16,SY+326,"A Game by Artsoft Development",FS_SMALL,FC_BLUE);
73 DrawText(SX+40+16,SY+344,"Graphics: Deluxe Paint IV Amiga",
75 DrawText(SX+60+16,SY+362,"Sounds: AudioMaster IV Amiga",
80 HandleMainMenu(0,0,0,0,MB_MENU_INITIALIZE);
83 if (TAPE_IS_EMPTY(tape))
84 LoadLevelTape(level_nr);
85 DrawCompleteVideoDisplay();
87 OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
90 XAutoRepeatOn(display);
93 void HandleMainMenu(int mx, int my, int dx, int dy, int button)
95 static int choice = 3;
96 static int redraw = TRUE;
97 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
99 if (redraw || button == MB_MENU_INITIALIZE)
101 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
105 if (button == MB_MENU_INITIALIZE)
112 x = (dx<0 ? 11 : 15);
129 if (!mx && !my && !dx && !dy)
135 if (y==4 && ((x==11 && level_nr>0) ||
136 (x==15 && level_nr<leveldir[leveldir_nr].levels)) &&
139 static long level_delay = 0;
140 int step = (button==1 ? 1 : button==2 ? 5 : 10);
141 int new_level_nr, old_level_nr = level_nr;
143 new_level_nr = level_nr + (x==11 ? -step : +step);
146 if (new_level_nr>leveldir[leveldir_nr].levels-1)
147 new_level_nr = leveldir[leveldir_nr].levels-1;
149 if (old_level_nr==new_level_nr || !DelayReached(&level_delay,15))
152 level_nr = new_level_nr;
154 if (level_nr>player.handicap)
155 level_nr = player.handicap;
157 DrawTextExt(drawto,gc,SX+352,SY+96, int2str(level_nr,3), FS_BIG,FC_RED);
158 DrawTextExt(window,gc,SX+352,SY+96, int2str(level_nr,3), FS_BIG,FC_RED);
161 DrawMicroLevel(MICROLEV_XPOS,MICROLEV_YPOS);
164 LoadLevelTape(level_nr);
165 DrawCompleteVideoDisplay();
167 /* needed because DrawMicroLevel() takes some time */
169 XSync(display,FALSE);
170 DelayReached(&level_delay,0); /* reset delay counter */
172 else if (x==1 && y>=3 && y<=10)
178 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
179 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
187 game_status = TYPENAME;
188 HandleTypeName(strlen(player.alias_name),0);
194 game_status = CHOOSELEVEL;
195 SavePlayerInfo(PLAYER_LEVEL);
201 game_status = HALLOFFAME;
206 game_status = LEVELED;
207 if (leveldir[leveldir_nr].readonly)
208 AreYouSure("This level is read only !",AYS_CONFIRM);
213 game_status = HELPSCREEN;
219 TapeStartRecording();
221 game_status = PLAYING;
231 SavePlayerInfo(PLAYER_LEVEL);
232 if (AreYouSure("Do you really want to quit ?",AYS_ASK|AYS_STAY_CLOSED))
233 game_status = EXITGAME;
244 if (game_status==MAINMENU)
248 #define MAX_HELPSCREEN_ELS 10
252 static long helpscreen_state;
253 static int helpscreen_step[MAX_HELPSCREEN_ELS];
254 static int helpscreen_frame[MAX_HELPSCREEN_ELS];
255 static int helpscreen_delay[MAX_HELPSCREEN_ELS];
256 static int helpscreen_action[] =
258 GFX_SPIELER_DOWN,4,2,
260 GFX_SPIELER_LEFT,4,2,
261 GFX_SPIELER_RIGHT,4,2,
262 GFX_SPIELER_PUSH_LEFT,4,2,
263 GFX_SPIELER_PUSH_RIGHT,4,2, HA_NEXT,
264 GFX_ERDREICH,1,100, HA_NEXT,
265 GFX_LEERRAUM,1,100, HA_NEXT,
266 GFX_MORAST_LEER,1,100, HA_NEXT,
267 GFX_BETON,1,100, HA_NEXT,
268 GFX_MAUERWERK,1,100, HA_NEXT,
269 GFX_MAUER_R1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10,
270 GFX_MAUER_L1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, HA_NEXT,
271 GFX_UNSICHTBAR,1,100, HA_NEXT,
272 GFX_FELSBODEN,1,100, HA_NEXT,
273 GFX_CHAR_A,30,4, GFX_CHAR_AUSRUF,32,4, HA_NEXT,
274 GFX_EDELSTEIN,2,5, HA_NEXT,
275 GFX_DIAMANT,2,5, HA_NEXT,
276 GFX_EDELSTEIN_BD,2,5, HA_NEXT,
277 GFX_EDELSTEIN_GELB,2,5, GFX_EDELSTEIN_ROT,2,5,
278 GFX_EDELSTEIN_LILA,2,5, HA_NEXT,
279 GFX_FELSBROCKEN,4,5, HA_NEXT,
280 GFX_BOMBE,1,50, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
281 GFX_KOKOSNUSS,1,50, GFX_CRACKINGNUT,3,1, GFX_EDELSTEIN,1,10, HA_NEXT,
282 GFX_ERZ_EDEL,1,50, GFX_EXPLOSION,8,1, GFX_EDELSTEIN,1,10, HA_NEXT,
283 GFX_ERZ_DIAM,1,50, GFX_EXPLOSION,8,1, GFX_DIAMANT,1,10, HA_NEXT,
284 GFX_ERZ_EDEL_BD,1,50, GFX_EXPLOSION,8,1,GFX_EDELSTEIN_BD,1,10,HA_NEXT,
285 GFX_ERZ_EDEL_GELB,1,50, GFX_EXPLOSION,8,1,
286 GFX_EDELSTEIN_GELB,1,10, GFX_ERZ_EDEL_ROT,1,50,
287 GFX_EXPLOSION,8,1, GFX_EDELSTEIN_ROT,1,10,
288 GFX_ERZ_EDEL_LILA,1,50, GFX_EXPLOSION,8,1,
289 GFX_EDELSTEIN_LILA,1,10, HA_NEXT,
290 GFX_GEBLUBBER,4,4, HA_NEXT,
291 GFX_SCHLUESSEL1,4,25, HA_NEXT,
292 GFX_PFORTE1,4,25, HA_NEXT,
293 GFX_PFORTE1X,4,25, HA_NEXT,
294 GFX_DYNAMIT_AUS,1,100, HA_NEXT,
295 GFX_DYNAMIT,7,6, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
296 GFX_DYNABOMB+0,4,3, GFX_DYNABOMB+3,1,3, GFX_DYNABOMB+2,1,3,
297 GFX_DYNABOMB+1,1,3, GFX_DYNABOMB+0,1,3, GFX_EXPLOSION,8,1,
298 GFX_LEERRAUM,1,10, HA_NEXT,
299 GFX_DYNABOMB_NR,1,100, HA_NEXT,
300 GFX_DYNABOMB_SZ,1,100, HA_NEXT,
301 GFX_FLIEGER+4,1,3, GFX_FLIEGER+0,1,3, GFX_FLIEGER+4,1,3,
302 GFX_FLIEGER+5,1,3, GFX_FLIEGER+1,1,3, GFX_FLIEGER+5,1,3,
303 GFX_FLIEGER+6,1,3, GFX_FLIEGER+2,1,3, GFX_FLIEGER+6,1,3,
304 GFX_FLIEGER+7,1,3, GFX_FLIEGER+3,1,3, GFX_FLIEGER+7,1,3, HA_NEXT,
305 GFX_KAEFER+4,1,1, GFX_KAEFER+0,1,1, GFX_KAEFER+4,1,1,
306 GFX_KAEFER+5,1,1, GFX_KAEFER+1,1,1, GFX_KAEFER+5,1,1,
307 GFX_KAEFER+6,1,1, GFX_KAEFER+2,1,1, GFX_KAEFER+6,1,1,
308 GFX_KAEFER+7,1,1, GFX_KAEFER+3,1,1, GFX_KAEFER+7,1,1, HA_NEXT,
309 GFX_BUTTERFLY,2,2, HA_NEXT,
310 GFX_FIREFLY,2,2, HA_NEXT,
311 GFX_PACMAN+0,1,3, GFX_PACMAN+4,1,2, GFX_PACMAN+0,1,3,
312 GFX_PACMAN+1,1,3, GFX_PACMAN+5,1,2, GFX_PACMAN+1,1,3,
313 GFX_PACMAN+2,1,3, GFX_PACMAN+6,1,2, GFX_PACMAN+2,1,3,
314 GFX_PACMAN+3,1,3, GFX_PACMAN+7,1,2, GFX_PACMAN+3,1,3, HA_NEXT,
315 GFX_MAMPFER+0,4,1, GFX_MAMPFER+3,1,1, GFX_MAMPFER+2,1,1,
316 GFX_MAMPFER+1,1,1, GFX_MAMPFER+0,1,1, HA_NEXT,
317 GFX_MAMPFER2+0,4,1, GFX_MAMPFER2+3,1,1, GFX_MAMPFER2+2,1,1,
318 GFX_MAMPFER2+1,1,1, GFX_MAMPFER2+0,1,1, HA_NEXT,
319 GFX_ROBOT+0,4,1, GFX_ROBOT+3,1,1, GFX_ROBOT+2,1,1,
320 GFX_ROBOT+1,1,1, GFX_ROBOT+0,1,1, HA_NEXT,
321 GFX_MAULWURF_DOWN,4,2,
323 GFX_MAULWURF_LEFT,4,2,
324 GFX_MAULWURF_RIGHT,4,2, HA_NEXT,
325 GFX_PINGUIN_DOWN,4,2,
327 GFX_PINGUIN_LEFT,4,2,
328 GFX_PINGUIN_RIGHT,4,2, HA_NEXT,
329 GFX_SCHWEIN_DOWN,4,2,
331 GFX_SCHWEIN_LEFT,4,2,
332 GFX_SCHWEIN_RIGHT,4,2, HA_NEXT,
336 GFX_DRACHE_RIGHT,4,2, HA_NEXT,
337 GFX_SONDE_START,8,1, HA_NEXT,
338 GFX_ABLENK,4,1, HA_NEXT,
339 GFX_BIRNE_AUS,1,25, GFX_BIRNE_EIN,1,25, HA_NEXT,
340 GFX_ZEIT_VOLL,1,25, GFX_ZEIT_LEER,1,25, HA_NEXT,
341 GFX_TROPFEN,1,25, GFX_AMOEBING,4,1, GFX_AMOEBE_LEBT,1,10, HA_NEXT,
342 GFX_AMOEBE_TOT+2,2,50, GFX_AMOEBE_TOT,2,50, HA_NEXT,
343 GFX_AMOEBE_LEBT,4,40, HA_NEXT,
344 GFX_AMOEBE_LEBT,1,10, GFX_AMOEBING,4,2, HA_NEXT,
345 GFX_AMOEBE_LEBT,1,25, GFX_AMOEBE_TOT,1,25, GFX_EXPLOSION,8,1,
346 GFX_DIAMANT,1,10, HA_NEXT,
347 GFX_LIFE,1,100, HA_NEXT,
348 GFX_LIFE_ASYNC,1,100, HA_NEXT,
349 GFX_SIEB_LEER,4,2, HA_NEXT,
350 GFX_SIEB2_LEER,4,2, HA_NEXT,
351 GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2,
352 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
353 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
354 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
355 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
358 static char *helpscreen_eltext[][2] =
360 {"THE HERO:", "(Is _this_ guy good old Rockford?)"},
361 {"Normal sand:", "You can dig through it"},
362 {"Empty field:", "You can walk through it"},
363 {"Quicksand: You cannot pass it,", "but rocks can fall though it"},
364 {"Massive Wall:", "Nothing can go through it"},
365 {"Normal Wall: You can't go through", "it, but you can bomb it away"},
366 {"Growing Wall: Grows to the left or", "right if there is an empty field"},
367 {"Invisible Wall: Behaves like normal","wall, but is invisible"},
368 {"Old Wall: Like normal wall, but", "some things can fall down from it"},
369 {"Letter Wall: Looks like a letter,", "behaves like a normal wall"},
370 {"Emerald: You must collect enough of","them to finish a level"},
371 {"Diamond: Counts as 3 emeralds, but", "can be destroyed by rocks"},
372 {"Diamond (BD style): Counts like one","emerald and behaves a bit different"},
373 {"Colorful Gems:", "Seem to behave like Emeralds"},
374 {"Rock: Smashes several things;", "Can be moved by the player"},
375 {"Bomb: You can move it, but be", "careful when dropping it"},
376 {"Nut: Throw a rock on it to open it;","Each nut contains an emerald"},
377 {"Wall with an emerald inside:", "Bomb the wall away to get it"},
378 {"Wall with a diamond inside:", "Bomb the wall away to get it"},
379 {"Wall with BD style diamond inside:", "Bomb the wall away to get it"},
380 {"Wall with colorful gem inside:", "Bomb the wall away to get it"},
381 {"Acid: Things that fall in are gone", "forever (including our hero)"},
382 {"Key: Opens the door that has the", "same color (red/yellow/green/blue)"},
383 {"Door: Can be opened by the key", "with the same color"},
384 {"Door: You have to find out the", "right color of the key for it"},
385 {"Dynamite: Collect it and use it to", "destroy walls or kill enemies"},
386 {"Dynamite: This one explodes after", "a few seconds"},
387 {"Dyna Bomb: Explodes in 4 directions","with variable explosion size"},
388 {"Dyna Bomb: Increases the number of", "dyna bombs available at a time"},
389 {"Dyna Bomb: Increases the size of", "explosion of dyna bombs"},
390 {"Spaceship: Moves at the left side", "of walls; don't touch it!"},
391 {"Bug: Moves at the right side", "of walls; don't touch it!"},
392 {"Butterfly: Moves at the right side", "of walls; don't touch it!"},
393 {"Firefly: Moves at the left side", "of walls; don't touch it!"},
394 {"Pacman: Eats the amoeba and you,", "if you're not careful"},
395 {"Cruncher: Eats diamonds and you,", "if you're not careful"},
396 {"Cruncher (BD style):", "Eats almost everything"},
397 {"Robot: Tries to kill the player", ""},
398 {"The mole: You must guide him savely","to the exit; he will follow you"},
399 {"The penguin: Guide him to the exit,","but keep him away from monsters!"},
400 {"The Pig: Harmless, but eats all", "gems it can get"},
401 {"The Dragon: Breathes fire,", "especially to some monsters"},
402 {"Sonde: Follows you everywhere;", "harmless, but may block your way"},
403 {"Magic Wheel: Touch it to get rid of","the robots for some seconds"},
404 {"Light Bulb: All of them must be", "switched on to finish a level"},
405 {"Extra Time Orb: Adds some seconds", "to the time available for the level"},
406 {"Amoeba Drop: Grows to an amoeba on", "the ground - don't touch it"},
407 {"Dead Amoeba: Does not grow, but", "can still kill bugs and spaceships"},
408 {"Normal Amoeba: Grows through empty", "fields, sand and quicksand"},
409 {"Dropping Amoeba: This one makes", "drops that grow to a new amoeba"},
410 {"Living Amoeba (BD style): Contains", "other element, when surrounded"},
411 {"Game Of Life: Behaves like the well","known 'Game Of Life' (2333 style)"},
412 {"Biomaze: A bit like the 'Game Of", "Life', but builds crazy mazes"},
413 {"Magic Wall: Changes rocks, emeralds","and diamonds when they pass it"},
414 {"Magic Wall (BD style):", "Changes rocks and BD style diamonds"},
415 {"Exit door: Opens if you have enough","emeralds to finish the level"},
416 {"Open exit door: Enter here to leave","the level and exit the actual game"},
418 static int num_helpscreen_els = sizeof(helpscreen_eltext)/(2*sizeof(char *));
420 static char *helpscreen_music[][3] =
422 { "Alchemy", "Ian Boddy", "Drive" },
423 { "The Chase", "Propaganda", "A Secret Wish" },
424 { "Network 23", "Tangerine Dream", "Exit" },
425 { "Czardasz", "Robert Pieculewicz", "Czardasz" },
426 { "21st Century Common Man", "Tangerine Dream", "Tyger" },
427 { "Voyager", "The Alan Parsons Project","Pyramid" },
428 { "Twilight Painter", "Tangerine Dream", "Heartbreakers" }
430 static int helpscreen_musicpos;
432 void DrawHelpScreenElAction(int start)
436 int xstart = SX+16, ystart = SY+64+2*32, ystep = TILEY+4;
438 while(helpscreen_action[j] != HA_END)
440 if (i>=start+MAX_HELPSCREEN_ELS || i>=num_helpscreen_els)
442 else if (i<start || helpscreen_delay[i-start])
444 if (i>=start && helpscreen_delay[i-start])
445 helpscreen_delay[i-start]--;
447 while(helpscreen_action[j] != HA_NEXT)
454 j += 3*helpscreen_step[i-start];
455 graphic = helpscreen_action[j++];
457 if (helpscreen_frame[i-start])
459 frame = helpscreen_action[j++] - helpscreen_frame[i-start];
460 helpscreen_frame[i-start]--;
465 helpscreen_frame[i-start] = helpscreen_action[j++]-1;
468 helpscreen_delay[i-start] = helpscreen_action[j++] - 1;
470 if (helpscreen_action[j] == HA_NEXT)
472 if (!helpscreen_frame[i-start])
473 helpscreen_step[i-start] = 0;
477 if (!helpscreen_frame[i-start])
478 helpscreen_step[i-start]++;
479 while(helpscreen_action[j] != HA_NEXT)
484 DrawGraphicExtHiRes(drawto,gc,xstart,ystart+(i-start)*ystep,
496 void DrawHelpScreenElText(int start)
499 int xstart = SX+56, ystart = SY+65+2*32, ystep = TILEY+4;
500 char text[FULL_SXSIZE/FONT2_XSIZE+10];
505 sprintf(text,"The game elements:");
506 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
507 text,FS_SMALL,FC_GREEN);
509 for(i=start;i<start+MAX_HELPSCREEN_ELS && i<num_helpscreen_els;i++)
511 DrawText(xstart,ystart+(i-start)*ystep+(*helpscreen_eltext[i][1] ? 0 : 8),
512 helpscreen_eltext[i][0],FS_SMALL,FC_YELLOW);
513 DrawText(xstart,ystart+(i-start)*ystep+16,
514 helpscreen_eltext[i][1],FS_SMALL,FC_YELLOW);
517 sprintf(text,"Press any key or button for next page");
518 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
519 text,FS_SMALL,FC_BLUE);
522 void DrawHelpScreenMusicText(int num)
524 int ystart = 150, ystep = 30;
525 char text[FULL_SXSIZE/FONT2_XSIZE+10];
531 sprintf(text,"The game background music loops:");
532 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
533 text,FS_SMALL,FC_GREEN);
535 sprintf(text,"Excerpt from");
536 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
537 text,FS_SMALL,FC_YELLOW);
538 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][0],'\"');
539 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
540 text,FS_SMALL,FC_RED);
542 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
543 text,FS_SMALL,FC_YELLOW);
544 sprintf(text,"%s",helpscreen_music[num][1]);
545 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
546 text,FS_SMALL,FC_RED);
547 sprintf(text,"from the album");
548 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
549 text,FS_SMALL,FC_YELLOW);
550 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][2],'\"');
551 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+5*ystep,
552 text,FS_SMALL,FC_RED);
554 sprintf(text,"Press any key or button for next page");
555 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
556 text,FS_SMALL,FC_BLUE);
558 PlaySoundLoop(background_loop[num]);
561 void DrawHelpScreenCreditsText()
563 int ystart = 150, ystep = 30;
564 char text[FULL_SXSIZE/FONT2_XSIZE+10];
570 sprintf(text,"Program information:");
571 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
572 text,FS_SMALL,FC_GREEN);
574 sprintf(text,"This game is Freeware!");
575 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
576 text,FS_SMALL,FC_YELLOW);
577 sprintf(text,"If you like it, send e-mail to:");
578 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
579 text,FS_SMALL,FC_YELLOW);
580 sprintf(text,"aeglos@valinor.owl.de");
581 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
582 text,FS_SMALL,FC_RED);
583 sprintf(text,"or SnailMail to:");
584 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
585 text,FS_SMALL,FC_YELLOW);
586 sprintf(text,"Holger Schemel");
587 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
588 text,FS_SMALL,FC_RED);
589 sprintf(text,"Sennehof 28");
590 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+20,
591 text,FS_SMALL,FC_RED);
592 sprintf(text,"33659 Bielefeld");
593 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+40,
594 text,FS_SMALL,FC_RED);
595 sprintf(text,"Germany");
596 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+60,
597 text,FS_SMALL,FC_RED);
599 sprintf(text,"If you have created new levels,");
600 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+7*ystep,
601 text,FS_SMALL,FC_YELLOW);
602 sprintf(text,"send them to me to include them!");
603 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+8*ystep,
604 text,FS_SMALL,FC_YELLOW);
606 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+9*ystep,
607 text,FS_SMALL,FC_YELLOW);
609 sprintf(text,"Press any key or button for main menu");
610 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
611 text,FS_SMALL,FC_BLUE);
614 void DrawHelpScreen()
618 CloseDoor(DOOR_CLOSE_2);
620 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
621 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
622 helpscreen_musicpos = 0;
623 helpscreen_state = 0;
624 DrawHelpScreenElText(0);
625 DrawHelpScreenElAction(0);
629 PlaySoundLoop(SND_RHYTHMLOOP);
632 void HandleHelpScreen(int button)
634 static long hs_delay = 0;
635 int num_helpscreen_els_pages =
636 (num_helpscreen_els + MAX_HELPSCREEN_ELS-1) / MAX_HELPSCREEN_ELS;
637 int button_released = !button;
642 if (helpscreen_state<num_helpscreen_els_pages-1)
644 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
645 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
647 DrawHelpScreenElText(helpscreen_state*MAX_HELPSCREEN_ELS);
648 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
650 else if (helpscreen_state<num_helpscreen_els_pages+num_bg_loops-1)
653 DrawHelpScreenMusicText(helpscreen_state-num_helpscreen_els_pages);
655 else if (helpscreen_state==num_helpscreen_els_pages+num_bg_loops-1)
658 DrawHelpScreenCreditsText();
664 game_status = MAINMENU;
669 if (DelayReached(&hs_delay,GAME_FRAME_DELAY * 2))
671 if (helpscreen_state<num_helpscreen_els_pages)
672 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
682 int old_handicap = player.handicap;
684 if (!strcmp(player.alias_name,"Artsoft"))
685 player.handicap = leveldir[leveldir_nr].levels-1;
687 if (player.handicap != old_handicap)
689 SavePlayerInfo(PLAYER_LEVEL);
690 level_nr = player.handicap;
694 void HandleTypeName(int newxpos, KeySym key)
696 static int xpos = 0, ypos = 2;
702 DrawText(SX+6*32,SY+ypos*32,player.alias_name,FS_BIG,FC_YELLOW);
703 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
708 if ((key>=XK_A && key<=XK_Z) || (key>=XK_a && key<=XK_z &&
711 if (key>=XK_A && key<=XK_Z)
712 ascii = 'A'+(char)(key-XK_A);
713 if (key>=XK_a && key<=XK_z)
714 ascii = 'a'+(char)(key-XK_a);
716 if((ascii = get_ascii(key)) && xpos<MAX_NAMELEN-1)
719 player.alias_name[xpos] = ascii;
720 player.alias_name[xpos+1] = 0;
722 DrawTextExt(drawto,gc,SX+6*32,SY+ypos*32,
723 player.alias_name,FS_BIG,FC_YELLOW);
724 DrawTextExt(window,gc,SX+6*32,SY+ypos*32,
725 player.alias_name,FS_BIG,FC_YELLOW);
726 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
728 else if ((key==XK_Delete || key==XK_BackSpace) && xpos>0)
731 player.alias_name[xpos] = 0;
732 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
733 DrawGraphic(xpos+7,ypos,GFX_LEERRAUM);
735 else if (key==XK_Return && xpos>0)
737 DrawText(SX+6*32,SY+ypos*32,player.alias_name,FS_BIG,FC_RED);
738 DrawGraphic(xpos+6,ypos,GFX_LEERRAUM);
739 SavePlayerInfo(PLAYER_SETUP);
742 game_status = MAINMENU;
751 void DrawChooseLevel()
755 CloseDoor(DOOR_CLOSE_2);
758 DrawText(SX,SY,"Level Directories",FS_BIG,FC_GREEN);
759 for(i=0;i<num_leveldirs;i++)
761 DrawText(SX+32,SY+(i+2)*32,leveldir[i].name,FS_BIG,FC_YELLOW);
762 DrawGraphic(0,i+2,GFX_KUGEL_BLAU);
767 HandleChooseLevel(0,0,0,0,MB_MENU_INITIALIZE);
770 void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
772 static int choice = 3;
773 static int redraw = TRUE;
774 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
776 if (button == MB_MENU_INITIALIZE)
779 choice = leveldir_nr + 3;
784 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
788 if (button == MB_MENU_INITIALIZE)
803 else if (y>num_leveldirs+2)
807 if (!mx && !my && !dx && !dy)
813 if (x==1 && y>=3 && y<=num_leveldirs+2)
819 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
820 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
826 player.leveldir_nr = leveldir_nr = y-3;
827 LoadPlayerInfo(PLAYER_LEVEL);
828 SavePlayerInfo(PLAYER_SETUP);
832 LoadLevelTape(level_nr);
834 game_status = MAINMENU;
841 if (game_status==CHOOSELEVEL)
845 void DrawHallOfFame(int pos)
850 CloseDoor(DOOR_CLOSE_2);
855 DrawText(SX+64,SY+10,"Hall Of Fame",FS_BIG,FC_YELLOW);
856 sprintf(txt,"HighScores of Level %d",level_nr);
857 DrawText(SX+256-strlen(txt)*7,SY+48,txt,FS_SMALL,FC_RED);
858 for(y=0;y<MAX_SCORE_ENTRIES;y++)
860 DrawText(SX,SY+64+y*32,".................",FS_BIG,
861 (y==pos ? FC_RED : FC_GREEN));
862 DrawText(SX,SY+64+y*32,highscore[y].Name,FS_BIG,
863 (y==pos ? FC_RED : FC_GREEN));
864 DrawText(SX+12*32,SY+64+y*32,
865 int2str(highscore[y].Score,5),FS_BIG,
866 (y==pos ? FC_RED : FC_GREEN));
871 PlaySound(SND_HALLOFFAME);
874 void HandleHallOfFame(int button)
876 int button_released = !button;
880 FadeSound(SND_HALLOFFAME);
881 game_status = MAINMENU;
889 void DrawSetupScreen()
895 char *text, *mode[2];
899 {SETUP_SOUND, "Sound:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
900 {SETUP_SOUND_LOOPS, " Sound Loops:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
901 {SETUP_SOUND_MUSIC, " Game Music:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
902 {SETUP_TOONS, "Toons:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
903 {SETUP_DIRECT_DRAW, "Buffered gfx:",{"off","on" }, {FC_BLUE,FC_YELLOW}},
904 {SETUP_SCROLL_DELAY,"Scroll Delay:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
905 {SETUP_SOFT_SCROLL, "Soft Scroll.:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
906 {SETUP_FADING, "Fading:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
907 {SETUP_QUICK_DOORS, "Quick Doors:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
908 {SETUP_AUTO_RECORD, "Auto-Record:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
909 {SETUP_2ND_JOYSTICK,"Joystick:", {"2nd","1st"}, {FC_YELLOW,FC_YELLOW}},
910 {0, "Cal. Joystick",{"", ""}, {0,0}},
911 {0, "", {"", ""}, {0,0}},
912 {0, "Exit", {"", ""}, {0,0}},
913 {0, "Save and exit",{"", ""}, {0,0}}
916 CloseDoor(DOOR_CLOSE_2);
918 DrawText(SX+16, SY+16, "SETUP",FS_BIG,FC_YELLOW);
920 for(i=SETUP_SCREEN_POS_START;i<=SETUP_SCREEN_POS_END;i++)
922 int base = i - SETUP_SCREEN_POS_START;
924 if (i != SETUP_SCREEN_POS_EMPTY)
926 DrawGraphic(0,i,GFX_KUGEL_BLAU);
927 DrawText(SX+32,SY+i*32, setup[base].text, FS_BIG,FC_GREEN);
930 if (i < SETUP_SCREEN_POS_EMPTY)
932 int setting_bit = setup[base].bit;
933 int setting_pos = ((player.setup & setting_bit) != 0 ? 0 : 1);
934 DrawText(SX+14*32, SY+i*32,setup[base].mode[setting_pos],
935 FS_BIG,setup[base].color[setting_pos]);
941 HandleSetupScreen(0,0,0,0,MB_MENU_INITIALIZE);
944 void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
946 static int choice = 3;
947 static int redraw = TRUE;
948 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
949 int pos_start = SETUP_SCREEN_POS_START + 1;
950 int pos_empty = SETUP_SCREEN_POS_EMPTY + 1;
951 int pos_end = SETUP_SCREEN_POS_END + 1;
953 if (button == MB_MENU_INITIALIZE)
958 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
962 if (button == MB_MENU_INITIALIZE)
976 y = (dy>0 ? pos_empty+1 : pos_empty-1);
980 else if (y > pos_end)
984 if (!mx && !my && !dx && !dy)
990 if (x==1 && y>=pos_start && y<=pos_end && y!=pos_empty)
996 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
997 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
1005 if (y==3 && sound_status==SOUND_AVAILABLE)
1007 if (SETUP_SOUND_ON(player.setup))
1009 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1010 DrawText(SX+14*32, SY+(yy+1)*32,"off",FS_BIG,FC_BLUE);
1011 DrawText(SX+14*32, SY+(yy+2)*32,"off",FS_BIG,FC_BLUE);
1012 player.setup &= ~SETUP_SOUND_LOOPS;
1013 player.setup &= ~SETUP_SOUND_MUSIC;
1016 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1017 player.setup ^= SETUP_SOUND;
1019 else if (y==4 && sound_loops_allowed)
1021 if (SETUP_SOUND_LOOPS_ON(player.setup))
1022 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1025 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1026 DrawText(SX+14*32, SY+(yy-1)*32,"on ",FS_BIG,FC_YELLOW);
1027 player.setup |= SETUP_SOUND;
1029 player.setup ^= SETUP_SOUND_LOOPS;
1031 else if (y==5 && sound_loops_allowed)
1033 if (SETUP_SOUND_MUSIC_ON(player.setup))
1034 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1037 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1038 DrawText(SX+14*32, SY+(yy-2)*32,"on ",FS_BIG,FC_YELLOW);
1039 player.setup |= SETUP_SOUND;
1041 player.setup ^= SETUP_SOUND_MUSIC;
1045 if (SETUP_TOONS_ON(player.setup))
1046 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1048 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1049 player.setup ^= SETUP_TOONS;
1053 if (!SETUP_DIRECT_DRAW_ON(player.setup))
1054 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1056 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1057 player.setup ^= SETUP_DIRECT_DRAW;
1061 if (SETUP_SCROLL_DELAY_ON(player.setup))
1062 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1064 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1065 player.setup ^= SETUP_SCROLL_DELAY;
1069 if (SETUP_SOFT_SCROLL_ON(player.setup))
1070 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1072 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1073 player.setup ^= SETUP_SOFT_SCROLL;
1077 if (SETUP_FADING_ON(player.setup))
1078 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1080 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1081 player.setup ^= SETUP_FADING;
1085 if (SETUP_QUICK_DOORS_ON(player.setup))
1086 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1088 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1089 player.setup ^= SETUP_QUICK_DOORS;
1093 if (SETUP_AUTO_RECORD_ON(player.setup))
1094 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1096 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1097 player.setup ^= SETUP_AUTO_RECORD;
1101 if (SETUP_2ND_JOYSTICK_ON(player.setup))
1102 DrawText(SX+14*32, SY+yy*32,"1st",FS_BIG,FC_YELLOW);
1104 DrawText(SX+14*32, SY+yy*32,"2nd",FS_BIG,FC_YELLOW);
1105 player.setup ^= SETUP_2ND_JOYSTICK;
1109 CalibrateJoystick();
1112 else if (y==pos_end-1 || y==pos_end)
1116 SavePlayerInfo(PLAYER_SETUP);
1120 game_status = MAINMENU;
1128 if (game_status==SETUP)
1132 void CalibrateJoystick()
1135 struct joystick joy_ctrl;
1137 struct joystick_control
1149 int new_joystick_xleft, new_joystick_xright, new_joystick_xmiddle;
1150 int new_joystick_yupper, new_joystick_ylower, new_joystick_ymiddle;
1152 if (joystick_status==JOYSTICK_OFF)
1157 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1158 DrawText(SX+16, SY+8*32, " THE UPPER LEFT ",FS_BIG,FC_YELLOW);
1159 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1163 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1165 joy_ctrl.buttons = 0;
1167 while(Joystick() & JOY_BUTTON);
1169 while(!(joy_ctrl.b1||joy_ctrl.b2))
1171 while(!joy_ctrl.buttons)
1174 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1176 joystick_status=JOYSTICK_OFF;
1182 new_joystick_xleft = joy_ctrl.x;
1183 new_joystick_yupper = joy_ctrl.y;
1186 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1187 DrawText(SX+32, SY+8*32, "THE LOWER RIGHT",FS_BIG,FC_YELLOW);
1188 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1192 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1194 joy_ctrl.buttons = 0;
1196 while(Joystick() & JOY_BUTTON);
1198 while(!(joy_ctrl.b1||joy_ctrl.b2))
1200 while(!joy_ctrl.buttons)
1203 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1205 joystick_status=JOYSTICK_OFF;
1211 new_joystick_xright = joy_ctrl.x;
1212 new_joystick_ylower = joy_ctrl.y;
1215 DrawText(SX+32, SY+16+7*32, "CENTER JOYSTICK",FS_BIG,FC_YELLOW);
1216 DrawText(SX+16, SY+16+8*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1220 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1222 joy_ctrl.buttons = 0;
1224 while(Joystick() & JOY_BUTTON);
1226 while(!(joy_ctrl.b1||joy_ctrl.b2))
1228 while(!joy_ctrl.buttons)
1231 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1233 joystick_status=JOYSTICK_OFF;
1239 new_joystick_xmiddle = joy_ctrl.x;
1240 new_joystick_ymiddle = joy_ctrl.y;
1242 joystick[joystick_nr].xleft = new_joystick_xleft;
1243 joystick[joystick_nr].yupper = new_joystick_yupper;
1244 joystick[joystick_nr].xright = new_joystick_xright;
1245 joystick[joystick_nr].ylower = new_joystick_ylower;
1246 joystick[joystick_nr].xmiddle = new_joystick_xmiddle;
1247 joystick[joystick_nr].ymiddle = new_joystick_ymiddle;
1249 CheckJoystickData();
1252 while(Joystick() & JOY_BUTTON);
1260 joy_nr[1] = SETUP_2ND_JOYSTICK_ON(player.setup)+49;
1265 DrawText(SX+32, SY+7*32, "CENTER JOYSTICK",FS_BIG,FC_YELLOW);
1266 DrawText(SX+16+7*32, SY+8*32, joy_nr, FS_BIG,FC_YELLOW);
1267 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1270 for(clear_keybuf();!keypressed(););
1271 install_joystick(JOY_TYPE_2PADS);
1274 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1275 DrawText(SX+16, SY+8*32, " THE UPPER LEFT ",FS_BIG,FC_YELLOW);
1276 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1279 for(clear_keybuf();!keypressed(););
1280 calibrate_joystick(SETUP_2ND_JOYSTICK_ON(player.setup));
1283 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1284 DrawText(SX+32, SY+8*32, "THE LOWER RIGHT",FS_BIG,FC_YELLOW);
1285 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1288 for(clear_keybuf();!keypressed(););
1289 calibrate_joystick(SETUP_2ND_JOYSTICK_ON(player.setup));
1296 DrawText(SX+16, SY+16, "NO JOYSTICK",FS_BIG,FC_YELLOW);
1297 DrawText(SX+16, SY+48, " AVAILABLE ",FS_BIG,FC_YELLOW);
1303 void HandleGameActions()
1305 if (game_status != PLAYING)
1311 if (PlayerGone && !TAPE_IS_STOPPED(tape))
1317 void HandleVideoButtons(int mx, int my, int button)
1319 if (game_status != MAINMENU && game_status != PLAYING)
1322 switch(CheckVideoButtons(mx,my,button))
1324 case BUTTON_VIDEO_EJECT:
1326 if (TAPE_IS_EMPTY(tape))
1328 LoadLevelTape(level_nr);
1329 if (TAPE_IS_EMPTY(tape))
1330 AreYouSure("No tape for this level !",AYS_CONFIRM);
1335 SaveLevelTape(tape.level_nr);
1338 DrawCompleteVideoDisplay();
1340 case BUTTON_VIDEO_STOP:
1343 case BUTTON_VIDEO_PAUSE:
1346 case BUTTON_VIDEO_REC:
1347 if (TAPE_IS_STOPPED(tape))
1349 TapeStartRecording();
1350 game_status = PLAYING;
1353 else if (tape.pausing)
1355 if (tape.playing) /* PLAYING -> PAUSING -> RECORDING */
1357 tape.pos[tape.counter].delay = tape.delay_played;
1358 tape.playing = FALSE;
1359 tape.recording = TRUE;
1360 tape.changed = TRUE;
1362 DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON,0);
1368 case BUTTON_VIDEO_PLAY:
1369 if (TAPE_IS_EMPTY(tape))
1372 if (TAPE_IS_STOPPED(tape))
1375 game_status = PLAYING;
1378 else if (tape.playing)
1380 if (tape.pausing) /* PAUSE -> PLAY */
1382 else if (!tape.fast_forward) /* PLAY -> FAST FORWARD PLAY */
1384 tape.fast_forward = TRUE;
1385 DrawVideoDisplay(VIDEO_STATE_FFWD_ON, 0);
1387 else if (!tape.pause_before_death) /* FFWD PLAY -> + AUTO PAUSE */
1389 tape.pause_before_death = TRUE;
1390 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, VIDEO_DISPLAY_LABEL_ONLY);
1392 else /* -> NORMAL PLAY */
1394 tape.fast_forward = FALSE;
1395 tape.pause_before_death = FALSE;
1396 DrawVideoDisplay(VIDEO_STATE_FFWD_OFF | VIDEO_STATE_PAUSE_OFF, 0);
1407 void HandleSoundButtons(int mx, int my, int button)
1409 if (game_status != PLAYING)
1412 switch(CheckSoundButtons(mx,my,button))
1414 case BUTTON_SOUND_MUSIC:
1417 sound_music_on = FALSE;
1418 player.setup &= ~SETUP_SOUND_MUSIC;
1419 FadeSound(background_loop[level_nr % num_bg_loops]);
1420 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1422 else if (sound_loops_allowed)
1424 sound_on = sound_music_on = TRUE;
1425 player.setup |= (SETUP_SOUND | SETUP_SOUND_MUSIC);
1426 PlaySoundLoop(background_loop[level_nr % num_bg_loops]);
1427 DrawSoundDisplay(BUTTON_SOUND_MUSIC_ON);
1430 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1432 case BUTTON_SOUND_LOOPS:
1435 sound_loops_on = FALSE;
1436 player.setup &= ~SETUP_SOUND_LOOPS;
1437 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1439 else if (sound_loops_allowed)
1441 sound_on = sound_loops_on = TRUE;
1442 player.setup |= (SETUP_SOUND | SETUP_SOUND_LOOPS);
1443 DrawSoundDisplay(BUTTON_SOUND_LOOPS_ON);
1446 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1448 case BUTTON_SOUND_SIMPLE:
1449 if (sound_simple_on)
1451 sound_simple_on = FALSE;
1452 player.setup &= ~SETUP_SOUND;
1453 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1455 else if (sound_status==SOUND_AVAILABLE)
1457 sound_on = sound_simple_on = TRUE;
1458 player.setup |= SETUP_SOUND;
1459 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_ON);
1462 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1471 void HandleGameButtons(int mx, int my, int button)
1473 if (game_status != PLAYING)
1476 switch(CheckGameButtons(mx,my,button))
1478 case BUTTON_GAME_STOP:
1481 CloseDoor(DOOR_CLOSE_1);
1482 game_status = MAINMENU;
1487 if (AreYouSure("Do you really want to quit the game ?",
1488 AYS_ASK | AYS_STAY_CLOSED))
1490 game_status = MAINMENU;
1494 OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
1496 case BUTTON_GAME_PAUSE:
1499 tape.pausing = FALSE;
1500 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);
1504 tape.pausing = TRUE;
1505 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON,0);
1508 case BUTTON_GAME_PLAY:
1511 tape.pausing = FALSE;
1512 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);