1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-98 Artsoft Entertainment *
8 * phone: ++49 +521 290471 *
9 * email: aeglos@valinor.owl.de *
10 *----------------------------------------------------------*
12 ***********************************************************/
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, local_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+40+16,SY+326,"A Game by Artsoft Entertainment",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,150))
152 level_nr = new_level_nr;
154 if (level_nr > local_player->handicap)
155 level_nr = local_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(local_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 Request("This level is read only !",REQ_CONFIRM);
213 game_status = HELPSCREEN;
221 TapeStartRecording();
223 game_status = PLAYING;
227 SendToServer_StartPlaying();
236 SavePlayerInfo(PLAYER_LEVEL);
237 if (Request("Do you really want to quit ?",REQ_ASK|REQ_STAY_CLOSED))
238 game_status = EXITGAME;
249 if (game_status==MAINMENU)
253 #define MAX_HELPSCREEN_ELS 10
257 static long helpscreen_state;
258 static int helpscreen_step[MAX_HELPSCREEN_ELS];
259 static int helpscreen_frame[MAX_HELPSCREEN_ELS];
260 static int helpscreen_delay[MAX_HELPSCREEN_ELS];
261 static int helpscreen_action[] =
263 GFX_SPIELER1_DOWN,4,2,
265 GFX_SPIELER1_LEFT,4,2,
266 GFX_SPIELER1_RIGHT,4,2,
267 GFX_SPIELER1_PUSH_LEFT,4,2,
268 GFX_SPIELER1_PUSH_RIGHT,4,2, HA_NEXT,
269 GFX_ERDREICH,1,100, HA_NEXT,
270 GFX_LEERRAUM,1,100, HA_NEXT,
271 GFX_MORAST_LEER,1,100, HA_NEXT,
272 GFX_BETON,1,100, HA_NEXT,
273 GFX_MAUERWERK,1,100, HA_NEXT,
274 GFX_MAUER_R1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10,
275 GFX_MAUER_L1,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, HA_NEXT,
276 GFX_UNSICHTBAR,1,100, HA_NEXT,
277 GFX_FELSBODEN,1,100, HA_NEXT,
278 GFX_CHAR_A,30,4, GFX_CHAR_AUSRUF,32,4, HA_NEXT,
279 GFX_EDELSTEIN,2,5, HA_NEXT,
280 GFX_DIAMANT,2,5, HA_NEXT,
281 GFX_EDELSTEIN_BD,2,5, HA_NEXT,
282 GFX_EDELSTEIN_GELB,2,5, GFX_EDELSTEIN_ROT,2,5,
283 GFX_EDELSTEIN_LILA,2,5, HA_NEXT,
284 GFX_FELSBROCKEN,4,5, HA_NEXT,
285 GFX_BOMBE,1,50, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
286 GFX_KOKOSNUSS,1,50, GFX_CRACKINGNUT,3,1, GFX_EDELSTEIN,1,10, HA_NEXT,
287 GFX_ERZ_EDEL,1,50, GFX_EXPLOSION,8,1, GFX_EDELSTEIN,1,10, HA_NEXT,
288 GFX_ERZ_DIAM,1,50, GFX_EXPLOSION,8,1, GFX_DIAMANT,1,10, HA_NEXT,
289 GFX_ERZ_EDEL_BD,1,50, GFX_EXPLOSION,8,1,GFX_EDELSTEIN_BD,1,10,HA_NEXT,
290 GFX_ERZ_EDEL_GELB,1,50, GFX_EXPLOSION,8,1,
291 GFX_EDELSTEIN_GELB,1,10, GFX_ERZ_EDEL_ROT,1,50,
292 GFX_EXPLOSION,8,1, GFX_EDELSTEIN_ROT,1,10,
293 GFX_ERZ_EDEL_LILA,1,50, GFX_EXPLOSION,8,1,
294 GFX_EDELSTEIN_LILA,1,10, HA_NEXT,
295 GFX_GEBLUBBER,4,4, HA_NEXT,
296 GFX_SCHLUESSEL1,4,25, HA_NEXT,
297 GFX_PFORTE1,4,25, HA_NEXT,
298 GFX_PFORTE1X,4,25, HA_NEXT,
299 GFX_DYNAMIT_AUS,1,100, HA_NEXT,
300 GFX_DYNAMIT,7,6, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT,
301 GFX_DYNABOMB+0,4,3, GFX_DYNABOMB+3,1,3, GFX_DYNABOMB+2,1,3,
302 GFX_DYNABOMB+1,1,3, GFX_DYNABOMB+0,1,3, GFX_EXPLOSION,8,1,
303 GFX_LEERRAUM,1,10, HA_NEXT,
304 GFX_DYNABOMB_NR,1,100, HA_NEXT,
305 GFX_DYNABOMB_SZ,1,100, HA_NEXT,
306 GFX_FLIEGER+4,1,3, GFX_FLIEGER+0,1,3, GFX_FLIEGER+4,1,3,
307 GFX_FLIEGER+5,1,3, GFX_FLIEGER+1,1,3, GFX_FLIEGER+5,1,3,
308 GFX_FLIEGER+6,1,3, GFX_FLIEGER+2,1,3, GFX_FLIEGER+6,1,3,
309 GFX_FLIEGER+7,1,3, GFX_FLIEGER+3,1,3, GFX_FLIEGER+7,1,3, HA_NEXT,
310 GFX_KAEFER+4,1,1, GFX_KAEFER+0,1,1, GFX_KAEFER+4,1,1,
311 GFX_KAEFER+5,1,1, GFX_KAEFER+1,1,1, GFX_KAEFER+5,1,1,
312 GFX_KAEFER+6,1,1, GFX_KAEFER+2,1,1, GFX_KAEFER+6,1,1,
313 GFX_KAEFER+7,1,1, GFX_KAEFER+3,1,1, GFX_KAEFER+7,1,1, HA_NEXT,
314 GFX_BUTTERFLY,2,2, HA_NEXT,
315 GFX_FIREFLY,2,2, HA_NEXT,
316 GFX_PACMAN+0,1,3, GFX_PACMAN+4,1,2, GFX_PACMAN+0,1,3,
317 GFX_PACMAN+1,1,3, GFX_PACMAN+5,1,2, GFX_PACMAN+1,1,3,
318 GFX_PACMAN+2,1,3, GFX_PACMAN+6,1,2, GFX_PACMAN+2,1,3,
319 GFX_PACMAN+3,1,3, GFX_PACMAN+7,1,2, GFX_PACMAN+3,1,3, HA_NEXT,
320 GFX_MAMPFER+0,4,1, GFX_MAMPFER+3,1,1, GFX_MAMPFER+2,1,1,
321 GFX_MAMPFER+1,1,1, GFX_MAMPFER+0,1,1, HA_NEXT,
322 GFX_MAMPFER2+0,4,1, GFX_MAMPFER2+3,1,1, GFX_MAMPFER2+2,1,1,
323 GFX_MAMPFER2+1,1,1, GFX_MAMPFER2+0,1,1, HA_NEXT,
324 GFX_ROBOT+0,4,1, GFX_ROBOT+3,1,1, GFX_ROBOT+2,1,1,
325 GFX_ROBOT+1,1,1, GFX_ROBOT+0,1,1, HA_NEXT,
326 GFX_MAULWURF_DOWN,4,2,
328 GFX_MAULWURF_LEFT,4,2,
329 GFX_MAULWURF_RIGHT,4,2, HA_NEXT,
330 GFX_PINGUIN_DOWN,4,2,
332 GFX_PINGUIN_LEFT,4,2,
333 GFX_PINGUIN_RIGHT,4,2, HA_NEXT,
334 GFX_SCHWEIN_DOWN,4,2,
336 GFX_SCHWEIN_LEFT,4,2,
337 GFX_SCHWEIN_RIGHT,4,2, HA_NEXT,
341 GFX_DRACHE_RIGHT,4,2, HA_NEXT,
342 GFX_SONDE_START,8,1, HA_NEXT,
343 GFX_ABLENK,4,1, HA_NEXT,
344 GFX_BIRNE_AUS,1,25, GFX_BIRNE_EIN,1,25, HA_NEXT,
345 GFX_ZEIT_VOLL,1,25, GFX_ZEIT_LEER,1,25, HA_NEXT,
346 GFX_TROPFEN,1,25, GFX_AMOEBING,4,1, GFX_AMOEBE_LEBT,1,10, HA_NEXT,
347 GFX_AMOEBE_TOT+2,2,50, GFX_AMOEBE_TOT,2,50, HA_NEXT,
348 GFX_AMOEBE_LEBT,4,40, HA_NEXT,
349 GFX_AMOEBE_LEBT,1,10, GFX_AMOEBING,4,2, HA_NEXT,
350 GFX_AMOEBE_LEBT,1,25, GFX_AMOEBE_TOT,1,25, GFX_EXPLOSION,8,1,
351 GFX_DIAMANT,1,10, HA_NEXT,
352 GFX_LIFE,1,100, HA_NEXT,
353 GFX_LIFE_ASYNC,1,100, HA_NEXT,
354 GFX_SIEB_LEER,4,2, HA_NEXT,
355 GFX_SIEB2_LEER,4,2, HA_NEXT,
356 GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2,
357 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
358 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
359 GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
360 GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
363 static char *helpscreen_eltext[][2] =
365 {"THE HERO:", "(Is _this_ guy good old Rockford?)"},
366 {"Normal sand:", "You can dig through it"},
367 {"Empty field:", "You can walk through it"},
368 {"Quicksand: You cannot pass it,", "but rocks can fall though it"},
369 {"Massive Wall:", "Nothing can go through it"},
370 {"Normal Wall: You can't go through", "it, but you can bomb it away"},
371 {"Growing Wall: Grows to the left or", "right if there is an empty field"},
372 {"Invisible Wall: Behaves like normal","wall, but is invisible"},
373 {"Old Wall: Like normal wall, but", "some things can fall down from it"},
374 {"Letter Wall: Looks like a letter,", "behaves like a normal wall"},
375 {"Emerald: You must collect enough of","them to finish a level"},
376 {"Diamond: Counts as 3 emeralds, but", "can be destroyed by rocks"},
377 {"Diamond (BD style): Counts like one","emerald and behaves a bit different"},
378 {"Colorful Gems:", "Seem to behave like Emeralds"},
379 {"Rock: Smashes several things;", "Can be moved by the player"},
380 {"Bomb: You can move it, but be", "careful when dropping it"},
381 {"Nut: Throw a rock on it to open it;","Each nut contains an emerald"},
382 {"Wall with an emerald inside:", "Bomb the wall away to get it"},
383 {"Wall with a diamond inside:", "Bomb the wall away to get it"},
384 {"Wall with BD style diamond inside:", "Bomb the wall away to get it"},
385 {"Wall with colorful gem inside:", "Bomb the wall away to get it"},
386 {"Acid: Things that fall in are gone", "forever (including our hero)"},
387 {"Key: Opens the door that has the", "same color (red/yellow/green/blue)"},
388 {"Door: Can be opened by the key", "with the same color"},
389 {"Door: You have to find out the", "right color of the key for it"},
390 {"Dynamite: Collect it and use it to", "destroy walls or kill enemies"},
391 {"Dynamite: This one explodes after", "a few seconds"},
392 {"Dyna Bomb: Explodes in 4 directions","with variable explosion size"},
393 {"Dyna Bomb: Increases the number of", "dyna bombs available at a time"},
394 {"Dyna Bomb: Increases the size of", "explosion of dyna bombs"},
395 {"Spaceship: Moves at the left side", "of walls; don't touch it!"},
396 {"Bug: Moves at the right side", "of walls; don't touch it!"},
397 {"Butterfly: Moves at the right side", "of walls; don't touch it!"},
398 {"Firefly: Moves at the left side", "of walls; don't touch it!"},
399 {"Pacman: Eats the amoeba and you,", "if you're not careful"},
400 {"Cruncher: Eats diamonds and you,", "if you're not careful"},
401 {"Cruncher (BD style):", "Eats almost everything"},
402 {"Robot: Tries to kill the player", ""},
403 {"The mole: You must guide him savely","to the exit; he will follow you"},
404 {"The penguin: Guide him to the exit,","but keep him away from monsters!"},
405 {"The Pig: Harmless, but eats all", "gems it can get"},
406 {"The Dragon: Breathes fire,", "especially to some monsters"},
407 {"Sonde: Follows you everywhere;", "harmless, but may block your way"},
408 {"Magic Wheel: Touch it to get rid of","the robots for some seconds"},
409 {"Light Bulb: All of them must be", "switched on to finish a level"},
410 {"Extra Time Orb: Adds some seconds", "to the time available for the level"},
411 {"Amoeba Drop: Grows to an amoeba on", "the ground - don't touch it"},
412 {"Dead Amoeba: Does not grow, but", "can still kill bugs and spaceships"},
413 {"Normal Amoeba: Grows through empty", "fields, sand and quicksand"},
414 {"Dropping Amoeba: This one makes", "drops that grow to a new amoeba"},
415 {"Living Amoeba (BD style): Contains", "other element, when surrounded"},
416 {"Game Of Life: Behaves like the well","known 'Game Of Life' (2333 style)"},
417 {"Biomaze: A bit like the 'Game Of", "Life', but builds crazy mazes"},
418 {"Magic Wall: Changes rocks, emeralds","and diamonds when they pass it"},
419 {"Magic Wall (BD style):", "Changes rocks and BD style diamonds"},
420 {"Exit door: Opens if you have enough","emeralds to finish the level"},
421 {"Open exit door: Enter here to leave","the level and exit the actual game"},
423 static int num_helpscreen_els = sizeof(helpscreen_eltext)/(2*sizeof(char *));
425 static char *helpscreen_music[][3] =
427 { "Alchemy", "Ian Boddy", "Drive" },
428 { "The Chase", "Propaganda", "A Secret Wish" },
429 { "Network 23", "Tangerine Dream", "Exit" },
430 { "Czardasz", "Robert Pieculewicz", "Czardasz" },
431 { "21st Century Common Man", "Tangerine Dream", "Tyger" },
432 { "Voyager", "The Alan Parsons Project","Pyramid" },
433 { "Twilight Painter", "Tangerine Dream", "Heartbreakers" }
435 static int helpscreen_musicpos;
437 void DrawHelpScreenElAction(int start)
441 int xstart = SX+16, ystart = SY+64+2*32, ystep = TILEY+4;
443 while(helpscreen_action[j] != HA_END)
445 if (i>=start+MAX_HELPSCREEN_ELS || i>=num_helpscreen_els)
447 else if (i<start || helpscreen_delay[i-start])
449 if (i>=start && helpscreen_delay[i-start])
450 helpscreen_delay[i-start]--;
452 while(helpscreen_action[j] != HA_NEXT)
459 j += 3*helpscreen_step[i-start];
460 graphic = helpscreen_action[j++];
462 if (helpscreen_frame[i-start])
464 frame = helpscreen_action[j++] - helpscreen_frame[i-start];
465 helpscreen_frame[i-start]--;
470 helpscreen_frame[i-start] = helpscreen_action[j++]-1;
473 helpscreen_delay[i-start] = helpscreen_action[j++] - 1;
475 if (helpscreen_action[j] == HA_NEXT)
477 if (!helpscreen_frame[i-start])
478 helpscreen_step[i-start] = 0;
482 if (!helpscreen_frame[i-start])
483 helpscreen_step[i-start]++;
484 while(helpscreen_action[j] != HA_NEXT)
489 DrawGraphicExt(drawto, gc, xstart, ystart+(i-start)*ystep, graphic+frame);
500 void DrawHelpScreenElText(int start)
503 int xstart = SX+56, ystart = SY+65+2*32, ystep = TILEY+4;
504 char text[FULL_SXSIZE/FONT2_XSIZE+10];
509 sprintf(text,"The game elements:");
510 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
511 text,FS_SMALL,FC_GREEN);
513 for(i=start;i<start+MAX_HELPSCREEN_ELS && i<num_helpscreen_els;i++)
515 DrawText(xstart,ystart+(i-start)*ystep+(*helpscreen_eltext[i][1] ? 0 : 8),
516 helpscreen_eltext[i][0],FS_SMALL,FC_YELLOW);
517 DrawText(xstart,ystart+(i-start)*ystep+16,
518 helpscreen_eltext[i][1],FS_SMALL,FC_YELLOW);
521 sprintf(text,"Press any key or button for next page");
522 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
523 text,FS_SMALL,FC_BLUE);
526 void DrawHelpScreenMusicText(int num)
528 int ystart = 150, ystep = 30;
529 char text[FULL_SXSIZE/FONT2_XSIZE+10];
535 sprintf(text,"The game background music loops:");
536 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
537 text,FS_SMALL,FC_GREEN);
539 sprintf(text,"Excerpt from");
540 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
541 text,FS_SMALL,FC_YELLOW);
542 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][0],'\"');
543 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
544 text,FS_SMALL,FC_RED);
546 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
547 text,FS_SMALL,FC_YELLOW);
548 sprintf(text,"%s",helpscreen_music[num][1]);
549 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
550 text,FS_SMALL,FC_RED);
551 sprintf(text,"from the album");
552 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
553 text,FS_SMALL,FC_YELLOW);
554 sprintf(text,"%c%s%c",'\"',helpscreen_music[num][2],'\"');
555 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+5*ystep,
556 text,FS_SMALL,FC_RED);
558 sprintf(text,"Press any key or button for next page");
559 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
560 text,FS_SMALL,FC_BLUE);
562 PlaySoundLoop(background_loop[num]);
565 void DrawHelpScreenCreditsText()
567 int ystart = 150, ystep = 30;
568 char text[FULL_SXSIZE/FONT2_XSIZE+10];
574 sprintf(text,"Program information:");
575 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100,
576 text,FS_SMALL,FC_GREEN);
578 sprintf(text,"This game is Freeware!");
579 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep,
580 text,FS_SMALL,FC_YELLOW);
581 sprintf(text,"If you like it, send e-mail to:");
582 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep,
583 text,FS_SMALL,FC_YELLOW);
584 sprintf(text,"aeglos@valinor.owl.de");
585 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep,
586 text,FS_SMALL,FC_RED);
587 sprintf(text,"or SnailMail to:");
588 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep,
589 text,FS_SMALL,FC_YELLOW);
590 sprintf(text,"Holger Schemel");
591 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep,
592 text,FS_SMALL,FC_RED);
593 sprintf(text,"Sennehof 28");
594 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+20,
595 text,FS_SMALL,FC_RED);
596 sprintf(text,"33659 Bielefeld");
597 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+40,
598 text,FS_SMALL,FC_RED);
599 sprintf(text,"Germany");
600 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+4*ystep+60,
601 text,FS_SMALL,FC_RED);
603 sprintf(text,"If you have created new levels,");
604 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+7*ystep,
605 text,FS_SMALL,FC_YELLOW);
606 sprintf(text,"send them to me to include them!");
607 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+8*ystep,
608 text,FS_SMALL,FC_YELLOW);
610 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+9*ystep,
611 text,FS_SMALL,FC_YELLOW);
613 sprintf(text,"Press any key or button for main menu");
614 DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20,
615 text,FS_SMALL,FC_BLUE);
618 void DrawHelpScreen()
622 CloseDoor(DOOR_CLOSE_2);
624 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
625 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
626 helpscreen_musicpos = 0;
627 helpscreen_state = 0;
628 DrawHelpScreenElText(0);
629 DrawHelpScreenElAction(0);
633 PlaySoundLoop(SND_RHYTHMLOOP);
636 void HandleHelpScreen(int button)
638 static long hs_delay = 0;
639 int num_helpscreen_els_pages =
640 (num_helpscreen_els + MAX_HELPSCREEN_ELS-1) / MAX_HELPSCREEN_ELS;
641 int button_released = !button;
646 if (helpscreen_state<num_helpscreen_els_pages-1)
648 for(i=0;i<MAX_HELPSCREEN_ELS;i++)
649 helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
651 DrawHelpScreenElText(helpscreen_state*MAX_HELPSCREEN_ELS);
652 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
654 else if (helpscreen_state<num_helpscreen_els_pages+num_bg_loops-1)
657 DrawHelpScreenMusicText(helpscreen_state-num_helpscreen_els_pages);
659 else if (helpscreen_state==num_helpscreen_els_pages+num_bg_loops-1)
662 DrawHelpScreenCreditsText();
668 game_status = MAINMENU;
673 if (DelayReached(&hs_delay,GAME_FRAME_DELAY * 2))
675 if (helpscreen_state<num_helpscreen_els_pages)
676 DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
686 int old_handicap = local_player->handicap;
688 if (!strcmp(local_player->alias_name,"Artsoft"))
689 local_player->handicap = leveldir[leveldir_nr].levels-1;
691 if (local_player->handicap != old_handicap)
693 SavePlayerInfo(PLAYER_LEVEL);
694 level_nr = local_player->handicap;
698 void HandleTypeName(int newxpos, KeySym key)
700 static int xpos = 0, ypos = 2;
706 DrawText(SX+6*32, SY+ypos*32, local_player->alias_name, FS_BIG, FC_YELLOW);
707 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
712 if ((key>=XK_A && key<=XK_Z) || (key>=XK_a && key<=XK_z &&
715 if (key>=XK_A && key<=XK_Z)
716 ascii = 'A'+(char)(key-XK_A);
717 if (key>=XK_a && key<=XK_z)
718 ascii = 'a'+(char)(key-XK_a);
720 if((ascii = get_ascii(key)) && xpos<MAX_NAMELEN-1)
723 local_player->alias_name[xpos] = ascii;
724 local_player->alias_name[xpos+1] = 0;
726 DrawTextExt(drawto,gc,SX+6*32,SY+ypos*32,
727 local_player->alias_name,FS_BIG,FC_YELLOW);
728 DrawTextExt(window,gc,SX+6*32,SY+ypos*32,
729 local_player->alias_name,FS_BIG,FC_YELLOW);
730 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
732 else if ((key==XK_Delete || key==XK_BackSpace) && xpos>0)
735 local_player->alias_name[xpos] = 0;
736 DrawGraphic(xpos+6,ypos,GFX_KUGEL_ROT);
737 DrawGraphic(xpos+7,ypos,GFX_LEERRAUM);
739 else if (key==XK_Return && xpos>0)
741 DrawText(SX+6*32,SY+ypos*32,local_player->alias_name,FS_BIG,FC_RED);
742 DrawGraphic(xpos+6,ypos,GFX_LEERRAUM);
743 SavePlayerInfo(PLAYER_SETUP);
746 game_status = MAINMENU;
755 void DrawChooseLevel()
759 CloseDoor(DOOR_CLOSE_2);
762 DrawText(SX,SY,"Level Directories",FS_BIG,FC_GREEN);
763 for(i=0;i<num_leveldirs;i++)
765 DrawText(SX+32,SY+(i+2)*32,leveldir[i].name,FS_BIG,FC_YELLOW);
766 DrawGraphic(0,i+2,GFX_KUGEL_BLAU);
771 HandleChooseLevel(0,0,0,0,MB_MENU_INITIALIZE);
774 void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
776 static int choice = 3;
777 static int redraw = TRUE;
778 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
780 if (button == MB_MENU_INITIALIZE)
783 choice = leveldir_nr + 3;
788 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
792 if (button == MB_MENU_INITIALIZE)
807 else if (y>num_leveldirs+2)
811 if (!mx && !my && !dx && !dy)
817 if (x==1 && y>=3 && y<=num_leveldirs+2)
823 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
824 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
830 local_player->leveldir_nr = leveldir_nr = y-3;
831 LoadPlayerInfo(PLAYER_LEVEL);
832 SavePlayerInfo(PLAYER_SETUP);
836 LoadLevelTape(level_nr);
838 game_status = MAINMENU;
845 if (game_status==CHOOSELEVEL)
849 void DrawHallOfFame(int pos)
854 CloseDoor(DOOR_CLOSE_2);
859 DrawText(SX+64,SY+10,"Hall Of Fame",FS_BIG,FC_YELLOW);
860 sprintf(txt,"HighScores of Level %d",level_nr);
861 DrawText(SX+256-strlen(txt)*7,SY+48,txt,FS_SMALL,FC_RED);
862 for(y=0;y<MAX_SCORE_ENTRIES;y++)
864 DrawText(SX,SY+64+y*32,".................",FS_BIG,
865 (y==pos ? FC_RED : FC_GREEN));
866 DrawText(SX,SY+64+y*32,highscore[y].Name,FS_BIG,
867 (y==pos ? FC_RED : FC_GREEN));
868 DrawText(SX+12*32,SY+64+y*32,
869 int2str(highscore[y].Score,5),FS_BIG,
870 (y==pos ? FC_RED : FC_GREEN));
875 PlaySound(SND_HALLOFFAME);
878 void HandleHallOfFame(int button)
880 int button_released = !button;
884 FadeSound(SND_HALLOFFAME);
885 game_status = MAINMENU;
893 void DrawSetupScreen()
899 char *text, *mode[2];
903 {SETUP_SOUND, "Sound:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
904 {SETUP_SOUND_LOOPS, " Sound Loops:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
905 {SETUP_SOUND_MUSIC, " Game Music:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
906 {SETUP_TOONS, "Toons:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
907 {SETUP_DIRECT_DRAW, "Buffered gfx:",{"off","on" }, {FC_BLUE,FC_YELLOW}},
908 {SETUP_SCROLL_DELAY,"Scroll Delay:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
909 {SETUP_SOFT_SCROLL, "Soft Scroll.:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
910 {SETUP_FADING, "Fading:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
911 {SETUP_QUICK_DOORS, "Quick Doors:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
912 {SETUP_AUTO_RECORD, "Auto-Record:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
913 {SETUP_2ND_JOYSTICK,"Joystick:", {"2nd","1st"}, {FC_YELLOW,FC_YELLOW}},
914 {0, "Cal. Joystick",{"", ""}, {0,0}},
915 {0, "", {"", ""}, {0,0}},
916 {0, "Exit", {"", ""}, {0,0}},
917 {0, "Save and exit",{"", ""}, {0,0}}
920 CloseDoor(DOOR_CLOSE_2);
922 DrawText(SX+16, SY+16, "SETUP",FS_BIG,FC_YELLOW);
924 for(i=SETUP_SCREEN_POS_START;i<=SETUP_SCREEN_POS_END;i++)
926 int base = i - SETUP_SCREEN_POS_START;
928 if (i != SETUP_SCREEN_POS_EMPTY)
930 DrawGraphic(0,i,GFX_KUGEL_BLAU);
931 DrawText(SX+32,SY+i*32, setup[base].text, FS_BIG,FC_GREEN);
934 if (i < SETUP_SCREEN_POS_EMPTY)
936 int setting_bit = setup[base].bit;
937 int setting_pos = ((local_player->setup & setting_bit) != 0 ? 0 : 1);
938 DrawText(SX+14*32, SY+i*32,setup[base].mode[setting_pos],
939 FS_BIG,setup[base].color[setting_pos]);
945 HandleSetupScreen(0,0,0,0,MB_MENU_INITIALIZE);
948 void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
950 static int choice = 3;
951 static int redraw = TRUE;
952 int x = (mx+32-SX)/32, y = (my+32-SY)/32;
953 int pos_start = SETUP_SCREEN_POS_START + 1;
954 int pos_empty = SETUP_SCREEN_POS_EMPTY + 1;
955 int pos_end = SETUP_SCREEN_POS_END + 1;
957 if (button == MB_MENU_INITIALIZE)
962 DrawGraphic(0,choice-1,GFX_KUGEL_ROT);
966 if (button == MB_MENU_INITIALIZE)
980 y = (dy>0 ? pos_empty+1 : pos_empty-1);
984 else if (y > pos_end)
988 if (!mx && !my && !dx && !dy)
994 if (x==1 && y>=pos_start && y<=pos_end && y!=pos_empty)
1000 DrawGraphic(0,y-1,GFX_KUGEL_ROT);
1001 DrawGraphic(0,choice-1,GFX_KUGEL_BLAU);
1009 if (y==3 && sound_status==SOUND_AVAILABLE)
1011 if (SETUP_SOUND_ON(local_player->setup))
1013 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1014 DrawText(SX+14*32, SY+(yy+1)*32,"off",FS_BIG,FC_BLUE);
1015 DrawText(SX+14*32, SY+(yy+2)*32,"off",FS_BIG,FC_BLUE);
1016 local_player->setup &= ~SETUP_SOUND_LOOPS;
1017 local_player->setup &= ~SETUP_SOUND_MUSIC;
1020 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1021 local_player->setup ^= SETUP_SOUND;
1023 else if (y==4 && sound_loops_allowed)
1025 if (SETUP_SOUND_LOOPS_ON(local_player->setup))
1026 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1029 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1030 DrawText(SX+14*32, SY+(yy-1)*32,"on ",FS_BIG,FC_YELLOW);
1031 local_player->setup |= SETUP_SOUND;
1033 local_player->setup ^= SETUP_SOUND_LOOPS;
1035 else if (y==5 && sound_loops_allowed)
1037 if (SETUP_SOUND_MUSIC_ON(local_player->setup))
1038 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1041 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1042 DrawText(SX+14*32, SY+(yy-2)*32,"on ",FS_BIG,FC_YELLOW);
1043 local_player->setup |= SETUP_SOUND;
1045 local_player->setup ^= SETUP_SOUND_MUSIC;
1049 if (SETUP_TOONS_ON(local_player->setup))
1050 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1052 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1053 local_player->setup ^= SETUP_TOONS;
1057 if (!SETUP_DIRECT_DRAW_ON(local_player->setup))
1058 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1060 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1061 local_player->setup ^= SETUP_DIRECT_DRAW;
1065 if (SETUP_SCROLL_DELAY_ON(local_player->setup))
1066 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1068 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1069 local_player->setup ^= SETUP_SCROLL_DELAY;
1073 if (SETUP_SOFT_SCROLL_ON(local_player->setup))
1074 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1076 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1077 local_player->setup ^= SETUP_SOFT_SCROLL;
1081 if (SETUP_FADING_ON(local_player->setup))
1082 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1084 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1085 local_player->setup ^= SETUP_FADING;
1089 if (SETUP_QUICK_DOORS_ON(local_player->setup))
1090 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1092 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1093 local_player->setup ^= SETUP_QUICK_DOORS;
1097 if (SETUP_AUTO_RECORD_ON(local_player->setup))
1098 DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
1100 DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
1101 local_player->setup ^= SETUP_AUTO_RECORD;
1105 if (SETUP_2ND_JOYSTICK_ON(local_player->setup))
1106 DrawText(SX+14*32, SY+yy*32,"1st",FS_BIG,FC_YELLOW);
1108 DrawText(SX+14*32, SY+yy*32,"2nd",FS_BIG,FC_YELLOW);
1109 local_player->setup ^= SETUP_2ND_JOYSTICK;
1113 CalibrateJoystick();
1116 else if (y==pos_end-1 || y==pos_end)
1120 SavePlayerInfo(PLAYER_SETUP);
1124 game_status = MAINMENU;
1132 if (game_status==SETUP)
1136 void CalibrateJoystick()
1139 struct joystick joy_ctrl;
1141 struct joystick_control
1153 int new_joystick_xleft, new_joystick_xright, new_joystick_xmiddle;
1154 int new_joystick_yupper, new_joystick_ylower, new_joystick_ymiddle;
1156 if (joystick_status==JOYSTICK_OFF)
1161 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1162 DrawText(SX+16, SY+8*32, " THE UPPER LEFT ",FS_BIG,FC_YELLOW);
1163 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1167 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1169 joy_ctrl.buttons = 0;
1171 while(Joystick() & JOY_BUTTON);
1173 while(!(joy_ctrl.b1||joy_ctrl.b2))
1175 while(!joy_ctrl.buttons)
1178 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1180 joystick_status=JOYSTICK_OFF;
1186 new_joystick_xleft = joy_ctrl.x;
1187 new_joystick_yupper = joy_ctrl.y;
1190 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1191 DrawText(SX+32, SY+8*32, "THE LOWER RIGHT",FS_BIG,FC_YELLOW);
1192 DrawText(SX+16, SY+9*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1196 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1198 joy_ctrl.buttons = 0;
1200 while(Joystick() & JOY_BUTTON);
1202 while(!(joy_ctrl.b1||joy_ctrl.b2))
1204 while(!joy_ctrl.buttons)
1207 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1209 joystick_status=JOYSTICK_OFF;
1215 new_joystick_xright = joy_ctrl.x;
1216 new_joystick_ylower = joy_ctrl.y;
1219 DrawText(SX+32, SY+16+7*32, "CENTER JOYSTICK",FS_BIG,FC_YELLOW);
1220 DrawText(SX+16, SY+16+8*32, "AND PRESS BUTTON",FS_BIG,FC_YELLOW);
1224 joy_ctrl.b1 = joy_ctrl.b2 = 0;
1226 joy_ctrl.buttons = 0;
1228 while(Joystick() & JOY_BUTTON);
1230 while(!(joy_ctrl.b1||joy_ctrl.b2))
1232 while(!joy_ctrl.buttons)
1235 if (read(joystick_device, &joy_ctrl, sizeof(joy_ctrl)) != sizeof(joy_ctrl))
1237 joystick_status=JOYSTICK_OFF;
1243 new_joystick_xmiddle = joy_ctrl.x;
1244 new_joystick_ymiddle = joy_ctrl.y;
1246 joystick[joystick_nr].xleft = new_joystick_xleft;
1247 joystick[joystick_nr].yupper = new_joystick_yupper;
1248 joystick[joystick_nr].xright = new_joystick_xright;
1249 joystick[joystick_nr].ylower = new_joystick_ylower;
1250 joystick[joystick_nr].xmiddle = new_joystick_xmiddle;
1251 joystick[joystick_nr].ymiddle = new_joystick_ymiddle;
1253 CheckJoystickData();
1256 while(Joystick() & JOY_BUTTON);
1264 joy_nr[1] = SETUP_2ND_JOYSTICK_ON(local_player->setup)+49;
1269 DrawText(SX+32, SY+7*32, "CENTER JOYSTICK",FS_BIG,FC_YELLOW);
1270 DrawText(SX+16+7*32, SY+8*32, joy_nr, FS_BIG,FC_YELLOW);
1271 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1274 for(clear_keybuf();!keypressed(););
1275 install_joystick(JOY_TYPE_2PADS);
1278 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1279 DrawText(SX+16, SY+8*32, " THE UPPER LEFT ",FS_BIG,FC_YELLOW);
1280 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1283 for(clear_keybuf();!keypressed(););
1284 calibrate_joystick(SETUP_2ND_JOYSTICK_ON(local_player->setup));
1287 DrawText(SX+16, SY+7*32, "MOVE JOYSTICK TO",FS_BIG,FC_YELLOW);
1288 DrawText(SX+32, SY+8*32, "THE LOWER RIGHT",FS_BIG,FC_YELLOW);
1289 DrawText(SX+32, SY+9*32, "AND PRESS A KEY",FS_BIG,FC_YELLOW);
1292 for(clear_keybuf();!keypressed(););
1293 calibrate_joystick(SETUP_2ND_JOYSTICK_ON(local_player->setup));
1300 DrawText(SX+16, SY+16, "NO JOYSTICK",FS_BIG,FC_YELLOW);
1301 DrawText(SX+16, SY+48, " AVAILABLE ",FS_BIG,FC_YELLOW);
1307 void HandleGameActions(byte player_action)
1309 if (game_status != PLAYING)
1312 if (local_player->LevelSolved)
1315 if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
1318 GameActions(player_action);
1323 void HandleVideoButtons(int mx, int my, int button)
1325 if (game_status != MAINMENU && game_status != PLAYING)
1328 switch(CheckVideoButtons(mx,my,button))
1330 case BUTTON_VIDEO_EJECT:
1332 if (TAPE_IS_EMPTY(tape))
1334 LoadLevelTape(level_nr);
1335 if (TAPE_IS_EMPTY(tape))
1336 Request("No tape for this level !",REQ_CONFIRM);
1341 SaveLevelTape(tape.level_nr);
1344 DrawCompleteVideoDisplay();
1346 case BUTTON_VIDEO_STOP:
1349 case BUTTON_VIDEO_PAUSE:
1352 case BUTTON_VIDEO_REC:
1353 if (TAPE_IS_STOPPED(tape))
1355 TapeStartRecording();
1356 game_status = PLAYING;
1359 else if (tape.pausing)
1361 if (tape.playing) /* PLAYING -> PAUSING -> RECORDING */
1363 tape.pos[tape.counter].delay = tape.delay_played;
1364 tape.playing = FALSE;
1365 tape.recording = TRUE;
1366 tape.changed = TRUE;
1368 DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON,0);
1374 case BUTTON_VIDEO_PLAY:
1375 if (TAPE_IS_EMPTY(tape))
1378 if (TAPE_IS_STOPPED(tape))
1381 game_status = PLAYING;
1384 else if (tape.playing)
1386 if (tape.pausing) /* PAUSE -> PLAY */
1388 else if (!tape.fast_forward) /* PLAY -> FAST FORWARD PLAY */
1390 tape.fast_forward = TRUE;
1391 DrawVideoDisplay(VIDEO_STATE_FFWD_ON, 0);
1393 else if (!tape.pause_before_death) /* FFWD PLAY -> + AUTO PAUSE */
1395 tape.pause_before_death = TRUE;
1396 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, VIDEO_DISPLAY_LABEL_ONLY);
1398 else /* -> NORMAL PLAY */
1400 tape.fast_forward = FALSE;
1401 tape.pause_before_death = FALSE;
1402 DrawVideoDisplay(VIDEO_STATE_FFWD_OFF | VIDEO_STATE_PAUSE_OFF, 0);
1413 void HandleSoundButtons(int mx, int my, int button)
1415 if (game_status != PLAYING)
1418 switch(CheckSoundButtons(mx,my,button))
1420 case BUTTON_SOUND_MUSIC:
1423 sound_music_on = FALSE;
1424 local_player->setup &= ~SETUP_SOUND_MUSIC;
1425 FadeSound(background_loop[level_nr % num_bg_loops]);
1426 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1428 else if (sound_loops_allowed)
1430 sound_on = sound_music_on = TRUE;
1431 local_player->setup |= (SETUP_SOUND | SETUP_SOUND_MUSIC);
1432 PlaySoundLoop(background_loop[level_nr % num_bg_loops]);
1433 DrawSoundDisplay(BUTTON_SOUND_MUSIC_ON);
1436 DrawSoundDisplay(BUTTON_SOUND_MUSIC_OFF);
1438 case BUTTON_SOUND_LOOPS:
1441 sound_loops_on = FALSE;
1442 local_player->setup &= ~SETUP_SOUND_LOOPS;
1443 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1445 else if (sound_loops_allowed)
1447 sound_on = sound_loops_on = TRUE;
1448 local_player->setup |= (SETUP_SOUND | SETUP_SOUND_LOOPS);
1449 DrawSoundDisplay(BUTTON_SOUND_LOOPS_ON);
1452 DrawSoundDisplay(BUTTON_SOUND_LOOPS_OFF);
1454 case BUTTON_SOUND_SIMPLE:
1455 if (sound_simple_on)
1457 sound_simple_on = FALSE;
1458 local_player->setup &= ~SETUP_SOUND;
1459 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1461 else if (sound_status==SOUND_AVAILABLE)
1463 sound_on = sound_simple_on = TRUE;
1464 local_player->setup |= SETUP_SOUND;
1465 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_ON);
1468 DrawSoundDisplay(BUTTON_SOUND_SIMPLE_OFF);
1477 void HandleGameButtons(int mx, int my, int button)
1479 if (game_status != PLAYING)
1482 switch(CheckGameButtons(mx,my,button))
1484 case BUTTON_GAME_STOP:
1487 CloseDoor(DOOR_CLOSE_1);
1488 game_status = MAINMENU;
1493 if (Request("Do you really want to quit the game ?",
1494 REQ_ASK | REQ_STAY_CLOSED))
1496 game_status = MAINMENU;
1500 OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
1502 case BUTTON_GAME_PAUSE:
1505 tape.pausing = FALSE;
1506 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);
1510 tape.pausing = TRUE;
1511 DrawVideoDisplay(VIDEO_STATE_PAUSE_ON,0);
1514 case BUTTON_GAME_PLAY:
1517 tape.pausing = FALSE;
1518 DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);