Mattie

Mattie

Apr 5th, 2010
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1.     public void controleerBotsing(String kleur)
  2.     //doet een controle of 1 van de bomberman's enige andere bomberman overlapt
  3.     //zo ja dan wordt botsing true en wordt de verplaatsing teruggedraait
  4.     {
  5.         botsing = false;
  6.         //BELANGRIJK! DIT IS VAN 0 TOT GETAL DUS 3 == MAXIMUM!
  7.         int aantal_checks_om_te_doen = 3; //ofwel aantal bomerman's in het spel
  8.         //BELANGRIJK! DIT IS VAN 0 TOT GETAL DUS 3 == MAXIMUM!
  9.         int aantal_checks_gedaan = 0;
  10.  
  11.         int objectnummer_om_te_checken = 0;
  12.         int objectnummer3 = 0;
  13.  
  14.         for (int i = 0; i <= aantal_checks_om_te_doen; i++)
  15.         {
  16.             for (int positie = 0; positie < objecten.size(); positie++)
  17.             {
  18.                 Bomberman b1 = objecten.get(positie);
  19.                 Bomberman b2 = objecten.get(objectnummer_om_te_checken);
  20.                 //objectnummer3 = b.objectnummer2;
  21.  
  22.                 if (Botsing.overlapt(b2, b1) && b1 != b2)
  23.                 {
  24.                     botsing = true;
  25.                 }
  26.  
  27.                 if (positie == 3)
  28.                 {
  29.                     if (!botsing)
  30.                     {
  31.                         aantal_checks_gedaan++;
  32.  
  33.                         if (aantal_checks_gedaan <= aantal_checks_om_te_doen)
  34.                         {
  35.                             objectnummer_om_te_checken++;
  36.                         }
  37.                     }
  38.                 }
  39.             }
  40.         }
  41.     }
Add Comment
Please, Sign In to add comment