home *** CD-ROM | disk | FTP | other *** search
/ Crazy Pacman / CrazyPacman.iso / pacman / PACMAN / SOURCE / P_PACMAN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-17  |  72.9 KB  |  2,608 lines

  1. #include "p_pacman.h"
  2.  
  3. unsigned long int            Punkte=0;
  4. int                          fressen_max=100;
  5. int                          fressen=0;
  6. int                          max_bonus=1;
  7. int                          unsterblich=0;
  8. int                          demo=0;
  9. int                          START_LEBEN=5;
  10. int                          NO_HIGH=0;
  11. LAB_CODE                     Labyrinth;
  12. LAB_CODE                     test_lab;
  13. DOT                          dots[40];
  14. unsigned long int            Life_counter;
  15. unsigned long int            Geist_wert;
  16. int                          richt,Leben,Level,akt_speed;
  17. int                          speed[5], speed_change[5];
  18. int                          ghost_dir[5][4], ghost_richt[5], ghost_angst[5], ghost_last[5];
  19. int                          Eyes[5];
  20. int                          Geist_zahl[5];
  21. int                          Level_punkte;
  22. int                          B_Zeit;
  23. int                          Zeit,B_Flag,Z_Count;
  24. int                          in_a_row,Extra;
  25. int                          in_a_dot;
  26. int                          ExtraBonus;
  27. int                          Extra_Time;
  28. int                          geschenk_x,geschenk_y,geschenk_flag,Geschenk;
  29. int                          Fear,stop,slow;
  30. int                          Tod,t;
  31. int                          Start_Level;
  32. int                          Level_Count;
  33. int                          Ghost_fressen;
  34. int                          NO_HIGH;
  35. int                          shield,uhr,mal;
  36. int                          Akt_speed;
  37. char                        *LAB[10],*DOT1[9],*DOT2[9],*TITEL,*DESC[10];
  38. HIGH High_Score=
  39. {
  40.  {
  41.   "Chris         ",
  42.   "Chris         ",
  43.   "Chris         ",
  44.   "Chris         ",
  45.   "Chris         ",
  46.   "Chris         ",
  47.   "Chris         ",
  48.   "Chris         ",
  49.   "Chris         ",
  50.   "Chris         ",
  51.  },
  52.  {
  53.   (unsigned long int) 9,
  54.   (unsigned long int) 8,
  55.   (unsigned long int) 7,
  56.   (unsigned long int) 6,
  57.   (unsigned long int) 5,
  58.   (unsigned long int) 4,
  59.   (unsigned long int) 3,
  60.   (unsigned long int) 2,
  61.   (unsigned long int) 1,
  62.   (unsigned long int) 0,
  63.  },
  64.  {
  65.   (int) 9,
  66.   (int) 8,
  67.   (int) 7,
  68.   (int) 6,
  69.   (int) 5,
  70.   (int) 4,
  71.   (int) 3,
  72.   (int) 2,
  73.   (int) 1,
  74.   (int) 0
  75.  },
  76. };
  77. /*
  78. /////////////////////////////////////////////////////////////////////
  79. */
  80. void show_high(void)
  81. {
  82.  int ff=0;
  83.  setpage(0);
  84.  showpage(1);
  85.  show_pic(0,0,15,"pix\\h-liste");
  86.  while (ff<10)
  87.  {
  88.   gprintf(55,180+17*ff,15*16+2,15*16+5,"%i",ff+1);
  89.   gprintf(75,180+17*ff,15*16+2,15*16+5,"%s",High_Score.Name[ff]);
  90.   gprintf(75+14*8,180+17*ff,15*16+2,15*16+5,"%ld",High_Score.Score[ff]);
  91.   gprintf(75+22*8,180+17*ff,15*16+2,15*16+5,"%d",High_Score.Level[ff] );
  92.   ff++;
  93.  }
  94. }
  95. /*
  96. /////////////////////////////////////////////////////////////////////
  97. */
  98. void Gefressen(void)
  99. {
  100.  for ( x = RED; x < LILA+1; ++ x)
  101.  {
  102.   if (Eyes[x])
  103.   {
  104.    if (Eyes[x]>1)
  105.    {
  106.     Eyes[x]--;
  107.     sprites[x].spidp->splookp = Zahl(Geist_zahl[x]*mal,sprites[x].spidp->splookp);
  108.    }
  109.    else
  110.     sprites[x].spidp->splookp = augen[sprites[x].richtung];
  111.   }
  112.  }
  113. }
  114. /*
  115. /////////////////////////////////////////////////////////////////////
  116. */
  117. void draw_ghost(int anim)
  118. {
  119.  if (ghost_angst[RED])
  120.   if ((fressen>100)||(fressen%2))
  121.    sprites[RED].spidp->splookp = red[BLAU][anim];
  122.  if (ghost_angst[GELB])
  123.   if ((fressen>100)||(fressen%2))
  124.    sprites[GELB].spidp->splookp = gelb[BLAU][anim];
  125.  if (ghost_angst[LILA])
  126.   if ((fressen>100)||(fressen%2))
  127.    sprites[LILA].spidp->splookp = lila[BLAU][anim];
  128.  if (ghost_angst[GRUEN])
  129.   if ((fressen>100)||(fressen%2))
  130.    sprites[GRUEN].spidp->splookp = gruen[BLAU][anim];
  131. }
  132. /*
  133. /////////////////////////////////////////////////////////////////////
  134. */
  135. void bilder(void)
  136. {
  137.  switch (bild)
  138.  {
  139.   case  PHASE:
  140.   {
  141.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][1];
  142.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][1];
  143.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][1];
  144.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][1];
  145.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][1];
  146.    draw_ghost(1);
  147.    Gefressen();
  148.    break;
  149.   }
  150.   case  2*PHASE:
  151.   {
  152.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][2];
  153.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][2];
  154.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][2];
  155.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][2];
  156.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][2];
  157.    draw_ghost(2);
  158.    Gefressen();
  159.    break;
  160.   }
  161.   case  3*PHASE:
  162.   {
  163.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][3];
  164.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][1];
  165.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][1];
  166.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][1];
  167.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][1];
  168.    draw_ghost(1);
  169.    Gefressen();
  170.    break;
  171.   }
  172.   case  4*PHASE:
  173.   {
  174.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][4];
  175.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][0];
  176.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][0];
  177.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][0];
  178.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][0];
  179.    draw_ghost(0);
  180.    Gefressen();
  181.    break;
  182.   }
  183.   case  5*PHASE:
  184.   {
  185.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][3];
  186.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][1];
  187.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][1];
  188.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][1];
  189.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][1];
  190.    draw_ghost(1);
  191.    Gefressen();
  192.    break;
  193.   }
  194.   case  6*PHASE:
  195.   {
  196.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][2];
  197.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][2];
  198.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][2];
  199.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][2];
  200.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][2];
  201.    draw_ghost(2);
  202.    Gefressen();
  203.    break;
  204.   }
  205.   case  7*PHASE:
  206.   {
  207.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][1];
  208.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][1];
  209.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][1];
  210.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][1];
  211.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][1];
  212.    draw_ghost(1);
  213.    Gefressen();
  214.    break;
  215.   }
  216.   case  8*PHASE:
  217.   {
  218.    sprites[PACMAN].spidp->splookp = Pac[sprites[PACMAN].richtung][0];
  219.    sprites[RED].spidp->splookp = red[sprites[RED].richtung][0];
  220.    sprites[GELB].spidp->splookp = gelb[sprites[GELB].richtung][0];
  221.    sprites[LILA].spidp->splookp = lila[sprites[LILA].richtung][0];
  222.    sprites[GRUEN].spidp->splookp = gruen[sprites[GRUEN].richtung][0];
  223.    draw_ghost(0);
  224.    Gefressen();
  225.    break;
  226.   }
  227.  }
  228. }
  229. /*
  230. /////////////////////////////////////////////////////////////////////
  231. */
  232. void sp_init(void)
  233. {
  234.  dir=lastkey=0;
  235.  page=1;
  236.  speed[PACMAN]=Labyrinth.pac_speed;
  237.  speed[RED]=Labyrinth.geister_speed[RED-1];
  238.  speed[GELB]=Labyrinth.geister_speed[GELB-1];
  239.  speed[GRUEN]=Labyrinth.geister_speed[GRUEN-1];
  240.  speed[LILA]=Labyrinth.geister_speed[LILA-1];
  241.  speed_change[0]=0;
  242.  speed_change[1]=0;
  243.  speed_change[2]=0;
  244.  speed_change[3]=0;
  245.  speed_change[4]=0;
  246.  Eyes[0]=0;
  247.  Eyes[1]=0;
  248.  Eyes[2]=0;
  249.  Eyes[3]=0;
  250.  Eyes[4]=0;
  251.  fressen=0;
  252.  ghost_angst[RED]=0;
  253.  ghost_angst[LILA]=0;
  254.  ghost_angst[GELB]=0;
  255.  ghost_angst[GRUEN]=0;
  256.  Geschenk=0;
  257.  geschenk_x=-1;
  258.  geschenk_y=-1;
  259.  Fear=0;
  260.  stop=0;
  261.  slow=0;
  262.  shield=0;
  263.  uhr=0;
  264.  mal=1;
  265.  sprites[ PACMAN ].spidp->splookp = Pac[WEST][0];
  266.  dx =0; /* Geschwindihkeit */
  267.  dy =0;
  268.  ddx=0;
  269.  ddy=0;
  270.  richt=1;
  271.  sprites[ PACMAN ].deltax[0] = sprites[ PACMAN ].deltax[1] = dx * 2;
  272.  sprites[ PACMAN ].deltay[0] = sprites[ PACMAN ].deltay[1] = dy * 2;
  273.  sprites[PACMAN].richtung=OST;
  274.  x=Labyrinth.Pac_x*32-12;
  275.  y=Labyrinth.Pac_y*40-16;
  276.  SetSprite(sprites[PACMAN].spidp, x, y, x-dx, y-dy);
  277.  sprites[ RED ].spidp->splookp = red[OST][0];
  278.  dx =speed[RED];
  279.  dy =0;
  280.  ghost_richt[RED]=1;
  281.  ghost_last[RED]=2;
  282.  sprites[ RED ].deltax[0] = sprites[ RED ].deltax[1] = dx * 2;
  283.  sprites[ RED ].deltay[0] = sprites[ RED ].deltay[1] = dy * 2;
  284.  sprites[RED].richtung=OST;
  285.  x=Labyrinth.red_x*32-12;
  286.  y=Labyrinth.red_y*40-16;
  287.  SetSprite( sprites[ RED ].spidp, x, y, x - dx, y - dy );
  288.  sprites[ GELB ].spidp->splookp = gelb[WEST][0];
  289.  dx=-speed[GELB];
  290.  dy=0;
  291.  ghost_richt[GELB]=-1;
  292.  ghost_last[GELB]=1;
  293.  sprites[ GELB ].deltax[0] = sprites[ GELB ].deltax[1] = dx * 2;
  294.  sprites[ GELB ].deltay[0] = sprites[ GELB ].deltay[1] = dy * 2;
  295.  sprites[GELB].richtung=WEST;
  296.  x=Labyrinth.gelb_x*32-12;
  297.  y=Labyrinth.gelb_y*40-16;
  298.  SetSprite( sprites[ GELB ].spidp, x, y, x - dx, y - dy );
  299.  sprites[ LILA ].spidp->splookp = lila[NORD][0] ;
  300.  dx=0;
  301.  dy=-speed[LILA];
  302.  ghost_richt[LILA]=-1;
  303.  ghost_last[LILA]=3;
  304.  sprites[ LILA ].deltax[0] = sprites[ LILA ].deltax[1] = dx * 2;
  305.  sprites[ LILA ].deltay[0] = sprites[ LILA ].deltay[1] = dy * 2;
  306.  sprites[LILA].richtung=NORD;
  307.  x=Labyrinth.lila_x*32-12;
  308.  y=Labyrinth.lila_y*40-16;
  309.  SetSprite( sprites[ LILA ].spidp, x, y, x - dx, y - dy );
  310.  sprites[ GRUEN ].spidp->splookp = gruen[SUED][0];
  311.  dx=0;
  312.  dy=speed[GRUEN];
  313.  ghost_richt[GRUEN]=1;
  314.  ghost_last[GRUEN]=0;
  315.  sprites[ GRUEN ].deltax[0] = sprites[ GRUEN ].deltax[1] = dx * 2;
  316.  sprites[ GRUEN ].deltay[0] = sprites[ GRUEN ].deltay[1] = dy * 2;
  317.  sprites[ GRUEN ].richtung=SUED;
  318.  x=Labyrinth.gruen_x*32-12;
  319.  y=Labyrinth.gruen_y*40-16;
  320.  SetSprite( sprites[ GRUEN ].spidp, x, y, x - dx, y - dy );
  321.  dx=0;
  322.  dy=0;
  323.  set_color(255,0,0,0);
  324.  x=Labyrinth.Pac_x-1;
  325.  y=Labyrinth.Pac_y-1;
  326.  if (Labyrinth.dots[y][x]!='z')
  327.  {
  328.   if (dots[((int) Labyrinth.dots[y][x])-((int) '.')].Art==0)
  329.   {
  330.    PutBack(Back,dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv,(int) x*32+32-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->width,(int) y*40+40-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->hight);
  331.    Punkte+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  332.    Life_counter+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  333.    Level_punkte+=1;
  334.    in_a_row=0;
  335.    in_a_dot++;
  336.    Labyrinth.dots[y][x]=' ';
  337.   }
  338.  }
  339.  Print_Score_whole(Punkte);
  340.  dx=0;
  341.  dy=0;
  342. }
  343. /*
  344. /////////////////////////////////////////////////////////////////////
  345. */
  346. unsigned long int Game(void)
  347. {
  348.  int xt,yt;
  349.  int i;
  350.  Life_counter=0;
  351.  fressen_max=500;
  352.  Leben=START_LEBEN;
  353.  Extra=0;
  354.  B_Zeit=0;
  355.  while ((key!=27)&&((Leben)||(Extra)))
  356.  {
  357.   K_Clear();
  358.   fressen=0;
  359.   ghost_angst[RED]=0;
  360.   ghost_angst[LILA]=0;
  361.   ghost_angst[GELB]=0;
  362.   ghost_angst[GRUEN]=0;
  363.   if (Extra==3)
  364.   {
  365.    Extra=0;
  366.    Leben++;
  367.   }
  368.   if ((Level_punkte==Labyrinth.dot_anzahl)&&(Extra==2))
  369.   {
  370.    setpage(0);
  371.    showpage(1);
  372.    show_pic(73,140,15,"pix\\punkte");
  373.    showpage(0);
  374.    warte_d(130);
  375.    Punkte+=50000L;
  376.    Life_counter+=50000L;
  377.    life();
  378.    Extra=0;
  379.   }
  380.   if (!Extra)
  381.   {
  382.    get_lab(Level);
  383.    build();
  384.    Back=Save_Back(0,Back);
  385.    Get_Back(1,Back);
  386.    Do_Infor();
  387.    GrafPrintf(295,389,20,0,"%i",Leben);
  388.    Level++;
  389.    Level_Count++;
  390.    B_Zeit=0;
  391.   }
  392.   else
  393.   {
  394.    if ((in_a_row<4)&&(!ExtraBonus)&&(in_a_dot==Labyrinth.Max_dot))
  395.     do_akt(Level);
  396.    setpage(0);
  397.    showpage(1);
  398.    show_pic(73,140,14,"pix\\b_level");
  399.    showpage(0);
  400.    warte_d(130);
  401.    get_Extra();
  402.    build();
  403.    Back=Save_Back(0,Back);
  404.    Get_Back(1,Back);
  405.    B_Zeit=1;
  406.   }
  407.   in_a_row=0;
  408.   in_a_dot=0;
  409.   Extra_Time=0;
  410.   ExtraBonus=0;
  411.   Zeit=0;
  412.   Z_Count=0;
  413.   Level_punkte=0;
  414.   sp_init();
  415.   if (B_Zeit)
  416.    Extra=2;
  417.   B_Flag=0;
  418.   B_Zeit=0;
  419.   page=1;
  420.   showpage(0);
  421.   play_sample(START);
  422.   while (( key!=27 )&&(Level_punkte!=Labyrinth.dot_anzahl)&&(Leben)&&(Extra!=1)&&(Extra!=3))
  423.   {
  424.    Tod=0;
  425.    warte();
  426.    for ( i = RED; i < LILA+1; ++ i)
  427.    {
  428.     if ( (abs(sprites[i].spidp->x[1-page]-sprites[PACMAN].spidp->x[1-page])<10)
  429.          &&(abs(sprites[i].spidp->y[1-page]-sprites[PACMAN].spidp->y[1-page])<10)
  430.          &&(!Eyes[i]) )
  431.     {
  432.      if ((!shield)&&(!ghost_angst[i]) && (!unsterblich))
  433.       Tod=1;
  434.      else
  435.       if (ghost_angst[i])
  436.        Tod=2;
  437.     }
  438.    }
  439.    if (Tod)
  440.    {
  441.     if (Tod==1)
  442.     {
  443.      play_sample(DEAD);
  444.      if (!Extra)
  445.      {
  446.       GrafPrintf(100,390,0,20,"DU BIST TOT !!!");
  447.      }
  448.      else
  449.      {
  450.       GrafPrintf(100,390,0,20,"Kein Bonus !!!");
  451.       Extra=3;
  452.      }
  453.      for ( i = 0; i < SPRANZ; ++ i)
  454.      {
  455.       RemoveSprite(sprites[i].spidp);
  456.      }
  457.      if ((Extra_Time)&&(ExtraBonus==14))
  458.      {
  459.       for ( xt = 1; xt < 10 ; ++ xt)
  460.       {
  461.        for ( yt = 1; yt < 10 ; ++ yt)
  462.        {
  463.         if ((Labyrinth.dots[yt-1][xt-1]!='x')&&(Labyrinth.dots[yt-1][xt-1]!=' ')&&(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].Art==0))
  464.         {
  465.          PutVideo(dots[37].dotv,0,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight,FALSE);
  466.          PutVideo(dots[37].dotv,1,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight,FALSE);
  467.          PutBack(Back,dots[37].dotv,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight);
  468.          Labyrinth.dots[yt-1][xt-1]=Labyrinth.restore[yt-1][xt-1];
  469.          PutVideo(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,0,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight,FALSE);
  470.          PutVideo(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,1,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight,FALSE);
  471.          PutBack(Back,dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight);
  472.         }
  473.        }
  474.       }
  475.       ExtraBonus=0;
  476.      }
  477.      page=0;
  478.      sprites[PACMAN].spidp->splookp = dead[0];
  479.      x=sprites[PACMAN].spidp->x[1-page];
  480.      y=sprites[PACMAN].spidp->y[1-page];
  481.      SetSprite( sprites[ PACMAN ].spidp,x,y,x,y);
  482.      for ( i = 0; i < 14; ++ i)
  483.      {
  484.       showpage((BYTE) (1-page));
  485.       RestoreSpriteBg( sprites[PACMAN].spidp, page );
  486.       sprites[PACMAN].spidp->splookp = dead[i];
  487.       PrintSprite( sprites[PACMAN].spidp, page );
  488. # ifndef NO_SOUND
  489. # ifndef SHAREWARE_SOUND
  490.       if (sample_on)
  491.        warte_d(7);
  492.       else
  493. # endif
  494. # endif
  495.        warte_d(4);
  496.       page = (page+1) & 1;
  497.      }
  498.      RestoreSpriteBg( sprites[PACMAN].spidp, 0 );
  499.      RestoreSpriteBg( sprites[PACMAN].spidp, 1 );
  500.      RemoveSprite(sprites[PACMAN].spidp);
  501.      sp_init();
  502.      if (Extra_Time)
  503.       Extra_Time=1;
  504.      K_Clear();
  505. # ifndef NO_SOUND
  506. # ifndef SHAREWARE_SOUND
  507.      if (sample_on)
  508.       warte_d(45);
  509. # endif
  510. # endif
  511.      Leben--;
  512.      if (!Extra)
  513.       GrafPrintf(295,389,20,0,"%i ",Leben);
  514.      warte_d(8);
  515.      GrafPrintf(100,390,0,0,    "                   ");
  516.      if ((!Extra)&&(Leben))
  517.      {
  518.       play_sample(START);
  519.       warte_d(2);
  520.       K_Clear();
  521.       while (!get_key());
  522.      }
  523.     }
  524.     if (Tod==2)
  525.     {
  526.      for ( i = RED; i < LILA+1; ++ i)
  527.      {
  528.       if ( (abs(sprites[i].spidp->x[1-page]-sprites[PACMAN].spidp->x[1-page])<10)
  529.             &&(abs(sprites[i].spidp->y[1-page]-sprites[PACMAN].spidp->y[1-page])<10)
  530.             && (!Eyes[i]) )
  531.       {
  532.        if (Ghost_fressen==0)
  533.         ghost_angst[i]=0;
  534.        speed[i]=Labyrinth.eye_speed;
  535.        speed_change[i]=1;
  536.        Eyes[i]=130;
  537.        Punkte+=Geist_wert*mal;
  538.        Life_counter+=Geist_wert*mal;
  539.        play_sample(FRESSEN);
  540.        life();
  541.        Geist_zahl[i]=(unsigned int) Geist_wert;
  542.        if (Geist_wert<60000L)
  543.         Geist_wert*=2;
  544.        Print_Score(Punkte);
  545.       }
  546.      }
  547.     }
  548.    }
  549.    showpage((BYTE) (1-page));
  550.    if (fressen==1)
  551.    {
  552.     ghost_angst[RED]=0;
  553.     ghost_angst[GELB]=0;
  554.     ghost_angst[GRUEN]=0;
  555.     ghost_angst[LILA]=0;
  556.    }
  557.    if ((fressen==1)&&(!stop)&&(!slow))
  558.    {
  559.     if (!Eyes[RED])
  560.     {
  561.      speed[RED]=Labyrinth.geister_speed[RED-1];
  562.      speed_change[RED]=1;
  563.     }
  564.     if (!Eyes[GELB])
  565.     {
  566.      speed[GELB]=Labyrinth.geister_speed[GELB-1];
  567.      speed_change[GELB]=1;
  568.     }
  569.     if (!Eyes[GRUEN])
  570.     {
  571.      speed[GRUEN]=Labyrinth.geister_speed[GRUEN-1];
  572.      speed_change[GRUEN]=1;
  573.     }
  574.     if (!Eyes[LILA])
  575.     {
  576.      speed[LILA]=Labyrinth.geister_speed[LILA-1];
  577.      speed_change[LILA]=1;
  578.     }
  579.    }
  580.    if (B_Zeit==1)
  581.    {
  582.     Zeit=0;
  583.     if (Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]=='z')
  584.     {
  585.      Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]=' ';
  586.      if (ExtraBonus)
  587.      {
  588.       PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  589.       PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  590.       PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  591.       ExtraBonus=0;
  592.      }
  593.      else
  594.      {
  595.       PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  596.       PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  597.       PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  598.      }
  599.     }
  600.     if (Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]=='y')
  601.     {
  602.      Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]=Labyrinth.restore[Labyrinth.Bonus_y][Labyrinth.Bonus_x];
  603.      if (ExtraBonus)
  604.      {
  605.       PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  606.       PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  607.       PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  608.       ExtraBonus=0;
  609.      }
  610.      else
  611.      {
  612.       PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  613.       PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  614.       PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  615.      }
  616.      PutBack(Back,dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot,(int) Labyrinth.Bonus_x*32+32-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->width,(int) Labyrinth.Bonus_y*40+40-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->hight);
  617.      PutVideo(dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot,0,Labyrinth.Bonus_x*32+32-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->width,Labyrinth.Bonus_y*40+40-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->hight,FALSE);
  618.      PutVideo(dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot,1,Labyrinth.Bonus_x*32+32-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->width,Labyrinth.Bonus_y*40+40-dots[((int) Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x])-((int) '.')].dot->hight,FALSE);
  619.     }
  620.    }
  621.    if ((!B_Zeit)&&(Zeit==1500)&&(!Extra))
  622.    {
  623.     B_Zeit=400;
  624.     if (Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]!=' ')
  625.      Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]='y';
  626.     else
  627.      Labyrinth.dots[Labyrinth.Bonus_y][Labyrinth.Bonus_x]='z';
  628.     if (random(100)<70)
  629.     {
  630.      PutBack(Back,Bonus[Labyrinth.Bonus],(int) Labyrinth.Bonus_x*32+32-Bonus[Labyrinth.Bonus]->width,(int) Labyrinth.Bonus_y*40+40-Bonus[Labyrinth.Bonus]->hight);
  631.      PutVideo(Bonus[Labyrinth.Bonus],0,Labyrinth.Bonus_x*32+32-Bonus[Labyrinth.Bonus]->width,Labyrinth.Bonus_y*40+40-Bonus[Labyrinth.Bonus]->hight,FALSE);
  632.      PutVideo(Bonus[Labyrinth.Bonus],1,Labyrinth.Bonus_x*32+32-Bonus[Labyrinth.Bonus]->width,Labyrinth.Bonus_y*40+40-Bonus[Labyrinth.Bonus]->hight,FALSE);
  633.     }
  634.     else
  635.     {
  636.      i=random(160)+1;
  637.      if (i>150)
  638.      {
  639.       ExtraBonus=16;   /* Uhr */
  640.       i=-1;
  641.      }
  642.      if (i>140)
  643.      {
  644.       ExtraBonus=15;   /* Schild */
  645.       i=-1;
  646.      }
  647.      if (i>130)
  648.      {
  649.       ExtraBonus=14;   /* Diamant */
  650.       i=-1;
  651.      }
  652.      if (i>120)
  653.      {
  654.       ExtraBonus=13;   /* 5 Mal */
  655.       i=-1;
  656.      }
  657.      if (i>110)
  658.      {
  659.       ExtraBonus=12;   /* 2 Mal */
  660.       i=-1;
  661.      }
  662.      if (i>100)
  663.      {
  664.       ExtraBonus=11;   /* Explode */
  665.       i=-1;
  666.      }
  667.      if (i>90)
  668.      {
  669.       ExtraBonus=1;   /* Extra Level */
  670.       i=-1;
  671.      }
  672.      if (i>80)
  673.      {               /* Speedup I */
  674.       ExtraBonus=2;
  675.       i=-1;
  676.      }
  677.      if (i>70)
  678.      {               /* Speedup II */
  679.       ExtraBonus=3;
  680.       i=-1;
  681.      }
  682.      if (i>60)
  683.      {               /* Geschenk */
  684.       ExtraBonus=4;
  685.       geschenk_x=-1;
  686.       geschenk_y=-1;
  687.       i=-1;
  688.      }
  689.      if (i>50)
  690.      {               /* Life */
  691.       ExtraBonus=5;
  692.       i=-1;
  693.      }
  694.      if (i>40)
  695.      {               /* Fear */
  696.       ExtraBonus=6;
  697.       i=-1;
  698.      }
  699.      if (i>30)
  700.      {               /* nextv */
  701.       ExtraBonus=7;
  702.       i=-1;
  703.      }
  704.      if (i>20)
  705.      {               /* teleport */
  706.       ExtraBonus=8;
  707.       i=-1;
  708.      }
  709.      if (i>10)
  710.      {               /* stop */
  711.       ExtraBonus=9;
  712.       i=-1;
  713.      }
  714.      if (i>0)
  715.      {               /* slow */
  716.       if (Labyrinth.geister_speed[RED-1]>1)
  717.        ExtraBonus=10;
  718.       else
  719.        ExtraBonus=9;
  720.       i=-1;
  721.      }
  722.      if (ExtraBonus)
  723.      {
  724.       PutBack(Back,Extra_Bonus[ExtraBonus-1],(int) Labyrinth.Bonus_x*32+32-Extra_Bonus[ExtraBonus-1]->width,(int) Labyrinth.Bonus_y*40+40-Extra_Bonus[ExtraBonus-1]->hight);
  725.       PutVideo(Extra_Bonus[ExtraBonus-1],0,Labyrinth.Bonus_x*32+32-Extra_Bonus[ExtraBonus-1]->width,Labyrinth.Bonus_y*40+40-Extra_Bonus[ExtraBonus-1]->hight,FALSE);
  726.       PutVideo(Extra_Bonus[ExtraBonus-1],1,Labyrinth.Bonus_x*32+32-Extra_Bonus[ExtraBonus-1]->width,Labyrinth.Bonus_y*40+40-Extra_Bonus[ExtraBonus-1]->hight,FALSE);
  727.      }
  728.     }
  729.    }
  730.    if (B_Zeit)
  731.     B_Zeit--;
  732.    if (fressen)
  733.     fressen--;
  734.    if (Extra_Time)
  735.    {
  736.     set_color(255,0,Extra_Time/13,0);
  737.     Extra_Time--;
  738.     if ((!Extra_Time)&&(ExtraBonus==2))
  739.     {
  740.      speed_change[PACMAN]=1;
  741.      speed[PACMAN]=Labyrinth.pac_speed;
  742.      ExtraBonus=0;
  743.     }
  744.     if (!Extra_Time)
  745.      GrafPrintf(100,390,0,0,"                 ");
  746.      if ((!Extra_Time)&&(ExtraBonus==3))
  747.      {
  748.       speed_change[PACMAN]=1;
  749.       speed[PACMAN]=Labyrinth.pac_speed;
  750.       ExtraBonus=0;
  751.      }
  752.      if ((!Extra_Time)&&(ExtraBonus==4))
  753.      {
  754.       if (geschenk_x!=-1)
  755.       {
  756.        PutBack(Back,void_Bonus,(int) geschenk_x*32+32-void_Bonus->width,(int) geschenk_y*40+40-void_Bonus->hight);
  757.        PutVideo(void_Bonus,page,geschenk_x*32+32-void_Bonus->width,geschenk_y*40+40-void_Bonus->hight,FALSE);
  758.        PutVideo(void_Bonus,1-page,geschenk_x*32+32-void_Bonus->width,geschenk_y*40+40-void_Bonus->hight,FALSE);
  759.       }
  760.       geschenk_x=-1;
  761.       geschenk_y=-1;
  762.       Geschenk=0;
  763.       ExtraBonus=0;
  764.      }
  765.      if ((!Extra_Time)&&(ExtraBonus==6))
  766.      {
  767.       Fear=0;
  768.       ExtraBonus=0;
  769.      }
  770.      if ((!Extra_Time)&&(ExtraBonus==9))
  771.      {
  772.       stop=0;
  773.       ExtraBonus=0;
  774.       speed[RED]=Labyrinth.geister_speed[RED-1];
  775.       speed_change[RED]=1;
  776.       speed[GELB]=Labyrinth.geister_speed[GELB-1];
  777.       speed_change[GELB]=1;
  778.       speed[GRUEN]=Labyrinth.geister_speed[GRUEN-1];
  779.       speed_change[GRUEN]=1;
  780.       speed[LILA]=Labyrinth.geister_speed[LILA-1];
  781.       speed_change[LILA]=1;
  782.      }
  783.      if ((!Extra_Time)&&(ExtraBonus==10))
  784.      {
  785.       stop=0;
  786.       ExtraBonus=0;
  787.       speed[RED]=Labyrinth.geister_speed[RED-1];
  788.       speed_change[RED]=1;
  789.       speed[GELB]=Labyrinth.geister_speed[GELB-1];
  790.       speed_change[GELB]=1;
  791.       speed[GRUEN]=Labyrinth.geister_speed[GRUEN-1];
  792.       speed_change[GRUEN]=1;
  793.       speed[LILA]=Labyrinth.geister_speed[LILA-1];
  794.       speed_change[LILA]=1;
  795.      }
  796.      if ((!Extra_Time)&&(ExtraBonus==12))
  797.      {
  798.       mal=1;
  799.       ExtraBonus=0;
  800.      }
  801.      if ((!Extra_Time)&&(ExtraBonus==13))
  802.      {
  803.       mal=1;
  804.       ExtraBonus=0;
  805.      }
  806.      if ((!Extra_Time)&&(ExtraBonus==14))
  807.      {
  808.       for ( xt = 1; xt < 10 ; ++ xt)
  809.       {
  810.        for ( yt = 1; yt < 10 ; ++ yt)
  811.        {
  812.         if ((Labyrinth.dots[yt-1][xt-1]!='x')&&(Labyrinth.dots[yt-1][xt-1]!=' ')&&(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].Art==0))
  813.         {
  814.          PutVideo(dots[37].dotv,0,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight,FALSE);
  815.          PutVideo(dots[37].dotv,1,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight,FALSE);
  816.          PutBack(Back,dots[37].dotv,xt*32-dots[37].dotv->width,yt*40-dots[37].dotv->hight);
  817.          Labyrinth.dots[yt-1][xt-1]=Labyrinth.restore[yt-1][xt-1];
  818.          PutVideo(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,0,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight,FALSE);
  819.          PutVideo(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,1,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight,FALSE);
  820.          PutBack(Back,dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot,xt*32-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->width,yt*40-dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].dot->hight);
  821.         }
  822.        }
  823.       }
  824.       ExtraBonus=0;
  825.      }
  826.      if ((!Extra_Time)&&(ExtraBonus==15))
  827.      {
  828.       show_pic(0,0,1,"pix\\pac_gelb");
  829.       shield=0;
  830.       ExtraBonus=0;
  831.      }
  832.     }
  833.     mov_pac();
  834.     mov_ghost(RED);
  835.     mov_ghost(GELB);
  836.     mov_ghost(LILA);
  837.     mov_ghost(GRUEN);
  838.     for ( i = 0; i < SPRANZ; ++ i)
  839.     RestoreSpriteBgNo(i,page);
  840.  
  841. /*   die spritres werden nicht einzeln gerettet, */
  842. /*   im speicher steht der hintergrund vollstaendig drin */
  843. /*   und wird dann gerettet */
  844.  
  845.     for ( i = 0; i < SPRANZ; ++ i)
  846.     {
  847.      out = MoveSprite1(sprites[i].spidp, page, sprites[i].deltax[page],sprites[i].deltay[page]);
  848.      if (out&OUT_TOP || out&OUT_BOTTOM)
  849.      {
  850.       if (sprites[i].deltay[page]>0)
  851.       {
  852.        sprites[i].spidp->y[1-page]=20;
  853.        sprites[i].spidp->y[page]=20+sprites[i].deltay[page]/2;
  854.        sprites[i].spidp->old_y[page]=20+sprites[i].deltay[page]/2;
  855.       }
  856.       else
  857.       {
  858.        sprites[i].spidp->y[1-page]=9*40-12;
  859.        sprites[i].spidp->y[page]=9*40-12+sprites[i].deltay[page]/2;
  860.        sprites[i].spidp->old_y[page]=9*40-12+sprites[i].deltay[page]/2;
  861.       }
  862.      }
  863.      if (out&OUT_LEFT || out&OUT_RIGHT)
  864.      {
  865.       if (sprites[i].deltax[page]>0)
  866.       {
  867.        sprites[i].spidp->x[1-page]=13;
  868.        sprites[i].spidp->x[page]=13+sprites[i].deltax[page]/2;
  869.        sprites[i].spidp->old_x[page]=13+sprites[i].deltax[page]/2;
  870.       }
  871.       else
  872.       {
  873.        sprites[i].spidp->x[1-page]=9*32-5;
  874.        sprites[i].spidp->x[page]=9*32-5+sprites[i].deltax[page]/2;
  875.        sprites[i].spidp->old_x[page]=9*32-5+sprites[i].deltax[page]/2;
  876.       }
  877.      }
  878.     }
  879. /* printen */
  880.     for ( i = 0; i < SPRANZ; ++ i)
  881.     {
  882.      bilder();
  883.      PrintSprite( sprites[i].spidp, page );
  884.     }
  885.     bild++;
  886.     if (bild==PHASE*8+1)
  887.      bild=0;
  888.     page = (page+1) & 1;
  889.     Zeit = (Zeit+1) % 1501;
  890.    }
  891.   if ((Extra_Time)&&(ExtraBonus==15))
  892.    show_pic(0,0,1,"pix\\pac_gelb");
  893.   for ( i = 0; i < SPRANZ; ++ i)
  894.    RemoveSprite(sprites[i].spidp);
  895.   page=0;
  896.   GrafPrintf(100,390,0,0,"                    ");
  897.   if (Extra==1) ExtraBonus=0;
  898.  }
  899.  if (!Leben)
  900.  {
  901.   Do_Game_Over();
  902.  }
  903.  K_Clear();
  904.  Sim_Taste=0;
  905.  Key_status=0;
  906.  return Punkte;
  907. }
  908. /*
  909. /////////////////////////////////////////////////////////////////////
  910. */
  911. void near align(void)
  912. {
  913.  sprites[PACMAN].deltax[1] = sprites[PACMAN].deltax[0]=2*dx ;
  914.  sprites[PACMAN].deltay[1] = sprites[PACMAN].deltay[0]=2*dy ;
  915.  if (dir+lastkey!=Achsengleich)
  916.  {
  917.   sprites[PACMAN].spidp->x[1-page]=(x+1)*32-12+2*dx;
  918.   sprites[PACMAN].spidp->y[1-page]=(y+1)*40-16+2*dy;
  919.   sprites[PACMAN].spidp->x[page]=(x+1)*32-12+dx;
  920.   sprites[PACMAN].spidp->y[page]=(y+1)*40-16+dy;
  921.  }
  922.  else
  923.  {
  924.   sprites[PACMAN].spidp->x[1-page]=sprites[PACMAN].spidp->x[page]-dx;
  925.   sprites[PACMAN].spidp->y[1-page]=sprites[PACMAN].spidp->y[page]-dy;
  926.   sprites[PACMAN].spidp->x[page]-=(2*dx);
  927.   sprites[PACMAN].spidp->y[page]-=(2*dy);
  928.  }
  929. }
  930. /*
  931. /////////////////////////////////////////////////////////////////////
  932. */
  933. void life(void)
  934. {
  935.  int t;
  936.  if (Life_counter>=100000L)
  937.  {
  938.   Leben+=(int)(Life_counter/100000L);
  939.   Life_counter=Punkte%100000L;
  940.   GrafPrintf(295,389,20,0,"%i",Leben);
  941. # ifndef NO_SOUND
  942. # ifndef SHAREWARE_SOUND
  943.   if ((mod_on)||(sample_on))
  944. # else
  945.   if (mod_on)
  946. # endif
  947.   {
  948.    for ( t = 0; t < 64;t++)/*=4) */
  949.    {
  950.     set_color(0,0,0,t);
  951.    }
  952.    warte_d(2);
  953.    for ( t = 64; t >=0; t--)/*=4) */
  954.    {
  955.     set_color(0,0,0,t);
  956.    }
  957.   }
  958.   else
  959. # endif
  960.   {
  961.    for ( t = 0; t < 64; t+=2)
  962.    {
  963.     set_color(0,0,0,t);
  964.     warte_d(1);
  965.    }
  966.    for ( t = 64; t >=0; t-=2)
  967.    {
  968.     set_color(0,0,0,t);
  969.     warte_d(1);
  970.    }
  971.   }
  972.  }
  973. }
  974. /*
  975. /////////////////////////////////////////////////////////////////////
  976. */
  977. void mov_ghost(int ghost)
  978. {
  979.  int Akt_speed;
  980.  x=-1;
  981.  Akt_speed=abs((sprites[ghost].deltay[page]+sprites[ghost].deltax[page])/2);
  982.  if (!Akt_speed)
  983.   Akt_speed=speed[ghost];
  984.  if (Akt_speed>4) Akt_speed++;
  985.  for ( x1 = 0; x1 < Akt_speed; ++x1)
  986.  {
  987.   for ( y1 = 0; y1 < Akt_speed; ++y1)
  988.   {
  989.    if ((((sprites[ghost].spidp->x[page]+12+x1*ghost_richt[ghost])%32)==0)&&(((sprites[ghost].spidp->y[page]+16+y1*ghost_richt[ghost])%40)==0))
  990.    {
  991.     x=((sprites[ghost].spidp->x[page]+12+x1*ghost_richt[ghost])/32)-1;
  992.     y=((sprites[ghost].spidp->y[page]+16+y1*ghost_richt[ghost])/40)-1;
  993.     if ((Labyrinth.dots[y][x]=='x')&&(Eyes[ghost]))
  994.     {
  995.      Eyes[ghost]=0;
  996.      speed[ghost]=Labyrinth.geister_speed[ghost-1];
  997.      speed_change[ghost]=1;
  998.     }
  999.     if (((Labyrinth.lab[y][x+1]=='u')||(Labyrinth.lab[y][x+1]=='┌')||(Labyrinth.lab[y][x+1]=='│')||(Labyrinth.lab[y][x+1]=='┬')||(Labyrinth.lab[y][x+1]=='├')||(Labyrinth.lab[y][x+1]=='┼')||(Labyrinth.lab[y][x+1]=='┤')||(Labyrinth.lab[y][x+1]=='┐')||(Labyrinth.lab[y][x+1]==',')))
  1000.      ghost_dir[ghost][OST]=0;
  1001.     else
  1002.     {
  1003.      ghost_dir[ghost][OST]=3+random(4);
  1004.      if ((!Eyes[ghost])&&(sprites[PACMAN].spidp->x[page]>sprites[ghost].spidp->x[page]))
  1005.       if ((!ghost_angst[ghost])&&(!Fear))
  1006.        ghost_dir[ghost][OST]+=5-(sprites[PACMAN].spidp->x[page]-sprites[ghost].spidp->x[page])/64;
  1007.       else
  1008.        ghost_dir[ghost][OST]=1;
  1009.      if ((Eyes[ghost])&&(x<Labyrinth.house_x))
  1010.       ghost_dir[ghost][OST]+=random(8);
  1011.      if ((Labyrinth.dots[y][x+1]=='x')&&(Eyes[ghost]))
  1012.       ghost_dir[ghost][OST]=20;
  1013.     }
  1014.     if (((Labyrinth.lab[y][x]=='u')||(Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='│')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='┤')||(Labyrinth.lab[y][x]=='┐')||(Labyrinth.lab[y][x]==',')))
  1015.      ghost_dir[ghost][WEST]=0;
  1016.     else
  1017.     {
  1018.      ghost_dir[ghost][WEST]=3+random(4);
  1019.      if ((!Eyes[ghost])&&(sprites[PACMAN].spidp->x[page]<sprites[ghost].spidp->x[page]))
  1020.       if ((!ghost_angst[ghost])&&(!Fear))
  1021.        ghost_dir[ghost][WEST]+=5-(sprites[ghost].spidp->x[page]-sprites[PACMAN].spidp->x[page])/64;
  1022.       else
  1023.        ghost_dir[ghost][WEST]=1;
  1024.      if ((Eyes[ghost])&&(x>Labyrinth.house_x))
  1025.       ghost_dir[ghost][WEST]+=random(8);
  1026.      if ((Labyrinth.dots[y][x-1]=='x')&&(Eyes[ghost]))
  1027.       ghost_dir[ghost][WEST]=20;
  1028.     }
  1029.     if (( (Labyrinth.lab[y][x]=='r')||(Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='~')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='─')||(Labyrinth.lab[y][x]=='└')||(Labyrinth.lab[y][x]=='┴')))
  1030.      ghost_dir[ghost][NORD]=0;
  1031.     else
  1032.     {
  1033.      ghost_dir[ghost][NORD]=3+random(4);
  1034.      if ((!Eyes[ghost])&&(sprites[PACMAN].spidp->y[page]<sprites[ghost].spidp->y[page]))
  1035.       if ((!ghost_angst[ghost])&&(!Fear))
  1036.        ghost_dir[ghost][NORD]+=5-(sprites[ghost].spidp->y[page]-sprites[PACMAN].spidp->y[page])/80;
  1037.       else
  1038.        ghost_dir[ghost][NORD]=1;
  1039.      if ((Eyes[ghost])&&(y>Labyrinth.house_y))
  1040.       ghost_dir[ghost][NORD]+=random(8);
  1041.      if ((Labyrinth.dots[y-1][x]=='x')&&(Eyes[ghost]))
  1042.       ghost_dir[ghost][NORD]=20;
  1043.     }
  1044.     if (((Labyrinth.lab[y+1][x]=='r')||(Labyrinth.lab[y+1][x]=='┌')||(Labyrinth.lab[y+1][x]=='~')||(Labyrinth.lab[y+1][x]=='┬')||(Labyrinth.lab[y+1][x]=='├')||(Labyrinth.lab[y+1][x]=='┼')||(Labyrinth.lab[y+1][x]=='─')||(Labyrinth.lab[y+1][x]=='└')||(Labyrinth.lab[y+1][x]=='┴')))
  1045.      ghost_dir[ghost][SUED]=0;
  1046.     else
  1047.     {
  1048.      ghost_dir[ghost][SUED]=3+random(4);
  1049.      if ((!Eyes[ghost])&&(sprites[PACMAN].spidp->y[page]>sprites[ghost].spidp->y[page]))
  1050.       if ((!ghost_angst[ghost])&&(!Fear))
  1051.        ghost_dir[ghost][SUED]+=5-(sprites[PACMAN].spidp->y[page]-sprites[ghost].spidp->y[page])/80;
  1052.       else
  1053.        ghost_dir[ghost][SUED]=1;
  1054.      if ((Eyes[ghost])&&(y<Labyrinth.house_y))
  1055.       ghost_dir[ghost][SUED]+=random(8);
  1056.      if ((Labyrinth.dots[y+1][x]=='x')&&(Eyes[ghost]))
  1057.       ghost_dir[ghost][SUED]=20;
  1058.     }
  1059.     if (ghost_dir[ghost][3-ghost_last[ghost]])
  1060.      ghost_dir[ghost][3-ghost_last[ghost]]=1;
  1061.     if (ghost_dir[ghost][ghost_last[ghost]])
  1062.      ghost_dir[ghost][ghost_last[ghost]]++;
  1063.     x1=0;
  1064.     if (ghost_dir[ghost][0]<ghost_dir[ghost][1])
  1065.     {
  1066.      x1=1;
  1067.      ghost_dir[ghost][0]=ghost_dir[ghost][1];
  1068.     }
  1069.     if (ghost_dir[ghost][0]<ghost_dir[ghost][2])
  1070.     {
  1071.      x1=2;
  1072.      ghost_dir[ghost][0]=ghost_dir[ghost][2];
  1073.     }
  1074.     if (ghost_dir[ghost][0]<ghost_dir[ghost][3])
  1075.      x1=3;
  1076.     ghost_dir[ghost][0]=x1;
  1077.     x1=Akt_speed;
  1078.     y1=Akt_speed;
  1079.    }
  1080.   }
  1081.  }                         /* for schleife */
  1082.  if (x!=-1)
  1083.  {
  1084.   if ((ghost_last[ghost]!=ghost_dir[ghost][0])||(speed_change[ghost]))
  1085.   {
  1086.    speed_change[ghost]=0;
  1087.    switch (ghost_dir[ghost][0])
  1088.    {
  1089.     case NORD:
  1090.     {
  1091.      sprites[ghost].deltax[1] = 0;
  1092.      sprites[ghost].deltay[1] = 2*-speed[ghost];
  1093.      sprites[ghost].deltax[0] = 0;
  1094.      sprites[ghost].deltay[0] = 2*-speed[ghost];
  1095.      if (ghost_last[ghost]+ghost_dir[ghost][0]==3)
  1096.      {
  1097.       sprites[ghost].spidp->x[1-page]=sprites[ghost].spidp->x[page]-sprites[ghost].deltax[page]/2;
  1098.       sprites[ghost].spidp->y[1-page]=sprites[ghost].spidp->y[page]-sprites[ghost].deltay[page]/2;
  1099.       sprites[ghost].spidp->x[page]-=sprites[ghost].deltax[page];
  1100.       sprites[ghost].spidp->y[page]-=sprites[ghost].deltay[page];
  1101.      }
  1102.      else
  1103.      {
  1104.       sprites[ghost].spidp->x[1-page]=(x+1)*32-12+sprites[ghost].deltax[page];
  1105.       sprites[ghost].spidp->y[1-page]=(y+1)*40-16+sprites[ghost].deltay[page];
  1106.       sprites[ghost].spidp->x[page]=(x+1)*32-12+sprites[ghost].deltax[page]/2;
  1107.       sprites[ghost].spidp->y[page]=(y+1)*40-16+sprites[ghost].deltay[page]/2;
  1108.      }
  1109.      sprites[ghost].richtung=NORD;
  1110.      ghost_last[ghost]=ghost_dir[ghost][0];
  1111.      ghost_richt[ghost]=-1;
  1112.      break;
  1113.     }
  1114.     case SUED:
  1115.     {
  1116.      sprites[ghost].deltax[1] = 0;
  1117.      sprites[ghost].deltay[1] = 2*speed[ghost];
  1118.      sprites[ghost].deltax[0] = 0;
  1119.      sprites[ghost].deltay[0] = 2*speed[ghost];
  1120.      if (ghost_last[ghost]+ghost_dir[ghost][0]==3)
  1121.      {
  1122.       sprites[ghost].spidp->x[1-page]=sprites[ghost].spidp->x[page]-sprites[ghost].deltax[page]/2;
  1123.       sprites[ghost].spidp->y[1-page]=sprites[ghost].spidp->y[page]-sprites[ghost].deltay[page]/2;
  1124.       sprites[ghost].spidp->x[page]-=sprites[ghost].deltax[page];
  1125.       sprites[ghost].spidp->y[page]-=sprites[ghost].deltay[page];
  1126.      }
  1127.      else
  1128.      {
  1129.       sprites[ghost].spidp->x[1-page]=(x+1)*32-12+sprites[ghost].deltax[page];
  1130.       sprites[ghost].spidp->y[1-page]=(y+1)*40-16+sprites[ghost].deltay[page];
  1131.       sprites[ghost].spidp->x[page]=(x+1)*32-12+sprites[ghost].deltax[page]/2;
  1132.       sprites[ghost].spidp->y[page]=(y+1)*40-16+sprites[ghost].deltay[page]/2;
  1133.      }
  1134.      sprites[ghost].richtung=SUED;
  1135.      ghost_last[ghost]=ghost_dir[ghost][0];
  1136.      ghost_richt[ghost]=1;
  1137.      break;
  1138.     }
  1139.     case OST:
  1140.     {
  1141.      sprites[ghost].deltay[1] = 0;
  1142.      sprites[ghost].deltax[1] = 2*speed[ghost];
  1143.      sprites[ghost].deltay[0] = 0;
  1144.      sprites[ghost].deltax[0] = 2*speed[ghost];
  1145.      if (ghost_last[ghost]+ghost_dir[ghost][0]==3)
  1146.      {
  1147.       sprites[ghost].spidp->x[1-page]=sprites[ghost].spidp->x[page]-sprites[ghost].deltax[page]/2;
  1148.       sprites[ghost].spidp->y[1-page]=sprites[ghost].spidp->y[page]-sprites[ghost].deltay[page]/2;
  1149.       sprites[ghost].spidp->x[page]-=sprites[ghost].deltax[page];
  1150.       sprites[ghost].spidp->y[page]-=sprites[ghost].deltay[page];
  1151.      }
  1152.      else
  1153.      {
  1154.       sprites[ghost].spidp->x[1-page]=(x+1)*32-12+sprites[ghost].deltax[page];
  1155.       sprites[ghost].spidp->y[1-page]=(y+1)*40-16+sprites[ghost].deltay[page];
  1156.       sprites[ghost].spidp->x[page]=(x+1)*32-12+sprites[ghost].deltax[page]/2;
  1157.       sprites[ghost].spidp->y[page]=(y+1)*40-16+sprites[ghost].deltay[page]/2;
  1158.      }
  1159.      sprites[ghost].richtung=OST;
  1160.      ghost_last[ghost]=ghost_dir[ghost][0];
  1161.      ghost_richt[ghost]=1;
  1162.      break;
  1163.     }
  1164.     case WEST:
  1165.     {
  1166.      sprites[ghost].deltay[1] = 0;
  1167.      sprites[ghost].deltax[1] = -2*speed[ghost];
  1168.      sprites[ghost].deltay[0] = 0;
  1169.      sprites[ghost].deltax[0] = -2*speed[ghost];
  1170.      if (ghost_last[ghost]+ghost_dir[ghost][0]==3)
  1171.      {
  1172.       sprites[ghost].spidp->x[1-page]=sprites[ghost].spidp->x[page]-sprites[ghost].deltax[page]/2;
  1173.       sprites[ghost].spidp->y[1-page]=sprites[ghost].spidp->y[page]-sprites[ghost].deltay[page]/2;
  1174.       sprites[ghost].spidp->x[page]-=sprites[ghost].deltax[page];
  1175.       sprites[ghost].spidp->y[page]-=sprites[ghost].deltay[page];
  1176.      }
  1177.      else
  1178.      {
  1179.       sprites[ghost].spidp->x[1-page]=(x+1)*32-12+sprites[ghost].deltax[page];
  1180.       sprites[ghost].spidp->y[1-page]=(y+1)*40-16+sprites[ghost].deltay[page];
  1181.       sprites[ghost].spidp->x[page]=(x+1)*32-12+sprites[ghost].deltax[page]/2;
  1182.       sprites[ghost].spidp->y[page]=(y+1)*40-16+sprites[ghost].deltay[page]/2;
  1183.      }
  1184.      sprites[ghost].richtung=WEST;
  1185.      ghost_last[ghost]=ghost_dir[ghost][0];
  1186.      ghost_richt[ghost]=-1;
  1187.      break;
  1188.     }
  1189.    }
  1190.   }
  1191.  }
  1192. }
  1193. /*
  1194. /////////////////////////////////////////////////////////////////////
  1195. */
  1196. void do_case(void)
  1197. {
  1198.  int i,t,xt,yt;
  1199.  switch (ExtraBonus)
  1200.  {
  1201.   case 1:
  1202.   {
  1203.    Extra=1;
  1204.    break;
  1205.   }
  1206.   case 2:
  1207.   {
  1208.    Extra_Time=800;
  1209.    speed_change[PACMAN]=1;
  1210.    speed[PACMAN]=4;
  1211.    GrafPrintf(120,390,255,255,"   SPEED    ");
  1212.    break;
  1213.   }
  1214.   case 3:
  1215.   {
  1216.    Extra_Time=800;
  1217.    speed_change[PACMAN]=1;
  1218.    speed[PACMAN]=5;
  1219.    GrafPrintf(120,390,255,255,"EXTRA-SPEED ");
  1220.    break;
  1221.   }
  1222.   case 4:
  1223.   {
  1224.    Extra_Time=800;
  1225.    GrafPrintf(120,390,255,255," GESCHENKE  ");
  1226.    Geschenk=1;
  1227.    break;
  1228.   }
  1229.   case 5:
  1230.   {
  1231.    Leben++;
  1232.    GrafPrintf(295,389,20,0,"%i",Leben);
  1233. # ifndef NO_SOUND
  1234. # ifndef SHAREWARE_SOUND
  1235.   if ((mod_on)||(sample_on))
  1236. # else
  1237.   if (mod_on)
  1238. # endif
  1239.    {
  1240.     for ( t = 0; t < 64;t++)/*=4) */
  1241.     {
  1242.      set_color(0,0,0,t);
  1243.     }
  1244.     warte_d(2);
  1245.     for ( t = 64; t >=0; t--)/*=4) */
  1246.     {
  1247.      set_color(0,0,0,t);
  1248.     }
  1249.    }
  1250.    else
  1251. # endif
  1252.    {
  1253.     for ( t = 0; t < 64; t+=2)
  1254.     {
  1255.      set_color(0,0,0,t);
  1256.      warte_d(1);
  1257.     }
  1258.     for ( t = 64; t >=0; t-=2)
  1259.     {
  1260.      set_color(0,0,0,t);
  1261.      warte_d(1);
  1262.     }
  1263.    }
  1264.    ExtraBonus=0;
  1265.    break;
  1266.   }
  1267.   case 6:
  1268.   {
  1269.    Extra_Time=800;
  1270.    GrafPrintf(120,390,255,255,"   FEAR     ");
  1271.    Fear=1;
  1272.    break;
  1273.   }
  1274.   case 7:
  1275.   {
  1276.    Level_punkte=Labyrinth.dot_anzahl;
  1277.    ExtraBonus=0;
  1278.    break;
  1279.   }
  1280.   case 8:
  1281.   {
  1282.    Level_punkte=Labyrinth.dot_anzahl;
  1283.    t=1;
  1284.    if (random(100)>50)
  1285.     t=-1;
  1286.    Level+=(random(3)*t);
  1287.    ExtraBonus=0;
  1288.    break;
  1289.   }
  1290.   case 9:
  1291.   {
  1292.    speed[RED]=0;
  1293.    speed_change[RED]=1;
  1294.    speed[GELB]=0;
  1295.    speed_change[GELB]=1;
  1296.    speed[GRUEN]=0;
  1297.    speed_change[GRUEN]=1;
  1298.    speed[LILA]=0;
  1299.    speed_change[LILA]=1;
  1300.    Extra_Time=800;
  1301.    GrafPrintf(120,390,255,255,"   STOP     ");
  1302.    stop=1;
  1303.    break;
  1304.   }
  1305.   case 10:
  1306.   {
  1307.    speed[RED]=1;
  1308.    speed_change[RED]=1;
  1309.    speed[GELB]=1;
  1310.    speed_change[GELB]=1;
  1311.    speed[GRUEN]=1;
  1312.    speed_change[GRUEN]=1;
  1313.    speed[LILA]=1;
  1314.    speed_change[LILA]=1;
  1315.    Extra_Time=800;
  1316.    GrafPrintf(120,390,255,255,"    SLOW    ");
  1317.    slow=1;
  1318.    break;
  1319.   }
  1320.   case 11:
  1321.   {
  1322.    for ( i = RED; i < LILA+1; ++ i)
  1323.    {
  1324.     if (!Eyes[i])
  1325.     {
  1326.      if ((!slow)&&(!stop))
  1327.      {
  1328.       speed[i]=Labyrinth.eye_speed;
  1329.       speed_change[i]=1;
  1330.      }
  1331.      Eyes[i]=130;
  1332.      Punkte+=5000*mal;
  1333.      Life_counter+=5000*mal;
  1334.      life();
  1335.      Geist_zahl[i]=5000;
  1336.      Print_Score(Punkte);
  1337.     }
  1338.    }
  1339.    ExtraBonus=0;
  1340.    break;
  1341.   }
  1342.   case 12:
  1343.   {
  1344.    Extra_Time=800;
  1345.    GrafPrintf(120,390,255,255,"    MAL 2   ");
  1346.    mal=2;
  1347.    break;
  1348.   }
  1349.   case 13:
  1350.   {
  1351.    Extra_Time=800;
  1352.    GrafPrintf(120,390,255,255,"    MAL 5   ");
  1353.    mal=5;
  1354.    break;
  1355.   }
  1356.   case 14:
  1357.   {
  1358.    Extra_Time=800;
  1359.    for ( xt = 1; xt < 10 ; ++ xt)
  1360.    {
  1361.     for ( yt = 1; yt < 10 ; ++ yt)
  1362.     {
  1363.      if ((Labyrinth.dots[yt-1][xt-1]!='x')&&(Labyrinth.dots[yt-1][xt-1]!=' ')&&(dots[((int) Labyrinth.dots[yt-1][xt-1])-((int) '.')].Art==0))
  1364.      {
  1365.       Labyrinth.dots[yt-1][xt-1]='P'+random(6);
  1366.       PutVideo(dots[Labyrinth.dots[yt-1][xt-1]-'P'+34].dot,0,xt*32-dots[36].dot->width,yt*40-dots[36].dot->hight,FALSE);
  1367.       PutVideo(dots[Labyrinth.dots[yt-1][xt-1]-'P'+34].dot,1,xt*32-dots[36].dot->width,yt*40-dots[36].dot->hight,FALSE);
  1368.       PutBack(Back,dots[Labyrinth.dots[yt-1][xt-1]-'P'+34].dot,xt*32-dots[36].dot->width,yt*40-dots[36].dot->hight);
  1369.      }
  1370.     }
  1371.    }
  1372.    GrafPrintf(120,390,255,255," DIAMANTEN  ");
  1373.    break;
  1374.   }
  1375.   case 15:
  1376.   {
  1377.    show_pic(0,0,1,"pix\\pac_grue");
  1378.    shield=1;
  1379.    Extra_Time=800;
  1380.    GrafPrintf(120,390,255,255,"   SCHUTZ   ");
  1381.    break;
  1382.   }
  1383.   case 16:
  1384.   {
  1385.    uhr=1;
  1386.    ExtraBonus=0;
  1387.    break;
  1388.   }
  1389.  }
  1390. }
  1391. /*
  1392. /////////////////////////////////////////////////////////////////////
  1393. */
  1394. void mov_pac(void)
  1395. {
  1396.  int t;
  1397.  if (B_Flag)
  1398.  {
  1399.   PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1400.   B_Flag=0;
  1401.   Z_Count=6;
  1402.   zz=Get_Zahl(Labyrinth.Bonus_wert,zz);
  1403.   PutBack(Back,zz,(int) Labyrinth.Bonus_x*32+32-zz->width,(int) Labyrinth.Bonus_y*40+40-zz->hight);
  1404.   PutVideo(zz,0,Labyrinth.Bonus_x*32+32-zz->width,Labyrinth.Bonus_y*40+40-zz->hight,FALSE);
  1405.   PutVideo(zz,1,Labyrinth.Bonus_x*32+32-zz->width,Labyrinth.Bonus_y*40+40-zz->hight,FALSE);
  1406.  }
  1407.  if (Z_Count==2)
  1408.  {
  1409.   PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  1410.   PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1411.  }
  1412.  if (Z_Count==1)
  1413.  {
  1414.   PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  1415.   PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1416.   Z_Count=0;
  1417.  }
  1418.  if (!demo)
  1419.   key=game_get_key();
  1420.  else
  1421.   key=demo_game_get_key();
  1422.  if (key==27)
  1423.   GrafPrintf(110,390,0,0,    "                  ");
  1424.  if ((key)&&(key!=lastkey))
  1425.  {
  1426.   if (key==Hoch)
  1427.   {
  1428.    ddx =0;
  1429.    ddy =-speed[PACMAN];
  1430.   }
  1431.   else
  1432.   {
  1433.    if (key==Runter)
  1434.    {
  1435.     ddx =0;
  1436.     ddy =speed[PACMAN];
  1437.    }
  1438.    else
  1439.    {
  1440.     if (key==Rechts)
  1441.     {
  1442.      ddx =speed[PACMAN];
  1443.      ddy =0;
  1444.     }
  1445.     else
  1446.     {
  1447.      if (key==Links)
  1448.      {
  1449.       ddx =-speed[PACMAN];
  1450.       ddy =0;
  1451.      }
  1452.      else
  1453.      {
  1454.       if (key!=27)
  1455.        key=dir;
  1456.       else
  1457.        GrafPrintf(120,390,255,255,"              ");
  1458.      }
  1459.     }
  1460.    }
  1461.   }
  1462.   lastkey=key;
  1463.  }
  1464.  Akt_speed=abs((sprites[PACMAN].deltay[page]+sprites[PACMAN].deltax[page])/2);
  1465.  if (!Akt_speed)
  1466.  {
  1467.   Akt_speed=speed[PACMAN];
  1468.   if (ExtraBonus==2)
  1469.    Akt_speed=4;
  1470.  }
  1471.  if (Akt_speed>4)
  1472.   Akt_speed++;
  1473.  for ( x1 = 0; x1 < Akt_speed; ++x1)
  1474.  {
  1475.   for ( y1 = 0; y1 < Akt_speed; ++y1)
  1476.   {
  1477.    if ( (((sprites[PACMAN].spidp->x[page]+12+x1*richt)%32)==0)&&(((sprites[PACMAN].spidp->y[page]+16+y1*richt)%40)==0) )
  1478.    {
  1479.     x=((sprites[PACMAN].spidp->x[page]+12+x1*richt)/32)-1;
  1480.     y=((sprites[PACMAN].spidp->y[page]+16+y1*richt)/40)-1;
  1481.     if (geschenk_flag)
  1482.     {
  1483.      if (geschenk_x!=-1)
  1484.      {
  1485.       PutBack(Back,void_Bonus,(int) geschenk_x*32+32-void_Bonus->width,(int) geschenk_y*40+40-void_Bonus->hight);
  1486.       PutVideo(void_Bonus,page,geschenk_x*32+32-void_Bonus->width,geschenk_y*40+40-void_Bonus->hight,FALSE);
  1487.       PutVideo(void_Bonus,1-page,geschenk_x*32+32-void_Bonus->width,geschenk_y*40+40-void_Bonus->hight,FALSE);
  1488.      }
  1489.      geschenk_flag=0;
  1490.     }
  1491.     if (Z_Count)
  1492.      Z_Count--;
  1493.     if (Z_Count==1)
  1494.     {
  1495.      PutBack(Back,void_Bonus,(int) x*32+32-void_Bonus->width,(int) y*40+40-void_Bonus->hight);
  1496.      PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1497.     }
  1498.     if ((Labyrinth.dots[y][x]!=' ')&&(Labyrinth.dots[y][x]!='x'))
  1499.     {
  1500.      if ((Labyrinth.dots[y][x]!='y') && (Labyrinth.dots[y][x]!='z'))
  1501.      {
  1502.       if (dots[((int) Labyrinth.dots[y][x])-((int) '.')].Art==0)
  1503.       {
  1504.        in_a_row=0;
  1505.        PutBack(Back,dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv,(int) x*32+32-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->width,(int) y*40+40-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->hight);
  1506.        play_sample(DOTS);
  1507.        if (Geschenk)
  1508.        {
  1509.         t=(random(20)+1)*100;
  1510.         Punkte+=t*mal;
  1511.         Life_counter+=t*mal;
  1512.         zz=Get_Zahl(t,zz);
  1513.         PutBack(Back,zz,(int) x*32+32-zz->width,(int) y*40+40-zz->hight);
  1514.         geschenk_x=x;
  1515.         geschenk_y=y;
  1516.         geschenk_flag=1;
  1517.        }
  1518.        else
  1519.        {
  1520.         Punkte+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1521.         Life_counter+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1522.        }
  1523.        life();
  1524.        Level_punkte+=1;
  1525.        Print_Score(Punkte);
  1526.        in_a_row=0;
  1527.        in_a_dot++;
  1528.        if ((in_a_dot==Labyrinth.Max_dot)&&(!Extra))
  1529.        {
  1530.         Extra=1;
  1531.        }
  1532.        Labyrinth.dots[y][x]=' ';
  1533.       }
  1534.       else
  1535.       {
  1536.        if (dots[((int) Labyrinth.dots[y][x])-((int) '.')].Art==1)
  1537.        {
  1538.         if (!Extra)
  1539.         {
  1540.          play_sample(PILLE);
  1541.          if ((!stop)&&(!slow))
  1542.          {
  1543.           if (!Eyes[RED])
  1544.           {
  1545.            speed[RED]=Labyrinth.ghost_speed;
  1546.            speed_change[RED]=1;
  1547.           }
  1548.           if (!Eyes[LILA])
  1549.           {
  1550.            speed[LILA]=Labyrinth.ghost_speed;
  1551.            speed_change[LILA]=1;
  1552.           }
  1553.           if (!Eyes[GELB])
  1554.           {
  1555.            speed[GELB]=Labyrinth.ghost_speed;
  1556.            speed_change[GELB]=1;
  1557.           }
  1558.           if (!Eyes[GRUEN])
  1559.           {
  1560.            speed[GRUEN]=Labyrinth.ghost_speed;
  1561.            speed_change[GRUEN]=1;
  1562.           }
  1563.          }
  1564.          PutBack(Back,dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv,(int) x*32+32-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->width,(int) y*40+40-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->hight);
  1565.          Punkte+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1566.          Life_counter+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1567.          play_sample(PILLE);
  1568.          life();
  1569.          Level_punkte+=1;
  1570.          Print_Score(Punkte);
  1571.          fressen=Labyrinth.pillen_laenge;
  1572.          if (uhr)
  1573.           fressen*=2;
  1574.          if ((!Eyes[RED])||(Ghost_fressen==1))
  1575.           ghost_angst[RED]=fressen;
  1576.          if ((!Eyes[LILA])||(Ghost_fressen==1))
  1577.           ghost_angst[LILA]=fressen;
  1578.          if ((!Eyes[GELB])||(Ghost_fressen==1))
  1579.           ghost_angst[GELB]=fressen;
  1580.          if ((!Eyes[GRUEN])||(Ghost_fressen==1))
  1581.           ghost_angst[GRUEN]=fressen;
  1582.          in_a_row++;
  1583.          in_a_dot=0;
  1584.          if ((in_a_row==4)&&(!Extra))
  1585.           Extra=1;
  1586.          Geist_wert=200;
  1587.          Labyrinth.dots[y][x]=' ';
  1588.         }
  1589.         else
  1590.         {
  1591.          play_sample(DOTS);
  1592.          PutBack(Back,dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv,(int) x*32+32-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->width,(int) y*40+40-dots[((int) Labyrinth.dots[y][x])-((int) '.')].dotv->hight);
  1593.          Punkte+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1594.          Life_counter+=dots[((int) Labyrinth.dots[y][x])-((int) '.')].Wert*mal;
  1595.          life();
  1596.          Level_punkte+=1;
  1597.          Print_Score(Punkte);
  1598.          Labyrinth.dots[y][x]=' ';
  1599.         }
  1600.        }
  1601.       }
  1602.      }
  1603.      else
  1604.      {
  1605.       if (Labyrinth.dots[y][x]=='y')
  1606.       {
  1607.        Labyrinth.dots[y][x]=' ';
  1608.        if (!ExtraBonus)
  1609.        {
  1610.         B_Zeit=0;
  1611.         B_Flag=1;
  1612.         PutBack(Back,void_Bonus,(int) x*32+32-void_Bonus->width,(int) y*40+40-void_Bonus->hight);
  1613.         PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1614.         Punkte+=Labyrinth.Bonus_wert*mal;
  1615.         Life_counter+=Labyrinth.Bonus_wert*mal;
  1616.         life();
  1617.         Level_punkte+=1;
  1618.         in_a_row=0;
  1619.         in_a_dot++;
  1620.         if ((in_a_dot==Labyrinth.Max_dot)&&(!Extra))
  1621.          Extra=1;
  1622.         play_sample(EXTRA);
  1623.         Print_Score(Punkte);
  1624.        }
  1625.        else
  1626.        {
  1627.         PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  1628.         PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1629.         PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1630.         if ((in_a_dot==Labyrinth.Max_dot)&&(!Extra))
  1631.          Extra=1;
  1632.         Level_punkte+=1;
  1633.         in_a_row=0;
  1634.         in_a_dot++;
  1635.         B_Zeit=0;
  1636.         play_sample(EXTRA);
  1637.         do_case();
  1638.        }
  1639.       }
  1640.       if (Labyrinth.dots[y][x]=='z')
  1641.       {
  1642.        Labyrinth.dots[y][x]=' ';
  1643.        if (!ExtraBonus)
  1644.        {
  1645.         B_Zeit=0;
  1646.         B_Flag=1;
  1647.         PutBack(Back,void_Bonus,(int) x*32+32-void_Bonus->width,(int) y*40+40-void_Bonus->hight);
  1648.         PutVideo(void_Bonus,page,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1649.         Punkte+=Labyrinth.Bonus_wert*mal;
  1650.         Life_counter+=Labyrinth.Bonus_wert*mal;
  1651.         life();
  1652.         play_sample(EXTRA);
  1653.         Print_Score(Punkte);
  1654.        }
  1655.        else
  1656.        {
  1657.         PutBack(Back,void_Bonus,(int) Labyrinth.Bonus_x*32+32-void_Bonus->width,(int) Labyrinth.Bonus_y*40+40-void_Bonus->hight);
  1658.         PutVideo(void_Bonus,1,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1659.         PutVideo(void_Bonus,0,Labyrinth.Bonus_x*32+32-void_Bonus->width,Labyrinth.Bonus_y*40+40-void_Bonus->hight,FALSE);
  1660.         B_Zeit=0;
  1661.         play_sample(EXTRA);
  1662.         do_case();
  1663.        }
  1664.       }
  1665.      }
  1666.     }
  1667.     if ((dx)||(dy))
  1668.     {
  1669.      if ( (dir==Links)&&( (Labyrinth.lab[y][x]=='o')||(Labyrinth.lab[y][x]=='u')||(Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='│')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='┤')||(Labyrinth.lab[y][x]=='┐')||(Labyrinth.lab[y][x]==',') ) )
  1670.      {
  1671.       dx=0;
  1672.       dy=0;
  1673.       align();
  1674.       richt=1;
  1675.       goto raus1;
  1676.      }
  1677.      if ( (dir==Rechts)&&( (Labyrinth.lab[y][x+1]=='o')||(Labyrinth.lab[y][x+1]=='u')||(Labyrinth.lab[y][x+1]=='┌')||(Labyrinth.lab[y][x+1]=='│')||(Labyrinth.lab[y][x+1]=='┬')||(Labyrinth.lab[y][x+1]=='├')||(Labyrinth.lab[y][x+1]=='┼')||(Labyrinth.lab[y][x+1]=='┤')||(Labyrinth.lab[y][x+1]=='┐')||(Labyrinth.lab[y][x+1]==',') ) )
  1678.      {
  1679.       dx=0;
  1680.       dy=0;
  1681.       align();
  1682.       richt=1;
  1683.       goto raus1;
  1684.      }
  1685.      if ( (dir==Hoch)&&( (Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='l')||(Labyrinth.lab[y][x]=='r')||(Labyrinth.lab[y][x]=='~')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='─')||(Labyrinth.lab[y][x]=='└')||(Labyrinth.lab[y][x]=='┴') ) )
  1686.      {
  1687.       dx=0;
  1688.       dy=0;
  1689.       align();
  1690.       richt=1;
  1691.       goto raus1;
  1692.      }
  1693.      if ( (dir==Runter)&&( (Labyrinth.lab[y+1][x]=='┌')||(Labyrinth.lab[y+1][x]=='l')||(Labyrinth.lab[y+1][x]=='r')||(Labyrinth.lab[y+1][x]=='~')||(Labyrinth.lab[y+1][x]=='┬')||(Labyrinth.lab[y+1][x]=='├')||(Labyrinth.lab[y+1][x]=='┼')||(Labyrinth.lab[y+1][x]=='─')||(Labyrinth.lab[y+1][x]=='└')||(Labyrinth.lab[y+1][x]=='┴') ) )
  1694.      {
  1695.       dx=0;
  1696.       dy=0;
  1697.       align();
  1698.       richt=1;
  1699.       goto raus1;
  1700.      }
  1701.     }
  1702.    }
  1703. raus1:
  1704.    if (speed_change[PACMAN])
  1705.    {
  1706.     if (dx)
  1707.      dx=(dx/abs(dx))*speed[PACMAN];
  1708.     if (dy)
  1709.      dy=(dy/abs(dy))*speed[PACMAN];
  1710.     if (ddx)
  1711.      ddx=(ddx/abs(ddx))*speed[PACMAN];
  1712.     if (ddy)
  1713.      ddy=(ddy/abs(ddy))*speed[PACMAN];
  1714.     sprites[PACMAN].deltax[1] = 2*dx ;
  1715.     sprites[PACMAN].deltay[1] = 2*dy ;
  1716.     sprites[PACMAN].deltax[0] = 2*dx ;
  1717.     sprites[PACMAN].deltay[0] = 2*dy ;
  1718.     sprites[PACMAN].spidp->x[page]=sprites[PACMAN].spidp->x[1-page]-dx;
  1719.     sprites[PACMAN].spidp->y[page]=sprites[PACMAN].spidp->y[1-page]-dy;
  1720.     y1=0;
  1721.     x1=0;
  1722.     Akt_speed=abs((sprites[PACMAN].deltay[page]+sprites[PACMAN].deltax[page])/2);
  1723.     if (Akt_speed>4)
  1724.      Akt_speed++;
  1725.     speed_change[PACMAN]=0;
  1726.    }
  1727.    else
  1728.    {
  1729.     if (lastkey!=dir)
  1730.     {
  1731.      if (dir+lastkey==Achsengleich)
  1732.      {
  1733.       dx=ddx;
  1734.       dy=ddy;
  1735.       richt=-richt;
  1736.       align();
  1737.       dir=lastkey;
  1738.       sprites[PACMAN].richtung =  Get_Dir(dir);
  1739.       goto raus;
  1740.      }
  1741.      else
  1742.      {
  1743.       if (((((sprites[PACMAN].spidp->x[page]+12+x1*richt)%32)==0))&&(((sprites[PACMAN].spidp->y[page]+16+y1*richt)%40)==0))
  1744.       {
  1745.        x=((sprites[PACMAN].spidp->x[page]+12+x1*richt)/32)-1;
  1746.        y=((sprites[PACMAN].spidp->y[page]+16+y1*richt)/40)-1;
  1747.        if ( (lastkey==Links)&&!(( (Labyrinth.lab[y][x]=='o')||(Labyrinth.lab[y][x]=='u')||(Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='│')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='┤')||(Labyrinth.lab[y][x]=='┐')||(Labyrinth.lab[y][x]==',') ) ))
  1748.        {
  1749.         dx=ddx;
  1750.         dy=ddy;
  1751.         richt=-1;
  1752.         align();
  1753.         dir=lastkey;
  1754.         sprites[PACMAN].richtung =  Get_Dir(dir);
  1755.         goto raus;
  1756.        }
  1757.        if ( (lastkey==Rechts)&&!(( (Labyrinth.lab[y][x+1]=='o')||(Labyrinth.lab[y][x+1]=='u')||(Labyrinth.lab[y][x+1]=='┌')||(Labyrinth.lab[y][x+1]=='│')||(Labyrinth.lab[y][x+1]=='┬')||(Labyrinth.lab[y][x+1]=='├')||(Labyrinth.lab[y][x+1]=='┼')||(Labyrinth.lab[y][x+1]=='┤')||(Labyrinth.lab[y][x+1]=='┐')||(Labyrinth.lab[y][x+1]==',') ) ))
  1758.        {
  1759.         dx=ddx;
  1760.         dy=ddy;
  1761.         richt=1;
  1762.         align();
  1763.         dir=lastkey;
  1764.         sprites[PACMAN].richtung =  Get_Dir(dir);
  1765.         goto raus;
  1766.        }
  1767.        if ((lastkey==Hoch)&&!(( (Labyrinth.lab[y][x]=='r')||(Labyrinth.lab[y][x]=='l')||(Labyrinth.lab[y][x]=='┌')||(Labyrinth.lab[y][x]=='~')||(Labyrinth.lab[y][x]=='┬')||(Labyrinth.lab[y][x]=='├')||(Labyrinth.lab[y][x]=='┼')||(Labyrinth.lab[y][x]=='─')||(Labyrinth.lab[y][x]=='└')||(Labyrinth.lab[y][x]=='┴') ) ))
  1768.        {
  1769.         dx=ddx;
  1770.         dy=ddy;
  1771.         richt=-1;
  1772.         align();
  1773.         dir=lastkey;
  1774.         sprites[PACMAN].richtung =  Get_Dir(dir);
  1775.         goto raus;
  1776.        }
  1777.        if ( (lastkey==Runter)&&!(( (Labyrinth.lab[y+1][x]=='l')||(Labyrinth.lab[y+1][x]=='r')||(Labyrinth.lab[y+1][x]=='┌')||(Labyrinth.lab[y+1][x]=='~')||(Labyrinth.lab[y+1][x]=='┬')||(Labyrinth.lab[y+1][x]=='├')||(Labyrinth.lab[y+1][x]=='┼')||(Labyrinth.lab[y+1][x]=='─')||(Labyrinth.lab[y+1][x]=='└')||(Labyrinth.lab[y+1][x]=='┴') ) ))
  1778.        {
  1779.         dx=ddx;
  1780.         dy=ddy;
  1781.         richt=1;
  1782.         align();
  1783.         dir=lastkey;
  1784.         sprites[PACMAN].richtung =  Get_Dir(dir);
  1785.         goto raus;
  1786.        }
  1787.       }
  1788.      }
  1789.     }
  1790.    }
  1791.   }   /* for schleife */
  1792. raus:
  1793.  ;
  1794.  }
  1795. }
  1796. /*
  1797. /////////////////////////////////////////////////////////////////////
  1798. */
  1799. void Do_Infor(void)
  1800. {
  1801.  int i=0;
  1802.  setpage(1);
  1803.  showpage(0);
  1804.  show_pic(16,55,15,"pix\\info1");
  1805.  gprintf(160-strlen(Labyrinth.Titel)*4,82,239+13,239+2,Labyrinth.Titel);
  1806.  if (Level>9)
  1807.   gprintf(250,82,239+15,239+2,"%d",Level);
  1808.  else
  1809.   gprintf(259,82,239+15,239+2,"%d",Level);
  1810.  while ((i<9)&&(Labyrinth.Desc[i][0]))
  1811.   gprintf(55,90+i*8,239+12,239+2,Labyrinth.Desc[i++]);
  1812.  i+=2;
  1813.  PutVideo( Pac[2][4]->pixbp,1,55, 90+i*8, TRUE);
  1814.  gprintf(90,90+i*8+12,239+14,239+2,"%d",Labyrinth.pac_speed);
  1815.  PutVideo( Bonus[Labyrinth.Bonus],1,180, 90+i*8, TRUE);
  1816.  gprintf(215,90+i*8+12,239+14,239+2,"%d",Labyrinth.Bonus_wert);
  1817.  i+=6;
  1818.  PutVideo( red[0][1]->pixbp,1,55, 90+i*8, TRUE);
  1819.  gprintf(90,90+i*8+12,239+14,239+2,"%d",Labyrinth.geister_speed[RED-1]);
  1820.  PutVideo( gelb[1][1]->pixbp,1,105, 90+i*8, TRUE);
  1821.  gprintf(140,90+i*8+12,239+14,239+2,"%d",Labyrinth.geister_speed[GELB-1]);
  1822.  PutVideo( gruen[2][1]->pixbp,1,155, 90+i*8, TRUE);
  1823.  gprintf(190,90+i*8+12,239+14,239+2,"%d",Labyrinth.geister_speed[GRUEN-1]);
  1824.  PutVideo( lila[3][1]->pixbp,1,205, 90+i*8, TRUE);
  1825.  gprintf(240,90+i*8+12,239+14,239+2,"%d",Labyrinth.geister_speed[LILA-1]);
  1826.  i+=6;
  1827.  PutVideo( red[4][0]->pixbp,1,55, 90+i*8, TRUE);
  1828.  gprintf(90,90+i*8+12,239+14,239+2,"%d, %d",Labyrinth.ghost_speed,Labyrinth.pillen_laenge);
  1829.  PutVideo( augen[1]->pixbp,1,180, 90+i*8, TRUE);
  1830.  gprintf(215,90+i*8+12,239+14,239+2,"%d",Labyrinth.eye_speed);
  1831.  showpage(1);
  1832.  K_Clear();
  1833.  while (!key)
  1834.  {
  1835.   key=get_key();
  1836.   warte_d(8);
  1837.  }
  1838.  showpage(0);
  1839.  Get_Back(1,Back);
  1840. }
  1841. /*
  1842. /////////////////////////////////////////////////////////////////////
  1843. */
  1844. SPLOOK *Zahl(unsigned int Geist_zahl,SPLOOK *zurueck)
  1845. {
  1846.  switch (Geist_zahl)
  1847.  {
  1848.   case 100:
  1849.   {
  1850.    zurueck= z100;
  1851.    break;
  1852.   }
  1853.   case 200:
  1854.   {
  1855.    zurueck= z200;
  1856.    break;
  1857.   }
  1858.   case 300:
  1859.   {
  1860.    zurueck= z300;
  1861.    break;
  1862.   }
  1863.   case 400:
  1864.   {
  1865.    zurueck= z400;
  1866.    break;
  1867.   }
  1868.   case 500:
  1869.   {
  1870.    zurueck= z500;
  1871.    break;
  1872.   }
  1873.   case 600:
  1874.   {
  1875.    zurueck= z600;
  1876.    break;
  1877.   }
  1878.   case 700:
  1879.   {
  1880.    zurueck= z700;
  1881.    break;
  1882.   }
  1883.   case 800:
  1884.   {
  1885.    zurueck= z800;
  1886.    break;
  1887.   }
  1888.   case 900:
  1889.   {
  1890.    zurueck= z900;
  1891.    break;
  1892.   }
  1893.   case 1100:
  1894.   {
  1895.    zurueck= z1100;
  1896.    break;
  1897.   }
  1898.   case 1200:
  1899.   {
  1900.    zurueck= z1200;
  1901.    break;
  1902.   }
  1903.   case 1300:
  1904.   {
  1905.    zurueck= z1300;
  1906.    break;
  1907.   }
  1908.   case 1400:
  1909.   {
  1910.    zurueck= z1400;
  1911.    break;
  1912.   }
  1913.   case 1500:
  1914.   {
  1915.    zurueck= z1500;
  1916.    break;
  1917.   }
  1918.   case 1600:
  1919.   {
  1920.    zurueck= z1600;
  1921.    break;
  1922.   }
  1923.   case 1700:
  1924.   {
  1925.    zurueck= z1700;
  1926.    break;
  1927.   }
  1928.   case 1800:
  1929.   {
  1930.    zurueck= z1800;
  1931.    break;
  1932.   }
  1933.   case 1900:
  1934.   {
  1935.    zurueck= z1900;
  1936.    break;
  1937.   }
  1938.   case 3000:
  1939.   {
  1940.    zurueck= z3000;
  1941.    break;
  1942.   }
  1943.   case 3200:
  1944.   {
  1945.    zurueck= z3200;
  1946.    break;
  1947.   }
  1948.   case 5000:
  1949.   {
  1950.    zurueck= z5000;
  1951.    break;
  1952.   }
  1953.   case 6400:
  1954.   {
  1955.    zurueck= z6400;
  1956.    break;
  1957.   }
  1958.   case 10000:
  1959.   {
  1960.    zurueck= z10000;
  1961.    break;
  1962.   }
  1963.   case 12800:
  1964.   {
  1965.    zurueck= z12800;
  1966.    break;
  1967.   }
  1968.   case 15000:
  1969.   {
  1970.    zurueck= z15000;
  1971.    break;
  1972.   }
  1973.   case 20000:
  1974.   {
  1975.    zurueck= z20000;
  1976.    break;
  1977.   }
  1978.   case 25000:
  1979.   {
  1980.    zurueck= z25000;
  1981.    break;
  1982.   }
  1983.   case 25600:
  1984.   {
  1985.    zurueck= z25600;
  1986.    break;
  1987.   }
  1988.   case 30000:
  1989.   {
  1990.    zurueck= z30000;
  1991.    break;
  1992.   }
  1993.   case 51200L:
  1994.   {
  1995.    zurueck= z51200;
  1996.    break;
  1997.   }
  1998.   case 1000:
  1999.   {
  2000.    zurueck= z1000;
  2001.    break;
  2002.   }
  2003.   case 2000:
  2004.   {
  2005.    zurueck= z2000;
  2006.    break;
  2007.   }
  2008.   case 4000:
  2009.   {
  2010.    zurueck= z4000;
  2011.    break;
  2012.   }
  2013.   case 8000:
  2014.   {
  2015.    zurueck= z8000;
  2016.    break;
  2017.   }
  2018.   default:
  2019.   {
  2020.    zurueck=sterne;
  2021.   }
  2022.  }
  2023.  return zurueck;
  2024. }
  2025. /*
  2026. /////////////////////////////////////////////////////////////////////
  2027. */
  2028. PIXPTR Get_Zahl(int Eine_Zahl,PIXPTR Zahl_zeiger)
  2029. {
  2030.  SPLOOK *Hilfe=NULL;
  2031.  Hilfe=Zahl((unsigned int ) Eine_Zahl,Hilfe);
  2032.  Zahl_zeiger=Hilfe->pixbp;
  2033.  return Zahl_zeiger;
  2034. }
  2035. /*
  2036. /////////////////////////////////////////////////////////////////////
  2037. */
  2038. void do_akt(int nummer)
  2039. {
  2040.  int tt,zahl,xx,yy;
  2041.  int x1,y1;
  2042.  BYTE i,aktplane,sb,eb,b,am,breite,hoehe;
  2043.  x1=0;
  2044.  y1=0;
  2045.  setpage(1);
  2046.  showpage(0);
  2047.  Eyes[0]=0;
  2048.  Eyes[1]=0;
  2049.  Eyes[2]=0;
  2050.  Eyes[3]=0;
  2051.  Eyes[4]=0;
  2052.  speed[RED]=0;
  2053.  speed[GELB]=0;
  2054.  speed[GRUEN]=0;
  2055.  speed[LILA]=0;
  2056.  speed_change[0]=0;
  2057.  speed_change[1]=0;
  2058.  speed_change[2]=0;
  2059.  speed_change[3]=0;
  2060.  speed_change[4]=0;
  2061.  show_pic(16,55,15,"pix\\info1");
  2062.  set_color(239,0,0,0);
  2063.  set_color(240,0,0,0);
  2064.  set_color(241,0,0,0);
  2065.  set_color(242,0,0,0);
  2066.  zahl=random(nummer)%5;
  2067.  switch (zahl)
  2068.  {
  2069.   case 0:
  2070.   {
  2071.    show_pic(0,0,14,"pix\\dia1");
  2072.    break;
  2073.   }
  2074.   case 1:
  2075.   {
  2076.    show_pic(0,0,14,"pix\\dia2");
  2077.    break;
  2078.   }
  2079.   case 2:
  2080.   {
  2081.    show_pic(0,0,14,"pix\\dia3");
  2082.    break;
  2083.   }
  2084.   case 3:
  2085.   {
  2086.    show_pic(0,0,14,"pix\\dia4");
  2087.    break;
  2088.   }
  2089.   case 4:
  2090.   {
  2091.    show_pic(0,0,14,"pix\\dia5");
  2092.    break;
  2093.   }
  2094.  }
  2095.  breite=33;
  2096.  hoehe=31;
  2097.  am = (BYTE) (((x1+breite-1)& ~3)-((x1+4)& ~3)) >> 2;
  2098.  sb = (BYTE) (x1 % 4);
  2099.  eb = (BYTE) ((x1+breite-1) % 4);
  2100.  for ( i=0; i<4; ++i )
  2101.  {
  2102.   aktplane=(sb+i) % 4;
  2103.   b=am;
  2104.   if ( aktplane >= sb )
  2105.    ++b;
  2106.   if ( aktplane <= eb )
  2107.    ++b;
  2108.   cpback2scr(1,Back->bitptr[aktplane],x1+i,y1,b,hoehe);
  2109.  }
  2110.  xx = 2*32-12;
  2111.  yy = 4*40-16;
  2112.  PutVideo(dia,1,xx+150,yy-3,TRUE);
  2113.  showpage(1);
  2114.  Back=Save_Back(1,Back);
  2115.  Get_Back(0,Back);
  2116.  page=1;
  2117.  speed[PACMAN]=1;
  2118.  dx =1;
  2119.  richt=1;
  2120.  dy =0;
  2121.  sprites[ PACMAN ].deltax[0] = sprites[ PACMAN ].deltax[1] = dx * 2;
  2122.  sprites[ PACMAN ].deltay[0] = sprites[ PACMAN ].deltay[1] = dy * 2;
  2123.  sprites[PACMAN].richtung=OST;
  2124.  SetSprite( sprites[ PACMAN ].spidp, xx,yy, xx - dx, yy - dy );
  2125.  SetSprite( sprites[ RED ].spidp,xx+21,yy+100, xx+21,yy+100);
  2126.  SetSprite( sprites[ GELB ].spidp,xx+71,yy+100,xx+71,yy+100 );
  2127.  SetSprite( sprites[ GRUEN ].spidp,xx+121,yy+100,xx+121,yy+100 );
  2128.  SetSprite( sprites[ LILA ].spidp,xx+170,yy+100,xx+170,yy+100 );
  2129.  tt=0;
  2130.  while (tt!=300)
  2131.  {
  2132.   tt++;
  2133.   warte();
  2134.   mov_ghost(RED);
  2135.   mov_ghost(GELB);
  2136.   mov_ghost(GRUEN);
  2137.   mov_ghost(LILA);
  2138.   showpage((BYTE) (1-page));
  2139.   RestoreSpriteBg(sprites[PACMAN].spidp,page);
  2140.   RestoreSpriteBg(sprites[RED].spidp,page);
  2141.   RestoreSpriteBg(sprites[GELB].spidp,page);
  2142.   RestoreSpriteBg(sprites[GRUEN].spidp,page);
  2143.   RestoreSpriteBg(sprites[LILA].spidp,page);
  2144.   out=MoveSprite1(sprites[PACMAN].spidp,page,sprites[PACMAN].deltax[page],sprites[PACMAN].deltay[page]);
  2145.   PrintSprite( sprites[PACMAN].spidp, page );
  2146.   PrintSprite( sprites[RED].spidp, page );
  2147.   PrintSprite( sprites[GELB].spidp, page );
  2148.   PrintSprite( sprites[LILA].spidp, page );
  2149.   PrintSprite( sprites[GRUEN].spidp, page );
  2150.   life();
  2151.   if (sprites[PACMAN].spidp->x[1-page]==190)
  2152.   {
  2153.    PutVideo(dia,1,xx+150,yy-3,TRUE);
  2154.    PutBack(Back,diav,xx+150,yy-3);
  2155.    PutVideo(diav,0,xx+150,yy-3,FALSE);
  2156.    PutVideo(diav,1,xx+150,yy-3,FALSE);
  2157.    zz=Get_Zahl(10000+zahl*5000,zz);
  2158.    play_sample(FRESSEN);
  2159.    PutVideo(zz,0,xx+150,yy-3,TRUE);
  2160.    PutVideo(zz,1,xx+150,yy-3,TRUE);
  2161.    PutBack(Back,zz,xx+150,yy-3);
  2162.    ghost_angst[RED]=200;
  2163.    ghost_angst[GRUEN]=200;
  2164.    ghost_angst[LILA]=200;
  2165.    ghost_angst[GELB]=200;
  2166.    fressen=200;
  2167.    PrintSprite( sprites[PACMAN].spidp, page );
  2168.    Punkte+=10000+zahl*5000;
  2169.    Life_counter+=10000+zahl*5000;
  2170.    Print_Score(Punkte);
  2171.   }
  2172.   if (sprites[PACMAN].spidp->x[1-page]==230)
  2173.   {
  2174.    sprites[ PACMAN ].deltax[0] = sprites[ PACMAN ].deltax[1] = 0;
  2175.    sprites[ PACMAN ].deltay[0] = sprites[ PACMAN ].deltay[1] = 0;
  2176.    sprites[PACMAN].spidp->x[1-page]=sprites[PACMAN].spidp->x[page];
  2177.   }
  2178.   bilder();
  2179.   bild++;
  2180.   if (bild==PHASE*8+1)
  2181.    bild=0;
  2182.   page = (page+1) & 1;
  2183.  }
  2184.  key=0;
  2185. }
  2186. /*
  2187. /////////////////////////////////////////////////////////////////////
  2188. */
  2189. void Do_Level(int page)
  2190. {
  2191.   key=page;
  2192.   while ((key!=27)&&(key!=13))
  2193.   {
  2194.    GrafPrintf(20,390,239+14,0," Anfangslevel : %d  ",Start_Level);
  2195.    key=get_kkey();
  2196.    warte();
  2197.    if (key==C_HOCH) Start_Level++;
  2198.    if ((key==C_RUNTER)&&(Start_Level)) Start_Level-=1;
  2199.   }
  2200.   GrafPrintf(20,390,239+14,0,"                           ",Start_Level);
  2201.   key=0;
  2202. }
  2203. void Do_Info(int page)
  2204. {
  2205.  int i=0;
  2206.  Back=Save_Back(page,Back);
  2207.  Get_Back(1-page,Back);
  2208.  setpage(page);
  2209.  showpage(1-page);
  2210.  show_pic(16,55,15,"pix\\info1");
  2211.  Back=Save_Back(page,Back);
  2212.  Get_Back(1-page,Back);
  2213.  gprintf(160-strlen("PAC-MAN")*4,82,239+13,239+2,"PAC-MAN");
  2214.  i=2;
  2215.  gprintf(55,90+(i++)*8,239+12,239+2,"Dieses Programm wurde");
  2216.  i++;
  2217.  gprintf(55,90+(i++)*8,239+12,239+2,"1993 in 'C' geschrieben,");
  2218.  i++;
  2219.  gprintf(55,90+(i++)*8,239+12,239+2,"Grafik-Zeug in Assembler.");
  2220.  i++;
  2221.  i++;
  2222.  gprintf(55,90+(i++)*8,239+11,239+2,"Version 1.2 (1995)");
  2223.  i++;
  2224.  gprintf(55,90+(i++)*8,239+11,239+2,"Kommentare, Kritiken,");
  2225.  i++;
  2226.  gprintf(55,90+(i++)*8,239+11,239+2,"Vorschläge können gerne");
  2227.  i++;
  2228.  gprintf(55,90+(i++)*8,239+11,239+2,"an mich gerichtet werden.");
  2229.  i++;
  2230.  i++;
  2231.  gprintf(55,90+(i++)*8,239+10,239+2,"Adresse siehe Shareware-");
  2232.  i++;
  2233.  gprintf(55,90+(i++)*8,239+10,239+2,"Hinweis.");
  2234.  i++;
  2235.  gprintf(55,90+(i++)*8,239+10,239+2,"FIDO : 2:2457/315.16");
  2236.  i++;
  2237.  i++;
  2238.  i++;
  2239.  gprintf(160-strlen("taste")*4,90+(i++)*8,239+5,239+2,"TASTE");
  2240.  showpage(page);
  2241.  setpage(1-page);
  2242.  K_Clear();
  2243.  while (!key)
  2244.  {
  2245.   key=get_key();
  2246.   warte_d(2);
  2247.  }
  2248. }
  2249. /*
  2250. /////////////////////////////////////////////////////////////////////
  2251. */
  2252. void Do_Share(void)
  2253. {
  2254.  int   i=0;
  2255.  Back=Save_Back(page,Back);
  2256.  Get_Back(1-page,Back);
  2257.  setpage(1-page);
  2258.  showpage(page);
  2259.  show_pic(16,55,15,"pix\\info1");
  2260. /*
  2261.  gprintf(160-strlen("PAC-MAN")*4,82,239+13,239+2,"PAC-MAN");
  2262.  i=2;
  2263.  gprintf(55,90+(i++)*8,239+12,239+2, "Diese Version des");
  2264.  i++;
  2265.  gprintf(55,90+(i++)*8,239+9,239+2,  "Programmes ist ");
  2266.  i++;
  2267.  gprintf(55,90+(i++)*8,239+7,239+2,  "SHAREWARE !!!");
  2268.  i+=2;
  2269.  gprintf(55,90+(i++)*8,239+9,239+2,  "Bitte laßt Euch");
  2270.  i++;
  2271.  gprintf(55,90+(i++)*8,239+10,239+2, "registrieren bei:");
  2272.  i++;
  2273.  gprintf(55,90+(i++)*8,239+10,239+2, "Christopher Salomon");
  2274.  i++;
  2275.  gprintf(55,90+(i++)*8,239+10,239+2, "Steinacker 11A");
  2276.  i++;
  2277.  gprintf(55,90+(i++)*8,239+10,239+2, "57234 Wilnsdorf");
  2278.  i++;
  2279.  gprintf(55,90+(i++)*8,239+10,239+2, "Deutschland");
  2280.  i++;
  2281.  gprintf(55,90+(i++)*8,239+10,239+2, "Viel Spaß");
  2282.  i++;
  2283.  i++;
  2284.  gprintf(55,90+(i++)*8,239+11,239+2,"            Chris");
  2285.  i++;
  2286.  i++;
  2287.  */
  2288.  gprintf(160-strlen("PAC-MAN")*4,82,239+13,239+2,"PAC-MAN");
  2289.  i=2;
  2290.  gprintf(55,90+(i++)*8,239+12,239+2,"   Diese Version des");
  2291.  i++;
  2292.  gprintf(55,90+(i++)*8,239+11,239+2,"     Programmes ist ");
  2293.  i++;
  2294.  gprintf(55,90+(i++)*8,239+10,239+2,"      registriert");
  2295.  i++;
  2296.  gprintf(55,90+(i++)*8,239+10,239+2,"          für");
  2297.  i+=2;
  2298.  i++;
  2299.  gprintf(55,90+(i++)*8,239+7,239+2, "   Internet USERS");
  2300.  i++;
  2301.  i++;
  2302.  gprintf(55,90+(i++)*8,239+10,239+2, "Viel Spaß wünscht");
  2303.  i++;
  2304.  i++;
  2305.  gprintf(55,90+(i++)*8,239+11,239+2,"            ...  Chris");
  2306.  i++;
  2307.  i++;
  2308.  showpage(1-page);
  2309.  setpage(page);
  2310.  K_Clear();
  2311.  while (!key)
  2312.  {
  2313.   key=get_key();
  2314.   warte_d(8);
  2315.  }
  2316. }
  2317. /*
  2318. /////////////////////////////////////////////////////////////////////
  2319. */
  2320. void Do_Game_Over(void)
  2321. {
  2322.  int xx,yy,tt,no_move=0;
  2323.  page=0;
  2324.  setpage(page);
  2325.  showpage(1-page);
  2326.  show_pic(73,140,14,"pix\\pac_sarg");
  2327.  PutVideo( red[0][1]->pixbp,page,92,165, TRUE);
  2328.  PutVideo( gelb[1][1]->pixbp,page,92, 210, TRUE);
  2329.  PutVideo( gruen[2][1]->pixbp,page,130, 155, TRUE);
  2330.  PutVideo( lila[3][1]->pixbp,page,130, 220, TRUE);
  2331.  Back=Save_Back(page,Back);
  2332.  Get_Back(1-page,Back);
  2333.  sprites[PACMAN].spidp->splookp = pacdead;
  2334.  dx =0;
  2335.  richt=-1;
  2336.  dy =-1;
  2337.  xx=183;
  2338.  yy=150;
  2339.  sprites[ PACMAN ].deltax[0] = sprites[ PACMAN ].deltax[1] = dx * 2;
  2340.  sprites[ PACMAN ].deltay[0] = sprites[ PACMAN ].deltay[1] = dy * 2;
  2341.  sprites[PACMAN].richtung=OST;
  2342.  SetSprite( sprites[ PACMAN ].spidp, xx,yy, xx - dx, yy - dy );
  2343.  page=1;
  2344.  tt=0;
  2345.  while (tt!=300)
  2346.  {
  2347.   tt++;
  2348.   warte();
  2349.   if (!no_move)
  2350.   {
  2351.    showpage((BYTE) (1-page));
  2352.    RestoreSpriteBg(sprites[PACMAN].spidp,page);
  2353.    out=MoveSprite1(sprites[PACMAN].spidp,page,sprites[PACMAN].deltax[page],sprites[PACMAN].deltay[page]);
  2354.    PrintSprite( sprites[PACMAN].spidp, page );
  2355.    if (sprites[PACMAN].spidp->y[page]==20)
  2356.    {
  2357.     no_move=1;
  2358.     RestoreSpriteBg(sprites[PACMAN].spidp,page);
  2359.     RestoreSpriteBg(sprites[PACMAN].spidp,1-page);
  2360.    }
  2361.   }
  2362.   page = (page+1) & 1;
  2363.  }
  2364.  setpage(1);
  2365.  showpage(0);
  2366.  show_pic(100,55,14,"pix\\game_o");
  2367.  showpage(1);
  2368.  tt=0;
  2369.  K_Clear();
  2370.  while (!key)
  2371.  {
  2372.   key=get_key();
  2373.   warte_d(2);
  2374.  }
  2375. }
  2376. /*
  2377. /////////////////////////////////////////////////////////////////////
  2378. */
  2379. void Print_Score(unsigned long Score)
  2380. {
  2381.  char    hilfe[25];
  2382.  int i=0;
  2383.  int z=0;
  2384.  ultoa(Score,hilfe,10);
  2385.  while (hilfe[i])
  2386.  {
  2387.   if (hilfe[i]!=statisch[i])
  2388.   {
  2389.    switch (hilfe[i])
  2390.    {
  2391.     case '0':
  2392.     {
  2393.      PutVideo(z_0,0,20+z,385,FALSE);
  2394.      PutVideo(z_0,1,20+z,385,FALSE);
  2395.      break;
  2396.     }
  2397.     case '1':
  2398.     {
  2399.      PutVideo(z_1,0,20+z,385,FALSE);
  2400.      PutVideo(z_1,1,20+z,385,FALSE);
  2401.      break;
  2402.     }
  2403.     case '2':
  2404.     {
  2405.      PutVideo(z_2,0,20+z,385,FALSE);
  2406.      PutVideo(z_2,1,20+z,385,FALSE);
  2407.      break;
  2408.     }
  2409.     case '3':
  2410.     {
  2411.      PutVideo(z_3,0,20+z,385,FALSE);
  2412.      PutVideo(z_3,1,20+z,385,FALSE);
  2413.      break;
  2414.     }
  2415.     case '4':
  2416.     {
  2417.      PutVideo(z_4,0,20+z,385,FALSE);
  2418.      PutVideo(z_4,1,20+z,385,FALSE);
  2419.      break;
  2420.     }
  2421.     case '5':
  2422.     {
  2423.      PutVideo(z_5,0,20+z,385,FALSE);
  2424.      PutVideo(z_5,1,20+z,385,FALSE);
  2425.      break;
  2426.     }
  2427.     case '6':
  2428.     {
  2429.      PutVideo(z_6,0,20+z,385,FALSE);
  2430.      PutVideo(z_6,1,20+z,385,FALSE);
  2431.      break;
  2432.     }
  2433.     case '7':
  2434.     {
  2435.      PutVideo(z_7,0,20+z,385,FALSE);
  2436.      PutVideo(z_7,1,20+z,385,FALSE);
  2437.      break;
  2438.     }
  2439.     case '8':
  2440.     {
  2441.      PutVideo(z_8,0,20+z,385,FALSE);
  2442.      PutVideo(z_8,1,20+z,385,FALSE);
  2443.      break;
  2444.     }
  2445.     case '9':
  2446.     {
  2447.      PutVideo(z_9,0,20+z,385,FALSE);
  2448.      PutVideo(z_9,1,20+z,385,FALSE);
  2449.      break;
  2450.     }
  2451.    }
  2452.    statisch[i]=hilfe[i];
  2453.   }
  2454.   i++;
  2455.   z+=10;               /* anederung von 9 aud 10 */
  2456.  }
  2457. }
  2458. /*
  2459. /////////////////////////////////////////////////////////////////////
  2460. */
  2461. void Print_Score_whole(unsigned long Score)
  2462. {
  2463.  char hilfe[25];
  2464.  int i=0;
  2465.  int z=0;
  2466.  ultoa(Score,hilfe,10);
  2467.  while (hilfe[i])
  2468.  {
  2469.   switch (hilfe[i])
  2470.   {
  2471.    case '0':
  2472.    {
  2473.     PutVideo(z_0,0,20+z,385,FALSE);
  2474.     PutVideo(z_0,1,20+z,385,FALSE);
  2475.     break;
  2476.    }
  2477.    case '1':
  2478.    {
  2479.     PutVideo(z_1,0,20+z,385,FALSE);
  2480.     PutVideo(z_1,1,20+z,385,FALSE);
  2481.     break;
  2482.    }
  2483.    case '2':
  2484.    {
  2485.     PutVideo(z_2,0,20+z,385,FALSE);
  2486.     PutVideo(z_2,1,20+z,385,FALSE);
  2487.     break;
  2488.    }
  2489.    case '3':
  2490.    {
  2491.     PutVideo(z_3,0,20+z,385,FALSE);
  2492.     PutVideo(z_3,1,20+z,385,FALSE);
  2493.     break;
  2494.    }
  2495.    case '4':
  2496.    {
  2497.     PutVideo(z_4,0,20+z,385,FALSE);
  2498.     PutVideo(z_4,1,20+z,385,FALSE);
  2499.     break;
  2500.    }
  2501.    case '5':
  2502.    {
  2503.     PutVideo(z_5,0,20+z,385,FALSE);
  2504.     PutVideo(z_5,1,20+z,385,FALSE);
  2505.     break;
  2506.    }
  2507.    case '6':
  2508.    {
  2509.     PutVideo(z_6,0,20+z,385,FALSE);
  2510.     PutVideo(z_6,1,20+z,385,FALSE);
  2511.     break;
  2512.    }
  2513.    case '7':
  2514.    {
  2515.     PutVideo(z_7,0,20+z,385,FALSE);
  2516.     PutVideo(z_7,1,20+z,385,FALSE);
  2517.     break;
  2518.    }
  2519.    case '8':
  2520.    {
  2521.     PutVideo(z_8,0,20+z,385,FALSE);
  2522.     PutVideo(z_8,1,20+z,385,FALSE);
  2523.     break;
  2524.    }
  2525.    case '9':
  2526.    {
  2527.     PutVideo(z_9,0,20+z,385,FALSE);
  2528.     PutVideo(z_9,1,20+z,385,FALSE);
  2529.     break;
  2530.    }
  2531.   }
  2532.   i++;
  2533.   z+=10;
  2534.  }
  2535. }
  2536. /*
  2537. /////////////////////////////////////////////////////////////////////
  2538. */
  2539. void Do_Speed(int page)
  2540. {
  2541.  Back=Save_Back(page,Back);
  2542.  Get_Back(1-page,Back);
  2543.  page=1;
  2544.  speed[PACMAN]=1;
  2545.  sprites[ PACMAN ].spidp = CreateSprite( Pac[OST][0] );
  2546.  dx =1;
  2547.  richt=1;
  2548.  dy =0;
  2549.  sprites[ PACMAN ].deltax[0] = sprites[ PACMAN ].deltax[1] = dx * 2;
  2550.  sprites[ PACMAN ].deltay[0] = sprites[ PACMAN ].deltay[1] = dy * 2;
  2551.  sprites[PACMAN].richtung=OST;
  2552.  x = 5*32-12;
  2553.  y = 8*40-16;
  2554.  SetSprite( sprites[ PACMAN ].spidp, x, y, x - dx, y - dy );
  2555.  key=0;
  2556.  while ((key!=27)&&(key!=13))
  2557.  {
  2558.   key=get_kkey();
  2559.   warte();
  2560.   if (key==C_HOCH) i_warte+=10;
  2561.   if ((key==C_RUNTER)&&(i_warte)) i_warte-=10;
  2562.   showpage((BYTE) (1-page));
  2563.   GrafPrintf(20,390,239+14,0," Delay : %d  ",i_warte);
  2564.   RestoreSpriteBg(sprites[PACMAN].spidp,page);
  2565.   out=MoveSprite1(sprites[PACMAN].spidp,page,sprites[PACMAN].deltax[page],sprites[PACMAN].deltay[page]);
  2566.   if (out&OUT_LEFT || out&OUT_RIGHT)
  2567.   {
  2568.    if (sprites[PACMAN].deltax[page]>0)
  2569.    {
  2570.     sprites[PACMAN].spidp->x[1-page]=20;
  2571.     sprites[PACMAN].spidp->x[page]=20+sprites[PACMAN].deltax[page]/2;
  2572.     sprites[PACMAN].spidp->old_x[page]=20+sprites[PACMAN].deltax[page]/2;
  2573.    }
  2574.   }
  2575.   PrintSprite( sprites[PACMAN].spidp, page );
  2576.   bilder();
  2577.   bild++;
  2578.   if (bild==PHASE*8+1)
  2579.    bild=0;
  2580.   page = (page+1) & 1;
  2581.  }
  2582.  RemoveSprite( sprites[ PACMAN ].spidp);
  2583.  key=0;
  2584.  Get_Back(0,Back);
  2585.  Get_Back(1,Back);
  2586. }
  2587. /*
  2588. /////////////////////////////////////////////////////////////////////
  2589. */
  2590. void Do_Ghost(void)
  2591. {
  2592.  char *str[2]={"einmal","immer"};
  2593.  key=1;
  2594.  while ((key!=27)&&(key!=13))
  2595.  {
  2596.   GrafPrintf(20,390,239+14,0," Geister verschrecken : %s  ",str[Ghost_fressen]);
  2597.   key=get_kkey();
  2598.   warte();
  2599.   if ((key==C_HOCH)||(key==C_RUNTER))
  2600.    Ghost_fressen=(Ghost_fressen+1)%2;
  2601.  }
  2602.  GrafPrintf(20,390,239+14,0,"                              ");
  2603.  key=0;
  2604. }
  2605. /*
  2606. /////////////////////////////////////////////////////////////////////
  2607. */
  2608.