Code:
function items() // Funktion zum erstellen der Items
{
   while(1)
   {
      paddlebig_pan.flags &= ~SHOW;
      speedball_pan.flags &= ~SHOW;
      paddlesmall_pan.flags &= ~SHOW;
      doubleball_pan.flags &= ~SHOW;
      itemhilfe = integer(random(5) + 1); // itemhilfe nimmt einen zufälligen Wert zwischen 1 und 5 an
      if (itemhilfe == 1) // wenn die itemhilfe kleiner oder gleich 10 ist, aktiviere das PaddleBig-Item
      {
         paddlebig_pan.flags = SHOW;  // FALSE  
         paddlebig_pan.pos_x += 4*time_step;
         paddlebig_pan.pos_y += 2*time_step;
         if ((paddlebig_pan.pos_x >= 931) | (paddlebig_pan.pos_y >= 664))  // FALSE        
         {
            paddlebig_pan.flags &= ~SHOW;
         }
         if ((paddlebig_pan.pos_y > right_pan.pos_y - 12) && (paddlebig_pan.pos_y < right_pan.pos_y + 96) && (paddlebig_pan.pos_x > 943) && (paddlebig_pan.pos_x < 955))
         {
            big_paddle();
            paddlebig_pan.flags &= ~SHOW;
         }
      }
      else if (itemhilfe == 2) // wenn die itemhilfe kleiner oder gleich 20 ist, aktiviere das SpeedBall-Item
      {
         speedball_pan.flags = SHOW;   // FALSE 
         speedball_pan.pos_x += 4*time_step;
         speedball_pan.pos_y += 1*time_step;
         if ((speedball_pan.pos_x >= 931) | (speedball_pan.pos_y >= 664))   // FALSE
         {
            speedball_pan.flags &= ~SHOW;
         }
         if ((speedball_pan.pos_y > right_pan.pos_y - 12) && (speedball_pan.pos_y < right_pan.pos_y + 96) && (speedball_pan.pos_x > 943) && (speedball_pan.pos_x < 955))
         {
            speedball_pan.flags &= ~SHOW;
            ball_speed.x = 3 - 6 * (random(50) % 2); // -3 oder 3, Richtung, in die der Ball beim Start gespielt wird
            ball_speed.y = 3 - random(6); // -3...3, zufällige vertikale Geschwindigkeit beim Start des Spiels
         }
      }
      else if (itemhilfe == 3) // wenn die itemhilfe kleiner oder gleich 30 ist, aktiviere das PaddleSmall-Item
      {
         paddlesmall_pan.flags &= ~SHOW;
         paddlesmall_pan.pos_x += 4*time_step;
         paddlesmall_pan.pos_y += -1*time_step;
         if ((paddlesmall_pan.pos_x >= 931) | (paddlesmall_pan.pos_y >= 664))   // FALSE
         {
            paddlesmall_pan.flags &= ~SHOW;
         }
         if ((paddlesmall_pan.pos_y > right_pan.pos_y - 12) && (paddlesmall_pan.pos_y < right_pan.pos_y + 96) && (paddlesmall_pan.pos_x > 943) && (paddlesmall_pan.pos_x < 955))
         {
            small_paddle();
            paddlesmall_pan.flags &= ~SHOW;
         }
      }
      else if (itemhilfe == 4) // wenn die itemhilfe kleiner oder gleich 40 ist, aktiviere das DoubleBall-Item
      {
         doubleball_pan.flags &= ~SHOW;
         doubleball_pan.pos_x += 4*time_step;
         doubleball_pan.pos_y += -2*time_step;
         if ((doubleball_pan.pos_x >= 931) | (doubleball_pan.pos_y >= 664))   // FALSE
         {
            doubleball_pan.flags &= ~SHOW;
         }
      }
      wait(1);
   }
}


I mark the faults with "FALSE" in your code. And so have to be a corrected indentation look... wink



Last edited by Widi; 05/23/10 17:24.